HTML 到 PDF 转换器的替代品?
我已经使用 Winnovative HTML 到 PDF 转换器几年了,但我注意到质量可能会受到影响,因为图像等首先必须以 HTML 格式呈现,然后才能转换为 PDF 格式。
Winnovative 有另一个选项,您可以在输出结果之前将对象添加到 PDF 转换器,但由于这允许您添加 HTML 元素,我想这与 HTML 到 PDF 转换器的工作方式类似(就渲染而言)。
是否有替代方案,以便我可以在 ASP.NET Web 应用程序中生成 PDF,而不必首先将其呈现为 HTML?
我正在寻找最高品质的选择
I've been using the Winnovative HTML to PDF converter for a few years, but I've noticed the quality can be impared because the images etc have first had to be rendered in HTML before being converted into a PDF format.
Winnovative have another option where you can add objects to the PDF Converter before outputting the result, but as this allows you to add HTML elements, I imagine this works in a similar way to the HTML to PDF converter (in terms of rendering).
Is there an alternative to this so that I can generate a PDF in my ASP.NET Web Application without it first having to be rendered as HTML?
I'm looking for the most high quality option
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 iTextSharp 库。它具有整个 PDF 文档的对象表示,因此它允许您添加所需的任何元素,而无需从 html 元素进行翻译。它还允许您将 html 转换为 pdf,但是当然您可以通过从基本块构建 PDF 文档来手动完成...
如果您将使用版本
4.x
那么它可以免费使用商业项目(LGPL 许可证)。版本5.x
可在 Affero 通用公共许可证上使用,因此我相信您必须购买它才能在商业项目中使用,但我描述的功能可在4.x< /代码>版本
You can use iTextSharp library. It has an object representation of whole PDF document so it will allow you to add any elements you need without translating it from html elements. It also allows you to convert html to pdf, but of course you can do it manually instead by building PDF document from basic blocks...
If you will use version
4.x
then it's free to use in commercial projects (LGPL license). Version5.x
is avaible on Affero General Public License so I believe you have to buy it to use in commercial projects, but the features I've described are avaible in the4.x
version尝试 http://wkhtmltopdf.org/
与 iTextSharp 相比,它的速度快如闪电。
有关分步安装的信息,请查看以下文章:
http://www.megustaulises.com/2012/12/mvcnet-convert-html-to-pdf-with-pechkin.html
http://w3facility.org/question/how- to-pass-html-as-a-string-using-wkhtmltopdf/
本手册:
http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf -0.9.9-doc.html
try http://wkhtmltopdf.org/
it's lightning fast in comparison to iTextSharp.
For step by step installation check out these articles:
http://www.megustaulises.com/2012/12/mvcnet-convert-html-to-pdf-with-pechkin.html
http://w3facility.org/question/how-to-pass-html-as-a-string-using-wkhtmltopdf/
And this manual:
http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html