ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Convert a multi-page PDF into a multi page TIF
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

jeffp

USA
42 Posts

Posted - Nov 07 2024 :  13:42:13  Show Profile  Reply
I can load a multi page PDF into the TIEPdfViewer. Once loaded how can I then save it out to a multi-page TIF file?

TImageEnView.IO.SaveToFile only seems to save out the first page to a TIF file.


jp

xequte

38607 Posts

Posted - Nov 07 2024 :  16:20:14  Show Profile  Reply
Hi Jeff

Assuming you are dealing only with typical sized PDFs then the easiest way is to use a TIEMultiBitmap or TImageEnMView:

// Convert a PDF to a multi-page TIFF
mbmp := TIEMultiBitmap.Create();
mbmp.LoadFromFile( 'D:\input.pdf' );
mbmp.SaveToFile( 'D:\output.tiff' );
mbmp.Free;


If the PDF files are huge (e.g. 100+ pages at high resolution), then you would be better to build up the TIFF file a page at a time, e.g. using TIETIFFHandler:

http://www.imageen.com/help/TIETIFFHandler.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

jeffp

USA
42 Posts

Posted - Nov 07 2024 :  17:09:26  Show Profile  Reply
Using TIEMultiBitmap is there a way to set the TIF Compression I want, which is LZW.

And is the the best way to convert one file type to another? For example, will it convert TIF to PDF?
jp
Go to Top of Page

xequte

38607 Posts

Posted - Nov 07 2024 :  21:20:07  Show Profile  Reply
Hi Jeff

You can do it as follows:
// Change the compression method for a TIFF file
MBitmap := TIEMultiBitmap.Create();
MBitmap.LoadFromFile( 'C:\MyImage.pdf' );
MBitmap.Params[ 0 ].TIFF_Compression := ioTIFF_LZW;
MBitmap.DuplicateCompressionInfo();
MBitmap.SaveToFile( 'C:\OutImage.tiff' );
MBitmap.Free;

http://www.imageen.com/help/TIEMultiBitmap.DuplicateCompressionInfo.html

You don't need to actively "convert" the document, it saves in whatever format you specify, e.g. here because you are saving with the extension .tiff, it saves as a TIFF file.



Nigel
Xequte Software
www.imageen.com
Go to Top of Page

HeartWare

Denmark
50 Posts

Posted - Nov 12 2024 :  04:46:43  Show Profile  Reply
Is there an easy to way to convert a PDF file to a series of PNG files in full resolution using only ImageEn ?
Go to Top of Page

xequte

38607 Posts

Posted - Nov 13 2024 :  13:46:12  Show Profile  Reply
Hi

It would be the same method as above:

// Change the compression method for a TIFF file
MBitmap := TIEMultiBitmap.Create();
MBitmap.LoadFromFile( 'C:\MyImage.pdf' );
MBitmap.SaveToFile( 'C:\OutImage.png' );
MBitmap.Free;


To improve the quality of the PDF (make the PDF files larger), set the PdfViewerDefaults.Dpi:

http://www.imageen.com/help/TIEGlobalSettings.PdfViewerDefaults.html

You will also need to include iepdf32.dll

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: