[python-win32] Printing PDFs without external tools

Andreas Holtz A.Holtz at gmx.net
Tue Mar 4 07:47:13 CET 2014


Hi Tim,

the printer I want to use is a HP 5550DTN.
The specifications can be found here:
http://h20195.www2.hp.com/V2/GetPDF%2Easpx%2F5982%2D6714EEE%2Epdf
On page 2 under printer languages "PDF 1.3" is written.
Therefore I think I can print PDFs without the use of Adobe or any other 3rd party software (like Ghostscript).
But I don't know how...

Thanks

Andreas

schrieb Tim Roberts am 04.03.2014 05:52:
> On Mar 3, 2014, at 1:14 PM, Andreas Holtz <A.Holtz at gmx.net> wrote:
>>
>> I need want to print PDF files without the usage of tools like Adobe, Foxit, etc.
>> THe printer does understand PDF files, but I have no idea how to do it.
>
> I doubt that.  PDFs contain PostScript, but there’s more to it than just PostScript.  What printer, exactly are you talking about?
>
>
>> I played around with
>>      win32api.ShellExecute(0, "print", pdf, None, ".", 0)
>> but I am missing the possibilities to change layout and paper size.
>
> That function will run whatever program is registered to render PDF files, which is usually the Acrobat Reader, and asks that it to print without presenting a dialog
>
>
>> Is there really no way to print PDFs with Python setting whatever print settings I want?
>> I thought Python can do anything... :’-(
>
> Python can do anything, but Python is not always the EASIEST way to do something.  In this case, you have encountered limitations of the Win32 API, not of Python.  The Acrobat Reader can be controlled via COM to set layout and paper size, but I want to find out what your printer is before going any deeper.
>


More information about the python-win32 mailing list