create a pdf
Posted: Wed Apr 21, 2021 9:07 am
I want to print the contents of a window in a pdf
how should i do?
how should i do?
www.FiveTechSoft.com
https://forums.fivetechsupport.com/
Code: Select all | Expand
function WndToPdf( oWnd, cPdf )
local cJpg := cFileSetExt( cPdf, "jpg" )
local oPrn
oWnd:SaveAsImage( cJpg, 100 )
PRINT oPrn PREVIEW FILE cPdf
PAGE
@ 1,1 PRINT TO oPrn IMAGE cJpg
ENDPAGE
ENDPRINT
return nil
nageswaragunupudi wrote:Code: Select all | Expand
function WndToPdf( oWnd, cPdf )
local cJpg := cFileSetExt( cPdf, "jpg" )
local oPrn
oWnd:SaveAsImage( cJpg, 100 )
PRINT oPrn PREVIEW FILE cPdf
PAGE
@ 1,1 PRINT TO oPrn IMAGE cJpg
ENDPAGE
ENDPRINT
return nil
nageswaragunupudi wrote:The function must have saved test.jpg before creating test.pdf. Check the quality of test.jpg
Code: Select all | Expand
function WndToPdf( oWnd, cPdf )
local cJpg := cFileSetExt( cPdf, "jpg" )
local oPrn
oWnd:SaveAsImage( cJpg, 100 )
PRINT oPrn PREVIEW FILE cPdf
PAGE
@ 1,1 PRINT TO oPrn IMAGE cJpg
ENDPAGE
ENDPRINT
return nil
Code: Select all | Expand
procedure WndToPdf( oWnd, cPdf )
local cJpg := cFileSetExt( cPdf, "jpg" )
local oPrn
oWnd:SaveAsImage( cJpg, 100 )
FwJpgToPdf(cJpg, cPdf)
return
Code: Select all | Expand
FwJpgToPdf(cJpg, cPdf)
AntoninoP wrote:I see, the problem is that calls PGJPEG1 with the size of the page, instead of with the size of image... it is should be quick fix... maybe with the new lib haru interface, is possible create a pdf without change the quality of jpg
Code: Select all | Expand
REQUEST FWHARU
Code: Select all | Expand
TPrinter():lUseHaruPDF := .t.