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
 PDF pages to multiple TIF files.
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

GA334

USA
2 Posts

Posted - Feb 09 2025 :  13:38:51  Show Profile  Reply
Hi All -

I have a PDF with ~5k pages.
What I need to do is load the PDF and search each page's data, (for creating a filename) and then copy the page out to a tiff file.
There will be ~ 5k TIF files when done.

I was thinking of using ImageEnView.PDfViewer but I can't figure out how to save a page to a TIF file...

Seemed so easy but no joy here.

Any suggestions?

I hope its not too obvious... :)

Thanks!
GA

xequte

38796 Posts

Posted - Feb 09 2025 :  18:03:24  Show Profile  Reply
Hi

You can do it as follows:

// Save all pages of PDF to Jpeg
ImageEnView1.PdfViewer.Enabled := True;
ImageEnView1.IO.LoadFromFile( filename );
for i := 0 to ImageEnView1.PdfViewer.PageCount - 1 do
begin
  ImageEnView1.PdfViewer.PageIndex := i;
  ImageEnView1.IO.SaveToFile( 'D:\' + ExtractFilename( ChangeFileExt( filename, '_' + IntToStr( i + 1 ) + '.jpg' )));
end;


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

GA334

USA
2 Posts

Posted - Feb 10 2025 :  05:47:08  Show Profile  Reply
Well that was simple:)
I was certain I tried that and it saved all pages of the pdf <!?>
Thank you.

However when I save in TIFF format and use the following :

    ImgEn.IO.Params.TIFF_Compression := ioTIFF_JPEG ;
    ImgEn.IO.SaveToFileTIFF(IntToStr(X1)+'.tif');


the output is too blurry for reading the fine print on the page.
(The PDF contains forms with pretty small type)

Previously I have used Universal Document Converter Print-Driver to 'print' to a tiff file and the output is crisp and filesize for each page is only ~ 42k.
Using ioTIFF_LZW the output size is 250k and ioTIFF_JPEG is 144k

Any suggestions?

Thanks again!
GA
Go to Top of Page

xequte

38796 Posts

Posted - Feb 10 2025 :  16:57:57  Show Profile  Reply
Hi

What are your values for JPEG Quality:

https://www.imageen.com/help/TIOParams.TIFF_JPEGQuality.html

And PDF DPI?

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

Also, is the PDF just black and white? If so one of the monochrome compression methods may be better.


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