cpv
capacitor-pdf-viewer-plugin
npm i capacitor-pdf-viewer-plugin
cpv

capacitor-pdf-viewer-plugin

Capacitor PDF viewer plugin

by David López

1.0.0 (see all)License:MITTypeScript:Built-InCategories:Vanilla JavaScript PDF Viewer
npm i capacitor-pdf-viewer-plugin
Readme

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);
    });
  }

}

Downloads/wk

12

GitHub Stars

0
No data available

LAST COMMIT

NaNyrs ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

0
No data available
VersionTagPublished
1.0.0
latest
4yrs ago
No tutorials found
Add a tutorial