Generating PDF files from .NET by using standard .NET GDI printing classes
Posted
by Philippe Leybaert
on Stack Overflow
See other posts from Stack Overflow
or by Philippe Leybaert
Published on 2009-07-10T13:05:32Z
Indexed on
2010/05/10
9:24 UTC
Read the original article
Hit count: 323
I'm looking for a way to generate PDF files using the standard PrintDocument and Graphics (GDI) classes in .NET. As far as I know, the only way to do that is by printing to a PDF printer.
The problem is that a PDF printer driver always asks for a filename, but I need to control the filename from my code. Using a PDF library like PDFSharp or DynamicPDF is not an option, because they all provide their own API for generating PDF files.
I need this for an internal application, so dependencies are not a problem.
My question is simple: is there a way to control a printer driver (Adobe Acrobat, PDFCreator, ...) in such a way that a filename can be specified and the user is not prompted for anything?
© Stack Overflow or respective owner