如何使用Java脚本或Asp.Net中的任何其他选项将具有动态图像的整个HTML页面导出为PDF [英] How to Export a whole HTML Page that has dyanamic images to PDF using Java Script or any other option in Asp.Net

查看:88
本文介绍了如何使用Java脚本或Asp.Net中的任何其他选项将具有动态图像的整个HTML页面导出为PDF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一种情况,我必须将HTML页面中显示的报告导出为PDF。该页面包含一些文本,如报告ID,客户名称,产品名称和一些动态来自数据库的图像。我需要将包含图像的报告页面导出到PDF页面。为此,我使用了iTextSharp ddl它可以工作,但问题是它无法保持文本和图像的位置,文档得到合并。更多的是我使用了来自https://github.com/MrRio/jsPDF/的JSPPDF插件,但我仍然无法使用它。

如果任何机构知道如何使用其中任何一个或任何其他选项那么请帮我举个例子。

提前谢谢。

I have a situation where I have to Export a Report Shown in a HTML page to PDF.The page contains some text Like Report ID, Customer Name, Product Name and some images that has come from database dynamically. And I need to export the Report page with images to a PDF page. For that I have used iTextSharp ddl it works but the problem is that it could not maintain the position of text and images and the document get merged. More over I have used JSPPDF plugin from https://github.com/MrRio/jsPDF/ but I still unable to use it.
If any body who know how to use either or any other option then please help me with example.
Thank you in advance.

推荐答案

我看不出iTextSharp有什么问题,但是你可以我想尝试一下: http://wkhtmltopdf.org/ [ ^ ]
I can't see what the problem with iTextSharp, but you may want to give a try to this: http://wkhtmltopdf.org/[^]


如果您可以将报告设计为html文档(以及为什么不这样做),这将对您有所帮助out: https://www.nuget.org/packages/HtmlRenderer.PdfSharp [ ^ ]
If you can design your report as a html document (and why not), this will certenly help you out: https://www.nuget.org/packages/HtmlRenderer.PdfSharp[^]


这篇关于如何使用Java脚本或Asp.Net中的任何其他选项将具有动态图像的整个HTML页面导出为PDF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆