views:

49

answers:

2

Hi,

I'm modifying a C++ application and I'd like to add the ability to print and existing PDF using the MFC printing logic (OnPrint...)

Is there any method to print a PDF into the MFC? Now I'm converting the PDF to a BMP but sometimes the quality is not so great.

+2  A: 

Unless something's changed recently you need a 3rd party library to print PDF files. One direction you can take is to convert to PS and then use ghostscript to translate to printer speak. Ghostscript also has the power to convert PDF to PS.

Noah Roberts
A: 

I don't think MFC's own printing logic will work.

Adobe distributes a PDF ActiveX control (primarily for viewing PDFs in IE) that can also be hosted in an MFC application. It includes the following methods: Print, PrintAll, PrintAllFit, PrintPages, PrintPagesFit and PrintWithDialog.

Jerry Coffin