function FWIMAGESTOPDF( aJpg, cPDF )
local i
local oPdf := FWPdf():New( cPDF )
local aFilesDelete:= {}
local cJpg
if ValType( aJpg ) != 'A'
aJpg := { aJpg }
endif
for i = 1 to len( aJpg )
cJpg := aJpg[i]
if Upper( cFileExt( cJpg ) ) != "JPG"
cJpg:= cFileSetExt( cJpg, "jpg" )
aadd( aFileDelete, cJpg )
GDIPlusConvertImage( aJpg[i], cJpg )
endif
oPdf:nPage++
oPdf:WritePage( MemoRead( cJpg ) )
next
oPdf:Close()
if len(aFilesDelete) > 0
AEval( aFilesDelete, { |cJpg| FErase( cJpg ) } )
endif
return cPDF
static function Emf2Jpeg( cEMF )
local cJpeg := cFileSetExt( cEMF, "jpg" )
local cBuf, lRet := .f.
GDIPlusConvertImage( cEMF, cJpeg )
cBuf := If( File( cJpeg ), MemoRead( cJpeg ), "" )
FErase( cJpeg )
return cBuf
mastintin wrote:And proposed change for fwh code : ( Bye Bye freeImage)
Enrico Maria Giordano wrote:mastintin wrote:And proposed change for fwh code : ( Bye Bye freeImage)
Great! But... what about IMAGE control?
EMG
nageswaragunupudi wrote:We still need freeimage.dll in some cases like this.
It is better to reduce dependence on this dll in as many modules as we can.
nageswaragunupudi wrote:Very Good Idea !!!
You might have worked with this change.
Any feedback about the quality and size ?
Antonio Linares wrote:I just emailed Manuel Alvarez (Mastintin) to know if GDI+ provides us a function to load images from resources and we will be much closer to finally drop FreeImage.dll use
Marco Turco wrote:Hi all,
I'm using the FWJPGTOPDF function to convert several jpg files in a single PDF file and it runs well.
I would like to know if there is a way to generate a PDF importing Tiff files.
Thank you in advance.
Antonio Linares wrote:Marco,
You could convert the TIFF files to JPG files using the new FWH function GDIPlusConvertImage( cImageIni, cImageEnd ) and then use function FWJPGTOPDF()
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 56 guests