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.
Marco Turco
SOFTWARE XP LLP
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.
Marco,
You could convert the TIFF files to JPG files using the new FWH function GDIPlusConvertImage( cImageIni, cImageEnd ) and then use function FWJPGTOPDF()
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 cPDFstatic function Emf2Jpeg( cEMF )
local cJpeg := cFileSetExt( cEMF, "jpg" )
local cBuf, lRet := .f.
GDIPlusConvertImage( cEMF, cJpeg )
cBuf := If( File( cJpeg ), MemoRead( cJpeg ), "" )
FErase( cJpeg )
return cBufVery Good Idea !!!
You might have worked with this change.
Any feedback about the quality and size ?
Manuel,
Great! ![]()
![]()
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.
Enrico,
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 ![]()
nageswaragunupudi wrote:Very Good Idea !!!
You might have worked with this change.
Any feedback about the quality and size ?
Manuel,
Cual es tu email por favor?.
Gracias
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
We should be able to read not only from resources, but directly from any image file and memory and save to file also.
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()