Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-pdf-viewer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-pdf-viewer

Svelte component wrapper for mozilla pdfjs

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Keywords

FAQs

Package last updated on 14 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc