如何将HTML转换为PDF格式 [英] How to convert HTML to pdf
问题描述
对于我的asp.net mvc应用程序我已经使用了jspdf,但问题是当我转换整个页面的div被破坏而我没有得到整个html页面为pdf
我尝试过:
i关注此https://jsfiddle.net/xzz7n/1/
for my asp.net mvc application i have used jspdf but the problem is when i convert a div of entire page is broken and i am not getting the whole html page as pdf
What I have tried:
i have followed this https://jsfiddle.net/xzz7n/1/
推荐答案
我建议使用jsPDF,请参考此链接 GitHub - MrRio / jsPDF:用于传说的JavaScript PDF生成。 HTML5 FTW。 [ ^ ]
I would suggest to use jsPDF , Please refer this link GitHub - MrRio/jsPDF: JavaScript PDF generation for legends. HTML5 FTW.[^]
>
给我一个很好的asp.net html来源pdf链接
give me good source of asp.net html to pdf link
这不是你需要的。这个问题与.NET有关,但不是特定于ASP.NET。
请看我过去的答案:如何将HTML转换为pdf [ ^ ]。
此外,这个是一组可以使用的PDF库参考: http://csharp-source.net/open-source/ pdf-libraries 。
您可能需要解析HTML以获取数据并将其格式化为PDF,您可以使用解析器HTML Agility Html Agility Pack - 主页 [ ^ ]:
This is not exactly what you need. This problem is related to .NET, but not specific to ASP.NET.
Please see my past answer: How to convert HTML to pdf[^].
Also, this is a set of references to PDF libraries you can use: http://csharp-source.net/open-source/pdf-libraries.
You may need to parse HTML to get the data and format it as PDF, you can use the parser HTML Agility Html Agility Pack — Home[^]:
这篇关于如何将HTML转换为PDF格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!