Skip to content

Create and read PDF files in a hybrid app using jsPDF and PDF.js libraries

Notifications You must be signed in to change notification settings

PlatformSupport/pdf-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

PDF Create/Open Sample

Run in the Platform

Overview

This example shows how to create and read PDF files in a hybrid app using jsPDF and PDF.js libraries.

Tested on: iOS 9+, Android 5+, Windows Phone 8.1+

Developed with: Windows Phone SDK 8.1, Apache Cordova 4.0.0, jsPDF 1.2.60, PDF.js 1.4.20

Back to Top

Screenshots

Platform Home Create Open
All

Back to Top

Create PDF

jsPDF offers an API for simple write operations in a PDF file. You can write text (and apply custom styles to it), draw shapes, add HTML and images in the PDF file. To see examples of the jsPDF library API, go to their site.

The Create PDF page in this sample app shows a simple view for adding differently styled text and images to a PDF file and then saving the file on the device, using the File plugin.

Back to Top

Open PDF

Using the PDF.js library, you can parse and render a PDF file directly into your app. This is especially useful for Android and Windows Phone devices that cannot open PDF files inside the app and usually need an external PDF viewer.

There are some specifics about the integration of this library in a Cordova app, that are covered in the Open PDF part of the sample. You will be able to find more information in the sample comments. Again, the File plugin is used to get the PDF file content from the device file system.

Back to Top

Limitations

  • You cannot run this sample in the device simulator of the In-Browser client.

Back to Top

About

Create and read PDF files in a hybrid app using jsPDF and PDF.js libraries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published