Cordova Plugin Html2pdf

screenshot of Cordova Plugin Html2pdf

This is a phonegap / cordova 3.3.0 plugin which converts the given html to a pdf document and stores it on the device.

Overview

Html 2 Pdf is an impressive plugin designed for PCordova versions 6.1.1 and above, compatible with Android (version 4.1 and up) and iOS (version 6.0 and above). This plugin enables users to effortlessly create PDF documents from provided HTML content and securely store them on their devices. The simplicity of its integration and the reliability it offers make it an attractive tool for developers seeking PDF generation capabilities in their applications.

The key method for utilizing this plugin is straightforward: create(html, filePath, successCallback, errorCallback), which allows for seamless PDF generation with specified parameters. With the inclusion of iText.jar, the plugin maintains robust functionality, ensuring a smooth user experience while converting HTML to PDF.

Features

  • Cross-Platform Support: Works seamlessly on both Android (4.1+) and iOS (6.0+), enabling developers to target a wide range of devices.
  • Easy Integration: Installation is streamlined via the phonegap CLI, facilitating a hassle-free setup process for developers.
  • PDF Creation: Generates PDFs directly from HTML content, allowing for versatile document formatting and design capabilities.
  • File Storage: Saves created PDFs directly to the device, providing users with easy access to their documents.
  • Error Handling: Includes success and error callback parameters, enabling developers to manage outcomes effectively during the PDF creation process.
  • iText Compatibility: Requires iText.jar, ensuring the plugin leverages a proven library for PDF manipulation and rendering.