This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

svelte-pdf-viewer

1.0.0 • Public • Published

This is a wrapper for pdf.js, that make it ease to use.

You can use this with svelte or vanilla js.

How to

npm install svelte-pdf-viewer

Svelte

<PdfViewer file={ myFileUrl } bind:infos={ pdfInfos }/>

<script>
	import PdfViewer from 'svelte-pdf-viewer'
	let pdfInfos
	const myFileUrl = ''
</script>

Vanilla

<div id="container">
</div>

<script>
	import PdfViewer from 'svelte-pdf-viewer'
	import 'svelte-pdf-viewer/dist/bundle.css'
    const myFileUrl = ''
    
    new PdfViewer({
        target: document.querySelector('#container'),
        props: {
            file: myFileUrl
        }
    })
</script>

Props

file: string - file url
infos: object - read only object with pdf viewer infos, only useful with svelte. 
    info.totalPages: number - total of pdf pages
    info.zoom: number - current zoom percent, min: 0.4, max 1.9
    info.currentPage: number - current page

Events

No one yet

Package Sidebar

Install

npm i svelte-pdf-viewer

Weekly Downloads

5

Version

1.0.0

License

Apache-2.0

Unpacked Size

1.37 MB

Total Files

16

Last publish

Collaborators

  • 01oseluiz
  • victoragc