Tiff to PDF
- Marco Turco
- Posts: 858
- Joined: Fri Oct 07, 2005 12:00 pm
- Location: London
- Contact:
Tiff to PDF
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.
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.
Best Regards,
Marco Turco
SOFTWARE XP LLP
Marco Turco
SOFTWARE XP LLP
- Antonio Linares
- Site Admin
- Posts: 42508
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 30 times
- Been thanked: 73 times
- Contact:
Re: Tiff to PDF
Marco,
You could convert the TIFF files to JPG files using the new FWH function GDIPlusConvertImage( cImageIni, cImageEnd ) and then use function FWJPGTOPDF()
You could convert the TIFF files to JPG files using the new FWH function GDIPlusConvertImage( cImageIni, cImageEnd ) and then use function FWJPGTOPDF()
Re: Tiff to PDF
Antonio, Marco ...
New function for fwh ...
And proposed change for fwh code : ( Bye Bye freeImage)
New function for fwh ...
Code: Select all | Expand
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
And proposed change for fwh code : ( Bye Bye freeImage)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Code: Select all | Expand
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
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Tiff to PDF
Very Good Idea !!!
You might have worked with this change.
Any feedback about the quality and size ?
You might have worked with this change.
Any feedback about the quality and size ?
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Antonio Linares
- Site Admin
- Posts: 42508
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 30 times
- Been thanked: 73 times
- Contact:
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 3 times
- Contact:
Re: Tiff to PDF
mastintin wrote:And proposed change for fwh code : ( Bye Bye freeImage)
Great! But... what about IMAGE control?
EMG
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Tiff to PDF
Enrico Maria Giordano wrote:mastintin wrote:And proposed change for fwh code : ( Bye Bye freeImage)
Great! But... what about IMAGE control?
EMG
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.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 3 times
- Contact:
Re: Tiff to PDF
Rao,
Any chance to drop freeimage for loading an image too?
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.
Any chance to drop freeimage for loading an image too?
EMG
- Antonio Linares
- Site Admin
- Posts: 42508
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 30 times
- Been thanked: 73 times
- Contact:
Re: Tiff to PDF
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![Smile :-)](./images/smilies/icon_smile.gif)
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
![Smile :-)](./images/smilies/icon_smile.gif)
Re: Tiff to PDF
nageswaragunupudi wrote:Very Good Idea !!!
You might have worked with this change.
Any feedback about the quality and size ?
Size -> some as original
quality -> default 7 ...about 70% as original .
![Sad :(](./images/smilies/icon_sad.gif)
![Smile :)](./images/smilies/icon_smile.gif)
- lucasdebeltran
- Posts: 1303
- Joined: Tue Jul 21, 2009 8:12 am
- Contact:
Re: Tiff to PDF
Manuel,
Cual es tu email por favor?.
Gracias
Cual es tu email por favor?.
Gracias
Muchas gracias. Many thanks.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
Un saludo, Best regards,
Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]
Implementando MSVC 2010, FWH64 y ADO.
Abandonando uso xHarbour y SQLRDD.
- Enrico Maria Giordano
- Posts: 8753
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 3 times
- Contact:
Re: Tiff to PDF
Antonio,
Very good!
EMG
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
Very good!
EMG
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Tiff to PDF
We should be able to read not only from resources, but directly from any image file and memory and save to file also.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10721
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 8 times
- Contact:
Re: Tiff to PDF
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.
You can also consider using pdf libraries (contrib) of (x)Harbour. Using those libraries you can embed tiff, jpeg, png and bmp files into pdf.
We are not using these libraries for FWH because we like to restrict dependence on 3rd party libs.
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Tiff to PDF
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()
Hi Antonio,
What about multipage tif files? It only converts first page to jpg file. Is there any workaround?
Thanks.
Regards,
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04
Hakan ONEMLI
Harbour & MSVC 2022 & FWH 23.04