You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

WnvHtmlToPdf_Xamarin_Client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

WnvHtmlToPdf_Xamarin_Client

Winnovative HTML to PDF Client for Xamarin can be easily integrated in Xamarin applications on various platforms to create PDF documents from HTML pages and strings. Before using the Winnovative HTML to PDF Client for Xamarin in your applications you first have to install the Winnovative Server. The server can be installed as Azure Cloud Service, Azure Service Fabric Application, IIS Web Application or Windows Service. The detailed installation instructions can be found in server package downloadable from website. The client for Xamarin functionality is now included in Winnovative HTML to PDF Client for .NET Core library and this library gets actually referenced in your UWP projects. The HTML to PDF Converter API is also available in Winnovative Client for .NET Core library under the 'WinnovativeClient' namespace. The library is compatible with any platform which supports .NET Standard 2.0, including: * .NET Core 7, 6, 5, .NET Standard 2.0 , .NET Framework 4.6.2 (and above) * Windows, Linux, macOS * Azure, Azure App Service and Azure Functions * Xamarin for iOS, macOS and Android * Universal Windows Platform (UWP) * Web, Console and Desktop applications The main features are: * Create PDF documents from HTML with advanced support for CSS3, SVG, Web Fonts and JavaScript * Automatically create PDF links, forms, bookmarks and table of contents from HTML tags * Place the content from multiple HTML documents at any position in PDF pages, headers or footers * Create JPEG, PNG and Bitmap raster images from HTML documents * Create high quality SVG vector images from HTML documents * Create PDF documents with text, graphics, images, headers and footers * Create PDF documents with security features and digital signatures * Create interactive PDF documents with forms, internal links, text notes and JavaScript actions * Edit, stamp and merge PDF documents

17.0.0
nugetNuGet
Version published
Maintainers
1
Created
Source

Winnovative HTML to PDF Client for Xamarin

Winnovative HTML to PDF Client for Xamarin can be easily integrated in Xamarin applications on various platforms to create PDF documents from HTML pages and strings.

The library can also be used to convert HTML to images, convert HTML to SVG, create, edit and merge PDF documents. You can see the http://www.winnovative-software.com/html-to-pdf-converter-xamarin.aspx product page for a complete list of library features.

Main Features

The client library offers in general the same features as the regular Winnovative HTML to PDF Library for .NET .

  • Create PDF documents from HTML with advanced support for CSS3, SVG, Web Fonts and JavaScript
  • Automatically create PDF links, forms, bookmarks and table of contents from HTML tags
  • Place the content from multiple HTML documents at any position in PDF pages, headers or footers
  • Create JPEG, PNG and Bitmap raster images from HTML documents
  • Create high quality SVG vector images from HTML documents
  • Create PDF documents with text, graphics, images, headers and footers
  • Create PDF documents with security features and digital signatures
  • Create interactive PDF documents with forms, internal links, text notes and JavaScript actions
  • Edit, stamp and merge PDF documents

Compatibility

Winnovative HTML to PDF Library for Xamarin is compatible with any platform which supports .NET Standard 2.0 or above, including the platforms listed below:

  • .NET Core 7, 6, 5, .NET Standard 2.0 , .NET Framework 4.6.2 (and above)
  • Windows, Linux, macOS
  • Azure, Azure App Service and Azure Functions
  • Xamarin for iOS, macOS and Android
  • Universal Windows Platform (UWP)
  • Web, Console and Desktop applications

Getting Started

Before starting to use the Winnovative HTML to PDF Client for Xamarin in your applications you first have to install the Winnovative Server. The server can be installed as Azure Cloud Service Worker Role, Azure Cloud Service Web Role, Azure Service Fabric Application, IIS ASP.NET Web Application or Windows Service.

Winnovative Server

Winnovative Server can be downloaded from http://www.winnovative-software.com/download.aspx#client_server page of the website. Winnovative Server package contains the server files and detailed installation instructions for each platform.

After the Winnovative Server was installed, you are ready to use the Winnovative HTML to PDF Client Library for Xamarin in your applications.

C# Code Samples

Copy the C# code lines from the section below to create a PDF document from a web page or from a HTML string and save the resulted PDF to a memory buffer for further processing or to a PDF file.

The server IP address is assigned during server installation and it can be omitted from HtmlToPdfConverter constructor if the server was installed on the localhost IP address 127.0.0.1 . There are also variants of the constructor accepting an URL instead of IP address if the server was installed as a web service in Azure or in IIS.

At the top of your C# source file add the 'using Winnovative.HtmlToPdfClient;' statement to make available the Winnovative HTML to PDF Client API for your .NET application.

// add this using statement at the top of your C# file
using Winnovative.HtmlToPdfClient;

To convert in your Xamarin application for iOS a HTML string to a PDF document in a memory buffer, save it to a file and open that file a in PDF viewer you can use the C# code below.

// create the converter object in your code where you want to run conversion
// change the serverIP value if the server was installed on a remote machine
string serverIP = "127.0.0.1";
HtmlToPdfConverter converter = new HtmlToPdfConverter(serverIP);

// convert a HTML string to a memory buffer
byte[] htmlToPdfBuffer = converter.ConvertHtml("<b>Hello World</b> from Winnovative !", null);

// write the memory buffer to a PDF file
string documentsFolder = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments); 
string htmlToPdfFile = System.IO.Path.Combine(documentsFolder, "HtmlToMemory.pdf");
System.IO.File.WriteAllBytes(htmlToPdfFile, htmlToPdfBuffer);

// open the PDF document in the default PDF viewer
UIDocumentInteractionController pdfViewer = UIDocumentInteractionController.FromUrl(Foundation.NSUrl.FromFilename(htmlToPdfFile));
pdfViewer.PresentOpenInMenu(this.View.Frame, this.View, true);

To convert in your Xamarin application for iOS an URL to a PDF document in a memory buffer, save it to a file and open that file in a PDF viewer you can use the C# code below.

// create the converter object in your code where you want to run conversion
// change the serverIP value if the server was installed on a remote machine
string serverIP = "127.0.0.1";
HtmlToPdfConverter converter = new HtmlToPdfConverter(serverIP);

// convert an URL to a memory buffer
string htmlPageURL = "http://www.winnovative-software.com";
byte[] urlToPdfBuffer = converter.ConvertUrl(htmlPageURL);

// write the memory buffer to a PDF file
string documentsFolder = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments); 
string urlToPdfFile = System.IO.Path.Combine(documentsFolder, "UrlToMemory.pdf");
System.IO.File.WriteAllBytes(urlToPdfFile, urlToPdfBuffer);

// open the PDF document in the default PDF viewer
UIDocumentInteractionController pdfViewer = UIDocumentInteractionController.FromUrl(Foundation.NSUrl.FromFilename(urlToPdfFile));
pdfViewer.PresentOpenInMenu(this.View.Frame, this.View, true);

To convert in your Xamarin application for Android a HTML string to a PDF document in a memory buffer, save it to a file and open that file a in PDF viewer you can use the C# code below.

// create the converter object in your code where you want to run conversion
// change the serverIP value if the server was installed on a remote machine
string serverIP = "127.0.0.1";
HtmlToPdfConverter converter = new HtmlToPdfConverter(serverIP);

// convert a HTML string to a memory buffer
byte[] htmlToPdfBuffer = converter.ConvertHtml("<b>Hello World</b> from Winnovative !", null);

// write the memory buffer to a PDF file
string documentsFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
string htmlToPdfFile = System.IO.Path.Combine(documentsFolder, "HtmlToMemory.pdf");
System.IO.File.WriteAllBytes(htmlToPdfFile, htmlToPdfBuffer);

// open the PDF document in the default PDF viewer
Android.Net.Uri uri = Android.Net.Uri.Parse("content://" + htmlToPdfFile);
Intent intent = new Intent(Intent.ActionView, uri);
intent.SetDataAndType(uri, "application/pdf");
intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.GrantReadUriPermission);
this.ApplicationContext.StartActivity(intent);

To convert in your Xamarin application for Android an URL to a PDF document in a memory buffer, save it to a file and open that file in a PDF viewer you can use the C# code below.

// create the converter object in your code where you want to run conversion
// change the serverIP value if the server was installed on a remote machine
string serverIP = "127.0.0.1";
HtmlToPdfConverter converter = new HtmlToPdfConverter(serverIP);

// convert an URL to a memory buffer
string htmlPageURL = "http://www.winnovative-software.com";
byte[] urlToPdfBuffer = converter.ConvertUrl(htmlPageURL);

// write the memory buffer to a PDF file
string documentsFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.MyDocuments);
string urlToPdfFile = System.IO.Path.Combine(documentsFolder, "UrlToMemory.pdf");
System.IO.File.WriteAllBytes(urlToPdfFile, urlToPdfBuffer);

// open the PDF document in the default PDF viewer
Android.Net.Uri uri = Android.Net.Uri.Parse("content://" + urlToPdfFile);
Intent intent = new Intent(Intent.ActionView, uri);
intent.SetDataAndType(uri, "application/pdf");
intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.GrantReadUriPermission);
this.ApplicationContext.StartActivity(intent);

To convert in your Xamarin application for macOS a HTML string to a PDF document in a memory buffer, save it to a file and open that file a in PDF viewer you can use the C# code below.

// create the converter object in your code where you want to run conversion
// change the serverIP value if the server was installed on a remote machine
string serverIP = "127.0.0.1";
HtmlToPdfConverter converter = new HtmlToPdfConverter(serverIP);

// convert a HTML string to a memory buffer
byte[] htmlToPdfBuffer = converter.ConvertHtml("<b>Hello World</b> from Winnovative !", null);

// write the memory buffer to a PDF file
string htmlToPdfFile = "HtmlToMemory.pdf";
System.IO.File.WriteAllBytes(htmlToPdfFile, htmlToPdfBuffer);

// open the PDF document in the default PDF viewer
System.Diagnostics.Process.Start (htmlToPdfFile);

To convert in your Xamarin application for macOS an URL to a PDF document in a memory buffer, save it to a file and open that file in a PDF viewer you can use the C# code below.

// create the converter object in your code where you want to run conversion
// change the serverIP value if the server was installed on a remote machine
string serverIP = "127.0.0.1";
HtmlToPdfConverter converter = new HtmlToPdfConverter(serverIP);

// convert an URL to a memory buffer
string htmlPageURL = "http://www.winnovative-software.com";
byte[] urlToPdfBuffer = converter.ConvertUrl(htmlPageURL);

// write the memory buffer to a PDF file
string urlToPdfFile = "UrlToMemory.pdf";
System.IO.File.WriteAllBytes(urlToPdfFile, urlToPdfBuffer);

// open the PDF document in the default PDF viewer
System.Diagnostics.Process.Start (urlToPdfFile);

Free Trial

You can download the full Winnovative Client for Xamarin package from http://www.winnovative-software.com/download.aspx#client_server page of the website. This package references the Winnovative Client for .NET library in the demo projects for Xamarin.

Winnovative Client for .NET includes the HTML to PDF component besides other components under the WinnovativeClient namespace and it is intended to replace the Winnovative HTML to PDF Client for .NET package. The package contains the product binaries, demo Visual Studio projects with full C# code for HTML to PDF in Xamarin, the library documentation in CHM format.

You can evaluate the library for free as long as it is needed to ensure that the solution fits your application needs.

Licensing

The Winnovative Software licenses are perpetual which means they never expire for a version of the product and include free maintenance for the first year. You can find more details about licensing in http://www.winnovative-software.com/buy.aspx page of the website.

The same license keys for Winnovative software works both with regular libraries for .NET and with Winnovative Client for .NET. For example, a license key for Winnovative PDF Toolkit PRO works with all components from client library, while a license for HTML to PDF Converter will work only with this component of the client library.

Support

For technical and sales questions or for general inquiries about our software and company you can contact us using the email addresses from http://www.winnovative-software.com/contact.aspx page of the website.

Keywords

html

FAQs

Package last updated on 22 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts