从asp.net网页生成Pdf

时间:2022-09-17 21:08:16

Could you give me some recommendations on free/Openspurce library etc that could be integrated on asp.net application to Generate Pdf out of Html fragments. I will be generating Invoices that is displayed in DataGrid and tables. Is there some readily available library that would print the whole Table with Datagrid into Pdf. ITextSharp seems nice but i will have to do the tough work of adding tables and blah blah when everything is already in the webpage. this is a possible duplicate but it generates pdf from Full page which is not desired Possible duplicate question

您能给我一些关于免费/Openspurce库等方面的建议吗?这些建议可以集成到asp.net应用程序中,从Html片段生成Pdf。我将生成显示在DataGrid和表中的发票。是否有一些现成的库可以将整个表用Datagrid打印成Pdf格式。ITextSharp看起来很不错,但是当所有的东西都已经在网页上的时候,我将不得不做添加表格之类的艰苦工作。这是一个可能的副本,但是它从完整的页面生成pdf,这是不可能的重复问题。

3 个解决方案

#1


2  

ITextSharp does almost what you ask and is Open Source, however the API for conversion process has not been touched for years and is outdated. I therefore would recommend a commercial product.

ITextSharp所做的几乎和您要求的一样,并且是开源的,但是用于转换过程的API已经很多年没有被使用了,并且已经过时了。因此,我推荐一种商业产品。

Something like Winnovative HTML to PDF Converter

有点像Winnovative HTML到PDF转换器

To be honest I look at it like this, you can save money by buying a licence for a commercial product rather than spending days developing a solution yourself.

老实说,我是这么看的,你可以通过购买商业产品的许可证来省钱,而不是花上几天时间自己开发一个解决方案。

Edit If it is for generating invoices alone then I would use iTextSharp as it does not take long to learn the basics. However if you want to be able to convert a full rich webpage into a PDF then go down the commercial route.

编辑如果它是用于单独生成发票,那么我会使用iTextSharp,因为它不会花很长时间来学习基础知识。然而,如果你想把一个完整的网页变成PDF,那么就沿着商业路线走。

#2


0  

These links may help:

这些链接可以帮助:

Convert HTML to PDF in .NET

在。net中将HTML转换为PDF

Generate PDF from ASP.NET from raw HTML/CSS content?

从ASP生成PDF。NET来自原始的HTML/CSS内容?

Creating PDF Invoices - Are there any templating solutions?

创建PDF发票-是否有模板解决方案?

#3


0  

When doing invoices, I usually go a slightly different way, by starting with Aspose.Words and using the nested mail merge feature.

在做发票的时候,我通常会采取一种稍微不同的方式,以一个开头。单词和使用嵌套邮件合并功能。

Another option could be the HTML to PDF feature of Aspose.Pdf.

另一种选择是asbo . PDF的HTML到PDF的特性。

Both libraries are commercial only, I don't know whether this is appropriate for your project.

这两个库都是商业性的,我不知道这是否适合您的项目。

#1


2  

ITextSharp does almost what you ask and is Open Source, however the API for conversion process has not been touched for years and is outdated. I therefore would recommend a commercial product.

ITextSharp所做的几乎和您要求的一样,并且是开源的,但是用于转换过程的API已经很多年没有被使用了,并且已经过时了。因此,我推荐一种商业产品。

Something like Winnovative HTML to PDF Converter

有点像Winnovative HTML到PDF转换器

To be honest I look at it like this, you can save money by buying a licence for a commercial product rather than spending days developing a solution yourself.

老实说,我是这么看的,你可以通过购买商业产品的许可证来省钱,而不是花上几天时间自己开发一个解决方案。

Edit If it is for generating invoices alone then I would use iTextSharp as it does not take long to learn the basics. However if you want to be able to convert a full rich webpage into a PDF then go down the commercial route.

编辑如果它是用于单独生成发票,那么我会使用iTextSharp,因为它不会花很长时间来学习基础知识。然而,如果你想把一个完整的网页变成PDF,那么就沿着商业路线走。

#2


0  

These links may help:

这些链接可以帮助:

Convert HTML to PDF in .NET

在。net中将HTML转换为PDF

Generate PDF from ASP.NET from raw HTML/CSS content?

从ASP生成PDF。NET来自原始的HTML/CSS内容?

Creating PDF Invoices - Are there any templating solutions?

创建PDF发票-是否有模板解决方案?

#3


0  

When doing invoices, I usually go a slightly different way, by starting with Aspose.Words and using the nested mail merge feature.

在做发票的时候,我通常会采取一种稍微不同的方式,以一个开头。单词和使用嵌套邮件合并功能。

Another option could be the HTML to PDF feature of Aspose.Pdf.

另一种选择是asbo . PDF的HTML到PDF的特性。

Both libraries are commercial only, I don't know whether this is appropriate for your project.

这两个库都是商业性的,我不知道这是否适合您的项目。