All Projects → mddanishansari → html-to-pdf-convertor

mddanishansari / html-to-pdf-convertor

Licence: Apache-2.0 license
HTML to PDF convertor for Android

Programming Languages

kotlin
9241 projects
HTML
75241 projects

Projects that are alternatives of or similar to html-to-pdf-convertor

docraptor-ruby
A native Ruby client for the DocRaptor HTML to PDF generation API
Stars: ✭ 20 (-55.56%)
Mutual labels:  html-to-pdf
pydf
PDF generation in python using wkhtmltopdf for heroku and docker
Stars: ✭ 68 (+51.11%)
Mutual labels:  html-to-pdf
fpdf-easytable
fpdf-easyTable is a PHP class that makes it easy to build tables for PDF documents generated with the FPDF library
Stars: ✭ 74 (+64.44%)
Mutual labels:  html-to-pdf
shuttlepdf
📃 Smashingly simple, and scalable ("serverless") HTML to PDF conversions using Google Cloud Functions, and Puppeteer.
Stars: ✭ 15 (-66.67%)
Mutual labels:  html-to-pdf
Docotic.Pdf.Samples
C# and VB.NET samples for Docotic.Pdf library
Stars: ✭ 52 (+15.56%)
Mutual labels:  html-to-pdf
api2pdf.php
PHP client library for the Api2Pdf.com REST API - Convert HTML to PDF, URL to PDF, Office Docs to PDF, Merge PDFs, HTML to Image, URL to Image, HTML to Docx, HTML to Xlsx, PDF to HTML, Thumbnail preview of office files
Stars: ✭ 42 (-6.67%)
Mutual labels:  html-to-pdf
HTMLWithImagesToPDF
Generate a PDF from an HTML file containing images (iOS).
Stars: ✭ 38 (-15.56%)
Mutual labels:  html-to-pdf
Athenapdf
Drop-in replacement for wkhtmltopdf built on Go, Electron and Docker
Stars: ✭ 2,160 (+4700%)
Mutual labels:  html-to-pdf
Dompdf
HTML to PDF converter for PHP
Stars: ✭ 8,446 (+18668.89%)
Mutual labels:  html-to-pdf
Snappy
PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage
Stars: ✭ 3,986 (+8757.78%)
Mutual labels:  html-to-pdf
Pdfkit
A Ruby gem to transform HTML + CSS into PDFs using the command-line utility wkhtmltopdf
Stars: ✭ 2,799 (+6120%)
Mutual labels:  html-to-pdf
python-pdfkit-example
python-pdfkit HTML TO PDF Example
Stars: ✭ 18 (-60%)
Mutual labels:  html-to-pdf
pdf-generator-service
A simple express service that generates a pdf based on the submitted HTML
Stars: ✭ 28 (-37.78%)
Mutual labels:  html-to-pdf
puppeteer-report
Convert HTML to PDF by Puppeteer with support of adding a custom header, footer, and page number
Stars: ✭ 90 (+100%)
Mutual labels:  html-to-pdf

HTML to PDF Convertor

A simple HTML to PDF convertor for Android

Download

Add mavenCentral() repository in project's build.gradle

allprojects {
    repositories {
        // Possibly other repositories
        mavenCentral()
    }
}

Add dependency in module's build.gradle

dependencies {
    // Possibly other dependencies
    // Replace the <latest-version> with actual latest version
    implementation 'io.github.nvest-solutions:html-to-pdf-convertor:<latest-version>'
}

Usage

Create an instance of HtmlToPdfConvertor class

val htmlToPdfConvertor = HtmlToPdfConvertor(context)

Set optional base URL

htmlToPdfConvertor.setBaseUrl("file:///android_asset/images/") // is null by default

Start the conversion by calling convert function

htmlToPdfConvertor.convert(
  pdfLocation = pdfLocation, // the file location where pdf should be saved
  htmlString = htmlString, // the HTML string to be converted
  onPdfGenerationFailed = { exception -> // something went wrong, handle the exception (this param is optional) 
      exception.printStackTrace()
  },
  onPdfGenerated = { pdfFile -> // pdf was generated, do whatever you want with it
      openPdf(pdfFile)
  })

Storage permission is required to save pdf file on storage

Checkout sample code, also sample HTML and PDF

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].