0

Is there a way to print a file to a custom printer and do nothing to the file.

I mean, could I print a pdf-file and just have the file be sent through the printer as a pdf file, instead of as a postscript or a pcl file?

Or I mean could I catch the file before it is being "converted"?

Best regards Joe

Joe
  • 2,675
  • 3
  • 21
  • 26
  • 2
    Sure. Don't print it in the first place. Just keep the PDF file. (If that solution doesn't work for you, then [edit] your question to better explain what it is you're trying to accomplish.) – Ken White Feb 14 '14 at 13:58
  • See [`Delphi: How to print a PDF without showing it?`](http://stackoverflow.com/q/2055307/576719). Or just `ShellExecute(Handle, 'print', PChar('c:\document.pdf'), nil, nil, SW_HIDE);` – LU RD Feb 14 '14 at 14:00
  • 2
    If you want to send the job to any printer, see [`Print Documents From Delphi - Print PDF, DOC, XLS, HTML, RTF, DOCX, TXT`](http://delphi.about.com/od/delphitips2009/qt/delphi-print-documents-shellexecute-print-printto.htm). – LU RD Feb 14 '14 at 15:36
  • Sending a raw file directly to the printer, in a language that it doesn't understand, is an easy way to generate recyclable paper. – Chris Thornton Feb 14 '14 at 21:36

1 Answers1

1

Could I print a PDF file and just have the file be sent through the printer as a PDF file, instead of as a PostScript or a PCL file?

If you have a printer that understands PDF then this would be possible. However, I know of no such thing. Invariably printers are either PostScript or PCL.

You should not be constraining yourself to specific printer languages unless you are writing a printer driver. Otherwise you'll need to use a PDF library to interpret the PDF and then send it to the printer via GDI and the printer driver software.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490