itextsharp HTMLWorker [不建议使用]

编程入门 行业动态 更新时间:2024-10-10 02:20:30
本文介绍了itextsharp HTMLWorker [不建议使用]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用itextsharp dll(v5.5.9.0)从Asp Mvc中的Html生成PDF。在这里,我使用的是类 HTMLWorker 。我得到的结果符合我的要求。现在工作正常。但它显示为 [已弃用] 。将来,它是否会起作用/支持? (或者我可以移动到xmlworker吗?)

I have using itextsharp dll(v5.5.9.0) for generating a PDF from Html in Asp Mvc. In this, I am using a class HTMLWorker. I get a result that matches my requirement. It's working fine now. But it shows as [deprecated]. In the future, will it be working/supported or not? (or can I move to xmlworker?)

推荐答案

HTMLWorker 类已弃用。它是作为一个解析小HTML片段的个人项目而开始的。它的编写没有明确的设计。它需要在一个特定项目中服务于个人的目的。

The HTMLWorker class is deprecated. It was started as a personal project to parse small HTML snippets. It was written without a clear design. It needed to serve the purpose of an individual in one specific project.

然而,它以某种方式进入主要版本并且人们开始将它用于它的目的没有建成。人们抱怨错误而不知道 HTMLWorker 从来没有打算做任何繁重的工作。

However, it got into the main release somehow and people started to use it for purposes for which it wasn't built. People complained about bugs without knowing that HTMLWorker was never meant to do any heavy lifting.

其他开发人员开始改进 HTMLWorker 但很快就遇到了有缺陷的设计(以及意粉代码)的限制。

Other developers started improving HTMLWorker but soon hit the limitations of the flawed design (and the spaghetti code).

XML worker是由iText Group支付的开发人员完成的项目。它用于不同的项目。它不是一个URL2PDF工具,因为它无法将复杂的网页转换为PDF,但它允许您使用直接的HTML和CSS创建模板,填充这些模板,并将它们转换为PDF 。

XML worker is a project that was done by developers paid for by iText Group. It is used in different projects. It wasn't meant as an URL2PDF tool, in the sense that it can't convert a complex web page to PDF, but it allows you to create templates using straight-forward HTML and CSS, populate those templates, and convert them to PDF.

XML Worker受到这样的影响,即iText最初并不是为了呈现HTML。例如:在iText 5(和以前的版本)中,不会继承诸如字体,颜色等属性。这些缺陷已在iText 7中修复.XML Worker尚未移植到iText 7,但它是我们技术路线图中的下一个。

XML Worker suffers from the fact that iText initially wasn't meant to render HTML. For instance: in iText 5 (and previous versions), properties such as fonts, colors,... aren't inherited. These flaws are fixed in iText 7. XML Worker hasn't been ported to iText 7 yet, but it's next on our technical road map.

总结: 您不应使用 HTMLWorker 。将来不会支持它。

To summarize: you shouldn't use HTMLWorker. It won't be supported in the future.

更多推荐

itextsharp HTMLWorker [不建议使用]

本文发布于:2023-11-24 23:09:41,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627268.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:建议   itextsharp   HTMLWorker

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!