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
 PDFium flatten metadata
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

hinsona

14 Posts

Posted - Apr 17 2024 :  13:20:02  Show Profile  Reply
Is there a way using the plugin to flatten metadata layers and export / save the PDF? We've found that some viewers have issues viewing this metadata and would rather flatten the layered data to avoid issues.

Thanks.

xequte

38608 Posts

Posted - Apr 17 2024 :  21:49:34  Show Profile  Reply
Hi

PDFium provides no way at present to modify the meta-data of a PDF file.


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

hinsona

14 Posts

Posted - Apr 18 2024 :  16:36:38  Show Profile  Reply
Nigel,

Thank you for letting me know. I suppose printing to a PDF printer might flatten the PDF. I need to test to see what it does.
I was thinking that as a last resort, maybe exporting each page as an image and then importing the image as a page within the PDF.
Go to Top of Page

xequte

38608 Posts

Posted - Apr 18 2024 :  22:30:40  Show Profile  Reply
Hi

If you were to open the PDF in ImageEn and then save it using ImageEn's native PDF that would convert each page to an image and you could remove all of the meta-data, e.g.

http://www.imageen.com/help/TIOParams.PDF_Author.html

In fact, you should just be able to use:

ImageEnMView.MIO.LoadFromFile('in.pdf');
ImageEnMView.MIO.SaveToFile('out.pdf');

That would use PDFium to get an image of each page, and then save it using ImageEn's native PDF saving to output each image as a page.

Note: I did not test it, but OTOMH it should work.



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

hinsona

14 Posts

Posted - Apr 19 2024 :  10:43:55  Show Profile  Reply
Nigel,

Thank you, I'll give that a try.
Go to Top of Page

hinsona

14 Posts

Posted - Apr 25 2024 :  14:23:48  Show Profile  Reply
I gave this a try, and it does work. The only downside is that it increases the file size by about 4 times the original (1.2MB to 5MB).

If I print the PDF to the "Microsoft Print to PDF" printer, it only increases it by 65KB.

Acrobat metadata - Before print to PDF.



Acrobat metadata - After print to PDF.




If some other way to merge down metadata pops up, please let me know. Until then, while not a perfect solution this will have to work for now.

Thanks!
Go to Top of Page

xequte

38608 Posts

Posted - Apr 25 2024 :  17:44:07  Show Profile  Reply
Hi

Make sure you set the Compression of Page 0:

http://www.imageen.com/help/TIOParams.PDF_Compression.html

And duplicate it to all pages:

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

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

hinsona

14 Posts

Posted - Apr 30 2024 :  10:15:22  Show Profile  Reply
Thank you for the tip. I'll see if this helps.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: