Welcome Guest Search | Active Topics | Sign In | Register

Is there a way to Flatten a pdf? Options
Sanorbix
Posted: Tuesday, July 28, 2020 12:02:56 PM
Rank: Member
Groups: Member

Joined: 8/8/2019
Posts: 16
Hi -
Is there a way to Flatten a pdf? Or to make interactive contents just a static contents?.
I know I can set the interactive contents as readonly which will disable editing of interactive contents but they remain interactive contents in the output pdf, but my requirement is for it to be rendered flat.

Thanks,

eo_support
Posted: Tuesday, July 28, 2020 12:59:02 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

There is no built-in support for you to do that. However you can use PdfDocument.Print to print the interactive PDF file to "Microsoft Print to PDF" printer to get a static PDF file. The code will be something like this:

Code: C#
PdfDocument doc = new PdfDocument(source_pdf_file);
PrinterSettings ps = new PrinterSettings();
ps.PrinterName = "Microsoft Print to PDF";
doc.Print(ps).WaitOne();


Note that:
1. You can only use this feature with a valid EO.Pdf license. If you do not apply a valid EO.Pdf license key, you will get an exception;
2. The "Microsoft Print to PDF" printer driver will prompt for the result PDF file name. So it still requires user intervention.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.