Assuming I have a test.pdf file in the current directory, I would like to send this raw file to the printer using the PyQt gui printer.
The following Python3 code prints the PDF source code! I do not want Qt to create a PDF for me, but just send it to a printer with the gui dialog box.
This should work on any OS ( lp ) ... provided that the printer device understands PDF natively.
import sys, PyQt4.QtCore, PyQt4.QtGui def pdf(): pdf = open('test.pdf', encoding='utf-8').read()
source share