Skip to content

Latest commit

 

History

History
52 lines (30 loc) · 1.26 KB

README.md

File metadata and controls

52 lines (30 loc) · 1.26 KB

SproutCore PDF

A basic PDF Viewer for SproutCore.

ScreenShot

Features

Getting Started

First, you will have to include PDF.js (https://github.com/mozilla/pdf.js). Since the library is a bit heavy, you may want to load it as a module.

We recommand you to include:

  • compatibility.js
  • pdf.js

Once PDF.js is loaded you have to set some variables:

PDFJS.workerSrc = "http://assets.example.com/pdf.worker.js";
PDFJS.imageResourcesPath = "http://assets.example.com/images";
PDFJS.cMapUrl = "http://assets.example.com/cmaps";
PDFJS.cMapPacked = true;

Usage

You can add a PDF viewer the same as you would for any control:

MyApp.MyPdfView = SC.PdfViewerView.extend({
  value: 'https://github.com/mozilla/pdf.js/raw/master/web/compressed.tracemonkey-pldi-09.pdf'
})

TODOs

  • Multiple pages rendering
  • Provides text-selection functionality
  • Provides a "search" or "find" functionality
  • Add some tests

License

The MIT License (MIT)