问题
Can you please point me to open source or a reasonably priced comercial product capable of generating PDF from HTML?
回答1:
We currently use ABCpdf in one of our more complex applications. It has served us well and is not very expensive at all. I like that fact that I can send it raw HTML text and it will render it to a PDF in memory or as a file so we use to generate PDFs on the fly and serve them up via the web without actually ever saving it disk ever.
We have been using it for about 3 years and early on I had to use their support for a very odd issue that was very specific and the support was very fast and help solved the issue quickly.
You can find more information on their website at: http://www.websupergoo.com/abcpdf-1.htm
回答2:
PrinceXML
回答3:
By nature of the task (HTML to PDF conversion) pretty looking PDF generation tool should able to render HTML like web-browser. Fortunately it is already exists: WkHtmlToPdf open source project but it doesn't provide any integration with .NET from the box.
Don't spend your time on reinventing the wheel: I've already packed WkHtmlToPdf into one DLL (no external dependencies at all), just add it to your project and generate PDF with one line of code:
var pdfBytes = (new NReco.HtmlToPdfConverter()).GeneratePdf(htmlContent);
Additionally, it's possible to specify various options (like margins, zoom-factor etc) through HtmlToPdfConverter's properties.
DLL can be downloaded here (it's FREE): PdfGenerator for .NET
回答4:
We've used ABCPdf in the past and it's able to take a web request and generate a PDF from it
回答5:
We've had a lot of success with an open source product called 'itextsharp' - it's not so hot at the HTML-to-PDF but is good for carefully piecing together a specific PDF document (such as a receipt). It's also free, which is always a bonus. See:
http://sourceforge.net/projects/itextsharp/
Another quick and lightweight solution is XMLPdf, written by a software company called Ibex from New Zealand no less. This tool has a model where you create an XML template file, with HTML-ish tags in the schema. You can also define tags in the XML which you associate with objects in your .NET code behind. Kind of clunky, but useful in particular circumstances. Not free, but cheap. Can find it by searching for XMLpdf on Google.
回答6:
Here is HTML to PDF .NET component at the reasonable price. But it has own html/css reading and pdf rendering engines.
回答7:
And EVO html to pdf converter
回答8:
Using the (commercial) Aspose.Pdf since years successfully. Works both for .NET and Java.
回答9:
I've successfully used HTML to PDF Converter for .NET before on a project.
回答10:
One alternative solution would be to use the web browser control and print the html to an installed PDF printer.
There are several free PDF printers available and they can be set up to print directly to a file without displaying a user interface.
I used a solution like this once and it worked fine even for large documents and large numbers of documents.
回答11:
Abcpdf .Net version 8 works but it creates lot of issue in production servers where security and user rights are restrictive.
It is difficult to directly to do URL->pdf conversion. We ended up URL-Save HTML in local folder ->read HTML and convert to PDF-> delete HTML file from folder - tricky approach but it works. The only flaw is that you need to give read/write permission on a folder on server. Its still better than decreasing security settings.
回答12:
- PDFSharp
- Sharp PDF
- iTextSharp
Just to name a few.
wwww
: http://www.pdfsharp.com/
来源:https://stackoverflow.com/questions/598980/generation-pdf-from-html-component-for-net