svelte-tiny-pdf
v1.0.2
Published
A tiny PDF viewer for Svelte
Downloads
157
Maintainers
Readme
svelte-tiny-pdf
A lightweight PDF viewer component for Svelte using PDF.js.
Installation
npm install svelte-tiny-pdf
Usage
<script>
import { TinyPDF } from 'svelte-tiny-pdf';
let pdfUrl = 'path/to/your/document.pdf';
</script>
<TinyPDF config={{url: pdfUrl}} />
Configuration Options
url
: Path to PDF file (string)data
: PDF data (optional)scale
: Zoom configurationinitial
: Initial zoom level (default: 1)step
: Zoom increment (default: 0.2)min
: Minimum zoom (default: 0.4)max
: Maximum zoom (default: 2)
innerscroll
: Enable inner scrolling (default: true)style
: Additional CSS styles
Methods
getCurrentPage()
getPageCount()
getPageText(pageNumber)
scaleUp()
scaleDown()
fitWidth()
fitHeight()
jumpPage(pageNumber)
jumpPageNext()
jumpPagePrevious()
download(filename)
License
MIT