在 ASP.NET 中从完全渲染的页面生成 PDF
有谁知道有一个组件(开源或第 3 方)可以让您在 C# 中将完全渲染的 HTML 页面导出为 PDF?我们有一个页面,其 DOM 使用 jquery 进行了修改,但我们尝试过的方法(ABCpdf.NET、WebClient 等)没有在 PDF 中注册来自 javascript 的任何 DOM 更改。我们需要以编程方式将渲染的 HTML(后 jquery)即时导出为 PDF。
Does anyone know of a component (open source or 3rd party) that would allow you to export a fully rendered HTML page to PDF in c#? We have a page that has its DOM modified with jquery but the methods we have tried (ABCpdf.NET, WebClient, etc) don't register any DOM changes from javascript in the PDF. We need to programmatically export that rendered HTML (post-jquery) to PDF on the fly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
ExpertPDF HtmlToPdf Converter v7.0
ExpertPDF HtmlToPdf Converter v7.0
几个月前我一直在寻找类似的东西,据我所知,任何免费的第三方控件都是不可能的。有付费的。您可以获得的最接近的是iTextSharp。它将允许您导出特定 html tad 和用户控件的内容,但处理起来有点麻烦
I was looking for something similar many months ago and as far as I can remember, it's not possible with any free third-party controls. There are paid ones available. The closest you can get is iTextSharp. It will allow you to export the contents of specific html tads and user controls but it's a bit of a pain to deal with
我从未尝试过,但有一个名为 wkhtmltopdf 的开源解决方案,可以从使用 WebKit 引擎的 HTML/JavaScript/CSS。 这篇文章讨论了一些关于使用它的内容。如果它有效,我想知道,因为我在这里多次听到过这个请求。
I'm never tried is but there's an open source solution called wkhtmltopdf that renders a PDF from HTML/JavaScript/CSS using the WebKit engine. This post talks a little bit about using it. If it works I'd like to know because I've heard this request a couple of times here.