Page 9 of 16

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Posted: Wed Oct 10, 2012 6:46 am
by bpd2000
Now it is time to create utility, than can convert code of print to hmg_hpdf version by one click

or have some idea

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Posted: Wed Oct 10, 2012 7:25 am
by Rathinagiri
The simple way is find+replace in notepad++. I did it for GridPrint and got it successful in minutes.

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Posted: Wed Oct 10, 2012 8:26 am
by esgici
rathinagiri wrote:...
I can't fully understand your proposition. Can you please explain using a small sample/template program as to how do you want?
I mean something like this :

Code: Select all

aLinesToPrint :=  {  'This is sample Line 1" ,;         // An array contains lines to print
                             'This is sample Line 2",;
                             'This is sample Line 3" }

         SET HPDFPAGE LINESPACING TO 10

         START HPDFPAGE 

              HPDFPRINT SetRowTo 10   // <= New command; Move write-cursor to row 10      ( Like SetPos() )
              HPDFPRINT SetColTo 10   // <= New command; Move write-cursor to col 10

              FOR nLineNo := 1 TO LEN( aLinesToPrint )
                      
                    HPDFPRINT PRINT_TEXT aLinesToPrint[ nLineNo ]  <...> // <= New command 
                                     // <...> : other PRINT options, is same as @ ... PRINT command

              NEXT nLineNo    

         END HPDFPAGE

/*

In this case this command not required; because SET HPDFPAGE LINESPACING TO works internally after each HPDFPRINT PRINT_TEXT 

                   HPDFPRINT MoveRowTo 10    // <= New command; Move write-cursor 10 mm down from current  row; 
                                                              //  also accept values less than 0 ( negative) for moving up

This command also meaniless for now

                   HPDFPRINT MoveColTo  10   // <= New command; Move write-cursor 10 mm right from current  col
                                                              //  also accept values less than 0 ( negative) for moving left     

*/



instead of

Code: Select all

         
aLinesToPrint :=  {  'This is sample Line 1" ,;         // An array contains lines to print
                             'This is sample Line 2",;
                             'This is sample Line 3" }

        START HPDFPAGE 

              nLineRow := 10

              FOR nLineNo := 1 TO LEN( aLinesToPrint )
                      
                    @  nLineRow, 20 HPDFPRINT aLinesToPrint[ nLineNo ]

                     nLineRow += 10
 
               NEXT nLineNo    

         END HPDFPAGE

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Posted: Wed Oct 10, 2012 4:18 pm
by mol
rathinagiri wrote:
Is it possible to set liespacing in normal printing?
IMHO, it is. Since all the printing is done using @ row, col we can fix the line spacing as we require. Isn't it?

Please consider this:

Code: Select all

....
nLineSpacing := 5 // line spacing is 5 mm
nFirstRow := 10 // first row starts at 10 mm
nLastRow := 280 // last row is set at 280 mm
nCurrentRow := nFirstRow
lReportContinue := .t.
do while lReportContinue
   @ nCurrentRow, 10 HPDFPRINT cData
   nCurrentRow := nCurrentRow + nLineSpacing
   cData := CurrentRecord()
   if LastRecord() 
      lReportContinue := .f.
   endif
   if nCurrentRow > nLastRow
      END HPDFPAGE
      START HPDFPAGE
      nCurrentRow := nFirstRow
   endif
enddo
.....
Does line-spacing determined by <nRow> value of @ ... command ?

If we have 'print' without @ ... command; between such commands :

HPDF_PRINT BEGIN TEXT
.
HPDF_PRINT PRINT ...
.
HPDF_PRINT END TEXT
Hi Esgici,

I can't fully understand your proposition. Can you please explain using a small sample/template program as to how do you want?
I've mentioned normal printing printing text in rectangular area, not creating .pdf with command
@ x1,y1 PRINT TO x2,y2

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Posted: Fri Oct 12, 2012 8:47 pm
by IMATECH
Direct Pdf Print:


Instead of viewing PDF file, you can print PDF file directly to selected printer :)



Use following command:

Code: Select all

ShellExecute(0, "Printto", CHR( 34 ) + cPdfFileToPrint + CHR( 34 ), CHR( 34 ) + cPrinterName + CHR( 34 ), 0, 0)
The PrintTo Shell Command
Some applications support the 'printto' action. PrintTo can be used to specify the name of the printer used for the print action. Printer is determined by 3 parameter: printer name, drive name and port.


Regards

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Posted: Wed Oct 17, 2012 8:10 am
by sudip
Thanks a lot to all of you. Back after long time. I shall download and test it.
With best regards.
Sudip

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Posted: Wed Oct 17, 2012 8:15 am
by sudip
Thanks a looooot :D :D :D
It's fantastic !!!
Thanks Esgici, for telling me about this :D :D :D

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Posted: Wed Oct 17, 2012 11:23 am
by claudiotedesco
Hola Gente

No saben porque cuando compilo me da el siguiente error?
Hay que compilarlo en alguna carpeta determinada?
Gracias
Claudio


hbmk2: Processing configuration: C:\hmg\harbour\bin\hbmk.cfg
hbmk2: Processing: pdf.hbc
hbmk2: Linking... pdf.exe
c:/hmg/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: cannot find -lpng
collect2: ld returned 1 exit status
hbmk2: Error: Running linker. 1
gcc.exe .hbmk\win\mingw\main.o .hbmk\win\mingw\hmg_hpdf.o .hbmk\win\mingw\_hbmkaut.o _temp.o -mwindows -Wl,--start-group -lpng -lhmg -lhbmysql -lmysql -lcrypt -ledit -leditex -lgraph -lini -lreport -lhbwin -lhbziparc -lhbmzip -lmsvfw32 -lvfw32 -lsddodbc -lrddsql -lsddmy -lhbodbc -lodbc32 -lhbhpdf -lhbvpdf -lhbmemio -lhbsqlit3 -lsqlite3 -lhbfimage -lhbpgsql -lpq -lhbtip -lhbct -lhbmisc -lhbnetio -lxhb -lhbextern -lhbdebug -lhbvm -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib -Wl,--end-group -opdf.exe -LC:/hmg/harbour/lib -LC:/hmg//lib -LC:/hmg/SAMPLES/pdf/

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Posted: Wed Oct 17, 2012 12:09 pm
by bpd2000
claudiotedesco wrote:Hola Gente

No saben porque cuando compilo me da el siguiente error?
Hay que compilarlo en alguna carpeta determinada?
Gracias
Claudio [/color]
Add following in c:\hmg\hmg.hbc

libs=libhpdf
libs=png

Section : # harbour contrib libs

Re: HMG_HPDF - Export to PDF made easy... (New Version)

Posted: Tue Oct 23, 2012 12:02 am
by esgici
rathinagiri wrote: ... a small documentation for HMG_HPDF using HMG_HPDF. :)
A small offer as an extension to your "small" documentation : HMG-HPDF doc.
Screen shoot of HMG_HPDF_Fonts prg
Screen shoot of HMG_HPDF_Fonts prg
HMG-HPDF_Fonts.PNG (75.18 KiB) Viewed 6731 times
HPDF_Fonts.zip
Source files of HMG_HPDF_Fonts prg
(15.7 KiB) Downloaded 447 times
Happy HMG'ing :D