Skip to content

gestixi/sproutcore-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:https://assets.example.com/pdf.worker.js";
PDFJS.imageResourcesPath = "http:https://assets.example.com/images";
PDFJS.cMapUrl = "http:https://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)

About

A basic PDF Viewer for SproutCore.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published