All Projects → UttamPanchasara → Pdf Generator

UttamPanchasara / Pdf Generator

PDF Generator library, easy way to create PDF from String Content or Any HTML Content.

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Pdf Generator

Tabula Py
Simple wrapper of tabula-java: extract table from PDF into pandas DataFrame
Stars: ✭ 1,351 (+1128.18%)
Mutual labels:  pdf
Electron Render Service
Microservice for rendering PDF/PNG/JPEG from HTML with Electron
Stars: ✭ 104 (-5.45%)
Mutual labels:  pdf
Lancia
网页转PDF渲染服务。提供收据、发票、报告或任何网页内容转PDF的微服务
Stars: ✭ 108 (-1.82%)
Mutual labels:  pdf
Atom Pdf View
Support for viewing PDF files in Atom.
Stars: ✭ 99 (-10%)
Mutual labels:  pdf
Fbpdf
A small framebuffer pdf, djvu, epub, xps, and cbz viewer
Stars: ✭ 103 (-6.36%)
Mutual labels:  pdf
Pdf
Simple http microservice that converts Word documents to PDF
Stars: ✭ 107 (-2.73%)
Mutual labels:  pdf
Pdf Generator
Cordova plugin to generate pdf in the client-side
Stars: ✭ 98 (-10.91%)
Mutual labels:  pdf
Pdfalto
PDF to XML ALTO file converter
Stars: ✭ 109 (-0.91%)
Mutual labels:  pdf
I7j Pdfhtml
pdfHTML is an iText 7 add-on for Java that allows you to easily convert HTML and CSS into standards compliant PDFs that are accessible, searchable and usable for indexing.
Stars: ✭ 104 (-5.45%)
Mutual labels:  pdf
Pypdftk
Python module to drive the awesome pdftk binary.
Stars: ✭ 107 (-2.73%)
Mutual labels:  pdf
Htmldoc
HTML Conversion Software
Stars: ✭ 99 (-10%)
Mutual labels:  pdf
Quad
document processor in Racket
Stars: ✭ 100 (-9.09%)
Mutual labels:  pdf
Invoice As A Service
💰 Simple invoicing service (REST API): from JSON to PDF
Stars: ✭ 106 (-3.64%)
Mutual labels:  pdf
Mit Deep Learning Book Pdf
MIT Deep Learning Book in PDF format (complete and parts) by Ian Goodfellow, Yoshua Bengio and Aaron Courville
Stars: ✭ 9,859 (+8862.73%)
Mutual labels:  pdf
Play Pdf
A PDF module for the Play framework
Stars: ✭ 108 (-1.82%)
Mutual labels:  pdf
Mustangproject
Open Source Java e-Invoicing library, validator and tool (Factur-X/ZUGFeRD, UNCEFACT/CII XRechnung)
Stars: ✭ 98 (-10.91%)
Mutual labels:  pdf
Pdfviewpager
Android widget that can render PDF documents stored on SD card, linked as assets, or downloaded from a remote URL.
Stars: ✭ 1,508 (+1270.91%)
Mutual labels:  pdf
Nb pdf template
A more accurate representation of jupyter notebooks when converting to pdfs.
Stars: ✭ 109 (-0.91%)
Mutual labels:  pdf
Analyzer
🔍 Offline Analyzer for extracting features, artifacts and IoCs from Windows, Linux, Android, iPhone, Blackberry, macOS binaries, emails and more
Stars: ✭ 108 (-1.82%)
Mutual labels:  pdf
Pdfscribe
A PDF virtual printer for 64-bit Windows 7 / 2008R2 or later.
Stars: ✭ 106 (-3.64%)
Mutual labels:  pdf

PDF-Generator

Download Download Download Download

PDF Generator library, easy way to create PDF from String Content or Any HTML Content.

Get Started

dependencies {
     implementation 'com.uttampanchasara.pdfgenerator:pdfgenerator:1.3'
}

Quick Start

In order to start using PdfGenerator, Just copy below code to your project and just pass the required values and that's all you done!

Kotlin Code:

 CreatePdf(this)
            .setPdfName("FirstPdf")
            .openPrintDialog(false)
            .setContentBaseUrl(null)
            .setPageSize(PrintAttributes.MediaSize.ISO_A4)
            .setContent("Your Content")
            .setFilePath(Environment.getExternalStorageDirectory().absolutePath + "/MyPdf")
            .setCallbackListener(object : CreatePdf.PdfCallbackListener {
                override fun onFailure(errorMsg: String) {
                    Toast.makeText(this@MainActivity, errorMsg, Toast.LENGTH_SHORT).show()
                }

                override fun onSuccess(filePath: String) {
                    Toast.makeText(this@MainActivity, "Pdf Saved at: $filePath", Toast.LENGTH_SHORT).show()
                }
            })
            .create()

Java Code:

new CreatePdf(this)
            .setPdfName("FirstPdf")
            .openPrintDialog(false)
            .setContentBaseUrl(null)
            .setPageSize(PrintAttributes.MediaSize.ISO_A4)
            .setContent("Your Content")
            .setFilePath(Environment.getExternalStorageDirectory().getAbsolutePath() + "/MyPdf")
            .setCallbackListener(new CreatePdf.PdfCallbackListener() {
                @Override
                public void onFailure(@NotNull String s) {
                    // handle error
                }

                @Override
                public void onSuccess(@NotNull String s) {
                    // do your stuff here
                }
            })
            .create();

NOTE: ( Provide STORAGE Permission if you are providing filePath to library )

In library, I'm not handling any storage permission related exception, If you are providing your custom filePath then your application must have STORAGE READ-WRITE Permission in order to store Pdf in provided path.

Usage

  • setPdfName : String

Provide Your Pdf name, Library will use to save pdf with this name.

  • openPrintDialog : Boolean

Default is false, If you set true it will send your pdf for print and open the android default pdf print view.

  • setContentBaseUrl : String

If you are loading content from assets folder in that case you can pass your base url here, same as we passed in webview.

  • setPageSize : PrintAttributes.MediaSize

To set custom page size for your pdf, you will have to pass the mediaSize as argument.

Example - For A4 size: PrintAttributes.MediaSize.ISO_A4 | ISO_A0 | ISO_A1

  • setContent : String

Provide your String content, which you want to generate Pdf.

  • setFilePath : String

Provide custom file path to save pdf in your own directory, default will be the cache directory of Application

  • setCallbackListener : Listener Interface

Set this callback listener to get callback on pdf generated.

Benefits

  • Easily Generate Pdf
  • No Extra codes
  • Time saving
  • Lightweight

More?

If you have any suggestions or you can make this library better write me, create issue, or you can also write code and send pull request.

Questions?

Ping-Me on : Twitter Facebook

profile for Uttam Panchasara at Stack Overflow, Q&A for professional and enthusiast programmers

Donate

If you found this library helpful, consider buying me a cup of ☕️

Stargazers over time

Stargazers over time

License

   Copyright 2019 Uttam Panchasara

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
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].