使用 ExpertPDF/Aspose.Pdf 组件将 Html 转换为 PDF 需要很长时间
我正在尝试根据我们的网络应用程序生成的动态生成的 HTML 报告生成 PDF 文件。
HTML 生成和渲染速度很快(1-4 秒),但在较旧的浏览器 (IE6/IE7) 中除外,但当我使用上述任一 PDF 组件生成 PDF 版本时,可能需要长达几分钟的时间。
例如,我有一个仅包含文本(大约 100 万个字符)的 HTML 报告,需要约 28 秒才能转换为 PDF 文件,该文件大小仅为 1.15MB,约 250 页。
有没有办法优化 HTML,使 PDF 组件的工作更轻松?
I am trying to generate a PDF file based on a dynamically generated HTML report that our webapplication has generated.
The HTML generation and rendering is fast (1-4s) except in older browsers (IE6/IE7), but when I use either one of the mentioned PDF components to generate the PDF version, it can take up to several minutes.
For instance I have an HTML report that contains only text - approximately 1 million characters - which takes ~28s to convert to a PDF file, which is only 1.15MB in size and ~250 pages.
Is there any way to optimize the HTML, to make the job easier for the PDF components?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我认为您需要检查以下组件来解决您的问题。
他们提供了用于检查转换的在线演示...
http://www.essentialobjects.com/Products/EOPdf/Default.aspx
http://www.winnovative-software.com/
参考:查看此页面答案及其评论...
在 .NET 中将 HTML 转换为 PDF
I think you need to check below component for you question..
They give online demo for checking conversion....
http://www.essentialobjects.com/Products/EOPdf/Default.aspx
http://www.winnovative-software.com/
For Ref: Check out this page answer and it's comments...
Convert HTML to PDF in .NET
如果您可以共享示例输入 HTML 文件以及代码片段,那就更好了。此外,我们最近发布了新版本的 Aspose.Pdf for .NET(版本6.3.0)。请尝试一下,看看它是否对您的情况有帮助。如果您仍然发现同样的问题,那么我建议您在 Aspose.Pdf 论坛。我们的支持团队将进一步调查并相应地为您提供指导。
披露:我在 Aspose 担任开发人员传播者。
It would be better if you could share a sample input HTML file along with the code snippet. Moreover, we have recently published a newer version of Aspose.Pdf for .NET (version 6.3.0). Please try with that and see if it helps in your scenario. If you still find the same issue then I would recommend you to post the query along with input HTML and code snippet in Aspose.Pdf forum. Our support team will further investigate it and guide you accordingly.
Disclosure: I work as developer evangelist at Aspose.
最好尽量避免使用 HTML -->如果可以的话,PDF 转换 - 有时会产生很多问题。
我尝试了其他两种方法(都是免费的),尽管有很大不同,但效果都很好:
Better try to avoid HTML --> PDF conversion if you can - it makes lots of problems sometimes.
I've tried two other approaches (both are free of charge) and both are working very well, although are much different:
您可以尝试 Ecrion Software(www.ecrion.com) 的 XF 渲染引擎。他们还有一个所见即所得的设计师。
谢谢
You can try XF Rendering Engine from Ecrion Software(www.ecrion.com). They have also a WYSIWYG designer.
Thanks
我在很多项目中使用过,速度更快,稳定。尝试以下
http://code.google.com/p/dompdf/
I have used in many projects, its faster and stable. Try follwoing
http://code.google.com/p/dompdf/