PDFCreator doesn't print programmatically

Hello,

I'm using the latest version of PDFCreator, and it works fine. However, when I try to use the PDFCreator printer programmatically - it doesn't work. It creates a much larger file (272 Kb vs 9 kb), which I cannot open. I'm getting this message:

"Adobe Acrobat Reader could not open 'SFL_6073W_B.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)."

Exactly the same problem is with CutePDF Writer and some other printers. I've found out that the printer actually prints postscript files rather than PDFs. Why? This is a PDF printer.

How to fix this?

Thank you.

Hi,

please explain how exactly you are using PDFCreator programmatically?
It is a application for converting printable files into PDF,not directly a PDF printer.
The printer driver converts GDI to Postscript, which is then converted to PDF outside of the actual printing process.
You can use the COM interface to create PDFs programmatically with PDFCreator.

Best regards

Robin

Hi Robin,

Thank you.

I've created the program in C# to print Crystal Reports PDF. In short -

PrinterSettings ps = new PrinterSettings();
PageSettings pgs = new PageSettings();
rpt.PrintOptions.CopyTo(ps, pgs);
ps.PrinterName = "PDFCreator";
ps.PrintToFile = true;
rpt.PrintToPrinter(ps, pgs, false);

I thought that PDFCreator is a PDF printer. Many PDF programs create postscript instead of PDF, but not all of them. For instance, Microsoft Print to PDF or Win2PDF do print PDF files. Unfortunately, they are missing some features that we need, so we cannot use them.

Converting postscript to PDF is an extra step that we are trying to avoid.

Peter

Hi,

you could try to disable the ps.PrintToFile option, this is only intended for hardware printers and will probably fix the issue.

Best regards

Robin