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
 Normalize PDF page width & height
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aleatprog

135 Posts

Posted - Jul 12 2023 :  10:42:02  Show Profile  Reply
Hi,

merging a PDF data output (992x1403px; 49kb) with a PDF scan (2760x3898px; 160Kb), MIO.SaveToFile generates the following PDF output (206Kb):





Normalizing these page sizes with TIOParams.PDF_PaperSize, the PDF output is 992x1403px for both pages but 34,7Mb as they are no longer text but images now.





Following the code I used to generate the normalized output:

ImageEnMView1.MIO.Params[0].PDF_PaperSize := iepA4;
ImageEnMView1.MIO.Params[0].PDF_ImageOptions := [iepioShrinkOnly, iepioCentered];
ImageEnMView1.MIO.DuplicateCompressionInfo(True);
ImageEnMView1.MIO.SaveToFile('c:\...\output.pdf', False);


Is there a way to normalize the page sizes inside a PDF document maintaining the text and obtaining a similar file size as the original (206Kb)?

Ale

xequte

38616 Posts

Posted - Jul 12 2023 :  23:24:59  Show Profile  Reply
Hi Ale

I'm afraid ImageEn does not have native support for loading PDF files. It can only import them as images. Please see the PDF section at:

http://www.imageen.com/help/File_Formats.html#PDF



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

aleatprog

135 Posts

Posted - Jul 13 2023 :  09:11:10  Show Profile  Reply
Hi Nigel,

TIOParams.PDF_PaperSize is ok for PDF images generated by scanner. For searchable PDF, is there a function for normalizing or resizing PDF pages in ImageEnView.PdfViewer?

Ale
Go to Top of Page

xequte

38616 Posts

Posted - Jul 13 2023 :  19:04:13  Show Profile  Reply
Hi Ale

If you are using IEVision's TIEVisionSearchablePDFGenerator class:

https://www.imageen.com/help/TIEVisionSearchablePDFGenerator.html

Then the PDF page will be created at the size and DPI of the image (i.e. Width x Height / Dpi). You can set the DPI of the image before adding the page (i.e. calling TIEVisionSearchablePDFGenerator.addPage) to scale it:

https://www.imageen.com/help/TIEVisionImage.setDPI.html


For the PDF Viewer, the size of the PDF page as displayed on-screen and when output to bitmap is controlled by IEGlobalSettings().PdfViewerDefaults.DPI:

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



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