Skip to content

This repository contains an example of exporting pdf from ionic

Notifications You must be signed in to change notification settings

ratikanta131/ionic-pdf

Repository files navigation

ionic-pdf

This repository contains an example of exporting pdf from ionic

Setting up your development environment

  1. start with a blank new app and install two Cordova Plugins and install npm packages

Install Cordova Plugins :

  • ionic cordova plugin add cordova-plugin-file-opener2
  • ionic cordova plugin add cordova-plugin-file

Install NPM packages

  • npm install pdfmake @ionic-native/file-opener @ionic-native/file
  1. Once your installation is finished, head over to your src/app.module.ts and add our two Plugins like this:
  • import { File } from '@ionic-native/file';
  • import { FileOpener } from '@ionic-native/file-opener';
  1. Add two providers in Provider section of app.module.ts.
  • File
  • FileOpener
  1. Then create your view.
  • Go ahead and open your src/pages/home/home.html and insert input field and two buttons.One button for creating the pdf and another for downloading the pdf.
  1. Create PDFs, Store Files and Display the Viewer
  • Go ahead and open your src/pages/home/home.ts and insert the code for crating and downloading the pdf.

About

This repository contains an example of exporting pdf from ionic

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published