Code Monkey home page Code Monkey logo

cordova-pdfreader-ios's Introduction

Cordova-PDFReader-IOS

PDF Reader cordova plugin for IOS 7+ (based on Reader https://github.com/vfr/Reader)

Introduction

I've crafted this open source PDF reader code for fellow iOS developers struggling with wrangling PDF files onto iOS device screens.

The code is universal and does not require any XIBs (as all UI elements are code generated, allowing for greatest flexibility). It runs on iPad, iPhone and iPod touch with iOS 6.0 and up. Also supported are the Retina displays in all new devices and is ready to be fully internationalized. The idea was to provide a complete project template that you could start building from, or, just pull the required files into an existing project to enable PDF reading/viewing in your app(s).

iPad Page

iPad Thumbs

iPod Page

iPod Thumbs

Features

Multithreaded: The UI is always quite smooth and responsive.

Supports:

  • iBooks-like document navigation.
  • Device rotation and all orientations.
  • Encrypted (password protected) PDFs.
  • PDF links (URI and go to page).
  • PDFs with rotated pages.
  • PDFs with landscape double page feature

Installation

To install from command line:

cordova plugin add com.lesfrancschatons.cordova.plugins.pdfreader

or:

phonegap local plugin add com.lesfrancschatons.cordova.plugins.pdfreader

Documentation

Supported URI scheme: file For other schemes, please download it first with cordova plugin fileTransfer.

//Open a pdf
PDFReader.open('absolutepath.pdf', options, success, error);

//Available options
{
    password: null,
    flatUI: true,
    showShadows: true,
    enableThumbs: true,
    disableRetina: false,
    enablePreview: true,
    bookmarks: true,
    landscapeDoublePage: true,
    landscapeSingleFirstPage: true,
    toolbarBackgroundColor: null,
    textColor: null,
    enableShare: false
}

//Event when PDF Reader is closed
document.addEventListener('PDFReaderClosed', function() {console.log('closed');})

//Clear PDF Reader cache
PDFReader.clearCache(filePath, finishedCallback);



Buy me a coffee

cordova-pdfreader-ios's People

Contributors

etabard avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.