problem in printing function

Topic Specific Tutorials and Tips.

Moderator: Rathinagiri

viren092002
Posts: 17
Joined: Mon Apr 01, 2013 12:15 pm

problem in printing function

Post by viren092002 »

I HAVE DEVLOP A CODE FOR PRINTING FILE ON PRINTER, IT IS ORIGNALY DEVLOPED WITH CLIPPER 5.3B, NOW I TRY IT TO RUN UNDER HMG 3.1.1, I HAVE FOUND FOLLOWING PROBLEMS

(1) I HAVE CHANGE MY CODE, I HAVE CREATE A FILE ON DISK AND THEN USE WIN_PRINTFILERAW() FUNCTION TO PRINT IT ON PRINTER,

WIN_PRINTFILERAW(WIN_PRINTERGETDEFAULT(),FILENAME,"PRINT OUT FORM SOFTWARE")

WHERE FILENAME IS THE VARIABLE CONTAINS NAME OF FILE WITH EXTENTION

THIS NOT WORK, NOTHING PRINTS ON PRINTER,

(2) I HAVE USE MOLDRUK.PRG TO PRINT, IT WORKS GOOD AND PRINTS WELL, BUT IT DISTURBS THE DISPLAY OF MY SOFTWARE,

SUPPOSE THAT I HAVE DRAW LINES AND BOXES USING DIFFERENT COLORS, BUT SOFTWARE DISPLAYS BOXES OF SOME OTHER CHARACTERS, LIKE "?"

PLEASE HELP
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: problem in printing function

Post by Rathinagiri »

It will be better if you use the HMG print functions. It has many options.

If you have to print from Grid or Array, you can use HFCL gridprint function to directly print to win printers.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: problem in printing function

Post by Javier Tovar »

Hola Rathinagiri,

Tratando de limpiar mi PC de archivos obsoletos y conservar los archivos buenos; trato de compilar el ejemplo que viene en HFCL el ejemplo de GridPrint pero me sale este error:

Code: Select all

Harbour 3.2.0dev (r1312060701)
Copyright (c) 1999-2013, http://harbour-project.org/
C:/hmg.3.2/lib/libhfcl.a(GridPrint.o):GridPrint.c:(.data+0x758): undefined reference to `HB_FUN_ISCONTROLDEFINE'
collect2: ld returned 1 exit status
hbmk2: Error: Ejecutando enlazador. 1
gcc.exe C:/Users/MAQUIN~1/AppData/Local/Temp/hbmk_nbuyq6.dir/main.o C:/Users/MAQUIN~1/AppData/Local/Temp/hbmk_nbuyq6.dir/hbmk_jsavmj.o C:/hmg.3.2/Mios/GridPrint/_temp.o    -Wl,--nxcompat -Wl,--dynamicbase -mwindows -Wl,--start-group -lhmg -lcrypt -ledit -leditex -lgraph -lhfcl -lini -lreport -lmsvfw32 -lvfw32 -lhbct -lhbwin -lhbmzip -lminizip -lhbmemio -lhbmisc -lhbmysql -lmysql -lhbtip -lsqlite3 -lhbsqlit3 -lsddodbc -lrddsql -lsddmy -lhbodbc -lodbc32 -lhbhpdf -lhbfimage -lhbpgsql -lhbnetio -lxhb -lpng -llibhpdf -lhbvpdf -lhbzebra -lhbextern -lhbdebug -lhbvmmt -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainwin -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib   -Wl,--end-group -omain.exe  -LC:/hmg.3.2/harbour/lib/win/mingw -LC:/hmg.3.2/lib

hbmk2: Error: Funci¢n(es) referenciada, no encontrada, pero desconocida:
       ISCONTROLDEFINE()

Y lo compilo con la versión HMG.3.1.5 y si se compila bien!. Ya se había tratado este problema?

Saludos
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


Hello Rathinagiri ,

Trying to clean my PC for obsolete files and keep good records ; I try to compile the example that comes in the example of HFCL GRIDprint but I get this error:

Code: Select all

Harbour 3.2.0dev ( r1312060701 )
Copyright ( c ) 1999-2013 , http://harbour-project.org/" onclick="window.open(this.href);return false;
C :/ hmg.3.2/lib/libhfcl.a ( GridPrint.o ) GridPrint.c : ( . Data +0 x758 ) : undefined reference to ` HB_FUN_ISCONTROLDEFINE '
collect2 : ld returned 1 exit status
hbmk2 : Error : Running linker. 1
gcc.exe C :/ Users / ~ 1/AppData/Local/Temp/hbmk_nbuyq6.dir/main.o MAQUIN C :/ Users / ~ 1/AppData/Local/Temp/hbmk_nbuyq6.dir/hbmk_jsavmj.o C :/ MAQUIN hmg.3.2/Mios/GridPrint/_temp.o -Wl, - NXCOMPAT -Wl, - DynamicBase - mwindows -Wl, - start -group- lcrypt - lhmg - ledit - leditex - lgraph - lhfcl - lini - lreport - lmsvfw32 - lvfw32 - lhbct - lhbwin - lhbmzip - lminizip - lhbmemio - lhbmisc - lhbmysql - lmysql - lhbtip - lsqlite3 - lhbsqlit3 - lsddodbc - lrddsql - lsddmy - lhbodbc - lodbc32 - lhbhpdf - lhbfimage - lhbpgsql - lhbnetio - lxhb - lpng - llibhpdf - lhbvpdf - lhbzebra - lhbextern - lhbdebug - lhbvmmt - lhbrtl - lhblang - lhbcpage - lgtcgi - lgtpca - lgtstd - lgtwin - lgtwvt - lgtgui - lhbrdd - lhbuddall - lhbusrrdd - lrddntx - lrddcdx - lrddnsx - lrddfpt - lhbrdd - lhbhsx - lhbsix - lhbmacro - lhbcplr - lhbpp - lhbcommon - lhbmainwin - lkernel32 - luser32 - lgdi32 - ladvapi32 - lws2_32 - lwinspool - lcomctl32 - lcomdlg32 - lshell32 - luuid - lole32 - loleaut32 - lmpr - lwinmm - lmapi32 - limm32 - lmsimg32 - lwininet - lhbpcre - lhbzlib -Wl, - end -group- omain.exe -LC -LC :/ :/ hmg.3.2/harbour/lib/win/mingw hmg.3.2/lib

hbmk2 : Error: Function ¢ n (s ) referenced , not found , but unknown :
       ISCONTROLDEFINE ( )
?
And I compile with HMG.3.1.5 version and it compiles fine ! . He had already dealt with this problem?

regards
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: problem in printing function

Post by Rathinagiri »

I will check up and come back. Thanks for the report.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: problem in printing function

Post by srvet_claudio »

Rathinagiri wrote:I will check up and come back. Thanks for the report.
Hi Rathi,
please check in GridPrint.prg and GridPDF.prg files of HFCL,

where it says:
IsControlDefine

should say:
IsControlDefined
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: problem in printing function

Post by mol »

I'm still using such a construction and it works OK for me:

Code: Select all

TmpPrintFile := TempFile(kat_TMP,"tmp",0)
set printer to &TmpPrintFile
set device to print
setprc(0,0)
@ prow(), pcol() say "Here is something to print..."
set printer to
set device to screen
WIN_PRINTFILERAW( WIN_PRINTERGETDEFAULT(), TmpPrintFile , "text mode printing job")
	
*----------------
function TempFile
	param cFolder, cExt, nFileAttr
	local cFileName, nHandle
	cFileName := cFolder+ if(right(cFolder,1)<>"\","\","")+strtran(str(numxor(val(dtos(date())),seconds()),8)," ","0")+"."+cExt
return cFileName
*---------------
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: problem in printing function

Post by bpd2000 »

mol wrote:I'm still using such a construction and it works OK for me:

Code: Select all

TmpPrintFile := TempFile(kat_TMP,"tmp",0)
set printer to &TmpPrintFile
set device to print
setprc(0,0)
@ prow(), pcol() say "Here is something to print..."
set printer to
set device to screen
WIN_PRINTFILERAW( WIN_PRINTERGETDEFAULT(), TmpPrintFile , "text mode printing job")
	
*----------------
function TempFile
	param cFolder, cExt, nFileAttr
	local cFileName, nHandle
	cFileName := cFolder+ if(right(cFolder,1)<>"\","\","")+strtran(str(numxor(val(dtos(date())),seconds()),8)," ","0")+"."+cExt
return cFileName
*---------------
Dear Mol
How to send print to Virtual printer i.e. DOS2USB
I could not test with above code, what changes require because dos2usb does not show in printer's list
BPD
Convert Dream into Reality through HMG
User avatar
mol
Posts: 3720
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: problem in printing function

Post by mol »

bpd2000 wrote: Dear Mol
How to send print to Virtual printer i.e. DOS2USB
I could not test with above code, what changes require because dos2usb does not show in printer's list
I don't know DOS2USB application.
You don't need this software, I think.
When you capture your printout by

Code: Select all

set device to print
set printer to &TmpPrintFile
everything you send to printer is captured to TmpPrintFile.
Then, you can send it to any windows printer by WIN_PRINTFILERAW.
You must remember to send control codes (PCL language for hp and almost all laser printers, ESC-P for dot matrix).
When your printer does not support control codes (DGI printers where whole job is preprocessed on computer), you can use MOLPrint.exe (I've posted whole code some years ago).

I hope this information was useful for you...
User avatar
bpd2000
Posts: 1207
Joined: Sat Sep 10, 2011 4:07 am
Location: India

Re: problem in printing function

Post by bpd2000 »

Thank you Mol for your guidance
Regards
BPD
Convert Dream into Reality through HMG
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: problem in printing function

Post by Javier Tovar »

srvet_claudio wrote:Hi Rathi,
please check in GridPrint.prg and GridPDF.prg files of HFCL,

where it says:
IsControlDefine

should say:
IsControlDefined
+1
Post Reply