Export HTML to PDF (C++, Windows)

拈花ヽ惹草 提交于 2019-12-06 03:29:42

问题


I am looking for a redistributable component to convert HTML to 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.

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.

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

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

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


回答1:


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

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




回答2:


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.

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.




回答3:


You might want to have a look at PDFReactor



来源:https://stackoverflow.com/questions/323354/export-html-to-pdf-c-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!