ASP.NET MVC: render view to generate PDF: use iTextSharp or better solution?

后端 未结 3 1321
野性不改
野性不改 2021-02-04 21:59

I display receipt in both HTML and printer-friendly version. HTML version does jQuery tabs, etc, while printer-friendly has zero scripts and external dependencies, no master lay

3条回答
  •  盖世英雄少女心
    2021-02-04 22:27

    If you can have the HTML in memory then you can convert it to PDF. I've once did something similar using xhtmlrenderer. It is a JAVA framework that bundles iText and that is capable of converting an HTML stream into PDF. As it is written in JAVA I've used the ikvmc.exe to convert the jar file into a .NET assembly and use it directly from managed code.

提交回复
热议问题