简体   繁体   English

将PDF打印到HDC(MFC设备上下文)

[英]Printing PDF to HDC (MFC device context)

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...) 我正在修改C ++应用程序,我想使用MFC打印逻辑(OnPrint ...)添加打印和现有PDF的功能

Is there any method to print a PDF into the MFC? 有什么方法可以将PDF打印到MFC中? Now I'm converting the PDF to a BMP but sometimes the quality is not so great. 现在,我将PDF转换为BMP,但有时质量不是很好。

Unless something's changed recently you need a 3rd party library to print PDF files. 除非最近有所更改,否则您需要第3方库来打印PDF文件。 One direction you can take is to convert to PS and then use ghostscript to translate to printer speak. 您可以采取的一种方向是转换为PS,然后使用ghostscript转换为打印机语音。 Ghostscript also has the power to convert PDF to PS. Ghostscript还具有将PDF转换为PS的功能。

I don't think MFC's own printing logic will work. 我认为MFC自己的打印逻辑不会起作用。

Adobe distributes a PDF ActiveX control (primarily for viewing PDFs in IE) that can also be hosted in an MFC application. Adobe分发了PDF ActiveX控件(主要用于在IE中查看PDF),该控件也可以托管在MFC应用程序中。 It includes the following methods: Print , PrintAll , PrintAllFit , PrintPages , PrintPagesFit and PrintWithDialog . 它包括以下方法: PrintPrintAllPrintAllFitPrintPagesPrintPagesFitPrintWithDialog

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM