capacitor-pdf-viewer-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

capacitor-pdf-viewer-plugin

A Capacitor plugin in order to be able to see PDF files inside your app.

Supported platforms

These are the supported platforms for the plugin at the moment:

  • iOS 11.0+

Requirements

Installation

npm install capacitor-pdf-viewer-plugin --save
npx cap update ios

Usage

Ionic/Angular

import { Component } from '@angular/core';
import { PdfViewer } from 'capacitor-pdf-viewer-plugin';
import { Plugins } from '@capacitor/core';
 
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
 
  constructor() {}
 
  showFromUrl() {
    const url = "https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/pdf_open_parameters.pdf";
    const { PdfViewer } = Plugins;
    PdfViewer.show( { url: this.url } )
    .then( res => {
      console.log(res);
    })
    .catch( err => {
      console.error(err);
    });
  }
 
  pickAndShow() {
    const { PdfViewer } = Plugins;
    PdfViewer.pickAndShow()
    .then(res => {
      console.log(res);
    })
    .catch(err => {
      console.error(err);
    });
  }
 
}

Readme

Keywords

Package Sidebar

Install

npm i capacitor-pdf-viewer-plugin

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

917 kB

Total Files

202

Last publish

Collaborators

  • dellos7