Convert HTML to PDF in your Mono Applications
Winnovative HTML to PDF Converter Library for Mono can be integrated
in any Mono application to convert URLs, HTML strings and streams to a PDF document, to a raster image or to a SVG vector image.
The converter offers full support for HTML tags, HTML5 with CSS3, SVG and Web Fonts, page breaks control, media type rules,
repeating HTML table header and footer, hierarchical bookmarks, tables of contents, fillable PDF forms,
HTML with page numbering in header and footer.
The library was designed and tested to work reliably in multithreaded environments
and to completely release all the resources used during conversion after each conversion.
This makes it suitable for usage in applications running a long period of time without interruption.
The software package you can download from our website contains demo applications to convert URLs and HTML strings
to PDF.
The licensing model is simple and you can purchase a license online. A purchased license never expires, is royalties free and it includes
free technical support and software update for 1 year from purchase date.
Software Download
Winnovative HTML to PDF Converter for Mono is distributed in a Zip archive. You can follow the link below to download the software.
The Zip archive contains the client library you can use in your Mono applications, the HTML to PDF Server for Windows and for Azure and
a console demo application.
Software Installation
In order to use the Winnovative HTML to PDF Converter for Mono you first have to install the Winnovative HTML to PDF Server.
The server was built on .NET library to extend its capabilities to other platforms and languages.
The client library that you link in your Mono applications will connect to the server to convert HTML to PDF, to Image or to SVG.
Winnovative HTML to PDF Converter Server can run either in a Windows Service on a Windows machine or in an Azure Cloud Service deployed
in Microsoft Azure cloud. You can find detailed installation and uninstallation instructions in the Readme.txt file
from the root of the downloaded package.
Mono Code Sample
The Winnovative HTML to PDF Converter for Mono API allows you to convert a HTML document to PDF in just a few lines a code. The programming interface is
also very rich and allows you customize the generated PDF document in various ways. The code below is copied from the demo for
HTML to PDF Converter that you can find the in the Demo folder of the software Zip package.
static public void Main(string[] args)
{
// parse argumenta
if (!ParseArguments(args))
{
ShowUsage();
return;
}
// convert HTML to PDF
try
{
// create the HTML to PDF converter object
HtmlToPdfConverter htmlToPdfConverter = new HtmlToPdfConverter(serverIPAddress, serverPortNumber);
// set license key
htmlToPdfConverter.LicenseKey = "cP7v/+7/7//u7fHv/+zu8e7t8ebm5ub/7Q==";
// set service password if necessary
if (serverPassword.Length > 0)
htmlToPdfConverter.ServicePassword = serverPassword;
// set PDF page size
htmlToPdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
// set PDF page orientation
htmlToPdfConverter.PdfDocumentOptions.PdfPageOrientation = PdfPageOrientation.Portrait;
// convert the HTML page from given URL to PDF in a buffer
byte[] pdfBytes = htmlToPdfConverter.ConvertUrl(urlToConvert);
// write the PDF buffer in output file
System.IO.File.WriteAllBytes("EvoHtmlToPdf.pdf", pdfBytes);
}
catch (Exception ex)
{
Console.WriteLine(String.Format("Error: {0}", ex.Message));
}
}