Shiny New E-Book Gizmo: The Amazon Kindle


View Full Version : Using prince to convert html to pdf?


Antartica
12-20-2006, 04:02 AM
Hi all!

I was reading this report (http://people.opera.com/howcome/2006/olpc/) and was surprised by the comments about the pince HTML2PDF converter.

There is more information (examples and a evaluation version of the program) here:
http://www.princexml.com

Anyone has used it or at least know it?

Experiences?

narve
12-20-2006, 07:49 AM
Hi all!

I was reading this report (http://people.opera.com/howcome/2006/olpc/) and was surprised by the comments about the pince HTML2PDF converter.

There is more information (examples and a evaluation version of the program) here:
http://www.princexml.com

Anyone has used it or at least know it?

Experiences?
I had a look but it was commercial so I skipped it...

fchivu
09-03-2007, 09:06 AM
If you want something windows based I think you can take the HTML to PDF converter (http://www.dotnet-reporting.com) library for .NET from http://www.dotnet-reporting.com or from http://www.winnovative-software.com. You can be build your own application or you can use the demo one.

All the conversion can be done in a few lines for C# code:


// Create the PDF converter. Optionally you can specify the virtual browser
// width as parameter. 1024 pixels is default, 0 means autodetect
PdfConverter pdfConverter = new PdfConverter();
// set the license key
pdfConverter.LicenseKey = "P38cBx6AWW7b9c81TjEGxnrazP+J7rOjs+9omJ3TUycauK+cLW drITM5T59hdW5r";
// set the converter options
pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
pdfConverter.PdfDocumentOptions.PdfCompressionLeve l = PdfCompressionLevel.Normal;
pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait;
pdfConverter.PdfDocumentOptions.ShowHeader = false;
pdfConverter.PdfDocumentOptions.ShowFooter = false;
// set to generate selectable pdf or a pdf with embedded image
pdfConverter.PdfDocumentOptions.GenerateSelectable Pdf = selectablePDF;

// Performs the conversion and get the pdf document bytes that you can further
// save to a file or send as a browser response
byte[] pdfBytes = pdfConverter.GetPdfFromUrlBytes(urlToConvert);