0

I need to write a C# utility that would batch print Dynamic PDF files to PDF, thereby 'flatenning' them. I am struggling with the printing part.

I would like to try and avoid using third party packages if possible.

So far I have come across three options that might fit the bill, all of which rely on the "Microsoft Print to PDF" printer:

  1. making a call to LPR: Process.Start("LPR -S "Microsoft Print to PDF" -P raw <pdf file path>); But with this I don't know how to specify where the output goes (or where it goes in the first place)

    1a. Use one of the solutions here with "Microsoft Print to PDF" - Printing a PDF Silently with Adobe Acrobat However, this still leaves me unable to specify the output file.

  1. Use a native class such as PrintDocument (with "Microsoft Print to PDF"), this seems to require something else to render the dynamic PDF documents and split them into separate pages. That then brings me into the third party package territory, which I would rather avoid.

What am I missing or how can I remediate the problems I outlined in the points above?

Thanks in advance

0 Answers0