PDA

View Full Version : Tools / Libraries for printing PDF files?



alitoh
6th March 2013, 21:51
Does anybody have any experience with PDF?

I have a pdf file which I want to print (to an HP USB Printer) programatically, and in a way that's transparent to the user: as in 'The user just presses "Print report" and the PDF file is printed automatically (it is NEVER displayed on screen, I recieve this file via network and I just want to send it straight to printer).

Does anyone have any idea on how to achieve this?
Ideally I'm looking a dll or something to use in a manner such as

CrazyPDFLib PdfObject;
PdfObject->sendToPrinter(wackyParameters);


Otherwise, some sort of information about libraries that might do something like that is also welcome.

Also, if you know command prompt applications that do something similar, I might also be able to use.

Platform details:
*Windows 7
*Qt 4.8.2
*Visual Studio 2010
*Printer, if it is of any use, is HP Officejet Pro 8100 (via USB port). Printer drivers are installed.


If I'm not quite clear (which is a possibility), please do let me know and I will try to elaborate on whatever's left unclear.

Regards,
Alejandro

wysota
6th March 2013, 22:02
Which platform?

alitoh
6th March 2013, 22:10
*OP UPDATED*

Windows 7, qt 4.8.2, printer, if it is of any use, is HP Officejet Pro 8100 (via USB port). Printer drivers are installed.
VisualStudio 2010.


Also, and to be honest, I thought it would be rather straightforward to use some adobe library, but the only one I found was AcroPDF and it's an ActiveX object that I can't seem to use in my non-MFC class/Application

wysota
6th March 2013, 22:30
You can surely use poppler library and QPrinter but there probably is some Windows equivalent of lpr that can do what you want. Qt doesn't really offer anything in this regard by itself (apart QPrinter of course).

lanz
7th March 2013, 06:27
but the only one I found was AcroPDF and it's an ActiveX object that I can't seem to use in my non-MFC class/Application
Take a look at QAxObject (http://qt-project.org/doc/qt-4.8/qaxobject.html)
I've succesfully used it for Excel interop.