将HTML导出为PDF(C ++,Windows)

时间:2022-03-10 21:10:06

I am looking for a redistributable component to convert HTML to PDF.

我正在寻找一个可再发行的组件来将HTML转换为PDF。

I would - at the moment - like to avoid using a "PDF printer", as this requires a printer installation and some user "playing around" in the printers panel might break that feature.

我现在 - 就像避免使用“PDF打印机”一样,因为这需要打印机安装,而某些用户在打印机面板中“玩”可能会破坏该功能。

The HTML is available in a Browser control or as external file. The HTML is normally fairly simple, but customers can create their own templates, so a "good range" of HTML should be supported.

HTML可在浏览器控件或外部文件中使用。 HTML通常相当简单,但客户可以创建自己的模板,因此应该支持“范围广泛”的HTML。

Should be accessible for an automated process from C++ - DLL / COM / external executable with command line support are all fine.

应该可以从C ++自动化进程访问 - DLL / COM /外部可执行文件与命令行支持都很好。

Commercial is fine, but in the thousands is not an option right now.

商业很好,但现在成千上万不是一个选择。

So, which components do you know or can you recommend?

那么,您知道或推荐哪些组件?

3 个解决方案

#1


2  

PDFCreator can function as a virtual printer but it's also usable via COM. The default setup even includes COM examples.

PDFCreator可以作为虚拟打印机使用,但也可以通过COM使用。默认设置甚至包括COM示例。

You can check the COM samples in the SourceForge SVN repository right here: http://pdfcreator.svn.sourceforge.net/viewvc/pdfcreator/trunk/COM/

您可以在此处检查SourceForge SVN存储库中的COM示例:http://pdfcreator.svn.sourceforge.net/viewvc/pdfcreator/trunk/COM/

#2


0  

If you have Microsoft Word installed, I guess you could automate the whole process using the "save as pdf" plugin that can be downloaded from the Microsoft Office Site.

如果您安装了Microsoft Word,我想您可以使用可以从Microsoft Office站点下载的“另存为pdf”插件自动执行整个过程。

You would automate word then open the HTML document inside word, then output as PDF. Might be worth a shot, if you're developing in a Microsoft Environment.

您将自动化word然后在word中打开HTML文档,然后输出为PDF。如果您在Microsoft环境中开发,可能值得一试。

#3


0  

You might want to have a look at PDFReactor

您可能想看看PDFReactor

#1


2  

PDFCreator can function as a virtual printer but it's also usable via COM. The default setup even includes COM examples.

PDFCreator可以作为虚拟打印机使用,但也可以通过COM使用。默认设置甚至包括COM示例。

You can check the COM samples in the SourceForge SVN repository right here: http://pdfcreator.svn.sourceforge.net/viewvc/pdfcreator/trunk/COM/

您可以在此处检查SourceForge SVN存储库中的COM示例:http://pdfcreator.svn.sourceforge.net/viewvc/pdfcreator/trunk/COM/

#2


0  

If you have Microsoft Word installed, I guess you could automate the whole process using the "save as pdf" plugin that can be downloaded from the Microsoft Office Site.

如果您安装了Microsoft Word,我想您可以使用可以从Microsoft Office站点下载的“另存为pdf”插件自动执行整个过程。

You would automate word then open the HTML document inside word, then output as PDF. Might be worth a shot, if you're developing in a Microsoft Environment.

您将自动化word然后在word中打开HTML文档,然后输出为PDF。如果您在Microsoft环境中开发,可能值得一试。

#3


0  

You might want to have a look at PDFReactor

您可能想看看PDFReactor