具有完整 CSS 支持的开源 HTML 到 PDF 渲染器 [英] Open Source HTML to PDF Renderer with Full CSS Support
问题描述
在 here 但这似乎是不可能的......所以我想我将不得不尝试其他的东西.
I asked about getting iTextSharp to render a PDF from HTML and a CSS sheet before here but it seems like that may not be possible... So I guess I will have to try something else.
是否有开源 .NET/C# 库可以将 HTML 和 CSS 作为输入并正确呈现?
Is there an open source .NET/C# library out there that can take HTML and CSS as input and render it correctly?
我必须重申......图书馆必须是免费的,最好是具有相当自由的许可证的东西.我在这里工作时基本没有预算.
I must reiterate... the library MUST be free and preferably something with a fairly liberal license. I'm working with basically no budget here.
推荐答案
我一直在命令行中使用它,而不是作为库使用,而是 HTMLDOC 给了我很好的结果,它至少可以处理一些 CSS(我看不出有多少).
I've always used it on the command line and not as a library, but HTMLDOC gives me excellent results, and it handles at least some CSS (I couldn't easily see how much).
这是一个示例命令行
htmldoc --webpage -t pdf --size letter --fontsize 10pt index.html > index.pdf
这篇关于具有完整 CSS 支持的开源 HTML 到 PDF 渲染器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!