Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.82 KB

README.md

File metadata and controls

42 lines (28 loc) · 1.82 KB

Ember-pdf-js

Standard - JavaScript Style Guide Latest NPM release Ember Observer Score License Dependencies Dev Dependencies Build Status

This is a simple addon to wrap PDF.js in ember.

Addon's "API"

To use it in a really simple way just use the pdf-js component:

{{pdf-js pdf=urlOfYourPdf}}

In most cases, you will want to "extend" the toolbar component, you can develop your own component and make ember-pdf-js use it:

{{pdf-js pdf=urlOfYourPdf toolbarComponent="your-component-here"}}

Your toolbar component should extends the original component:

import PdfJsToolbar from 'ember-pdf-js/components/pdf-js-toolbar';
import layout from '../../templates/components/pdf-js/toolbar';

export default PdfJsToolbar.extend({
  layout
  })

A word about the current page update

There are some limitation ATM on how the current page is updated. The "scroll" need to be placed on the .pdfViewerContainer. For an example on how to do it, check the dummy app's style sheet