PDF Viewer
An out-of-the-box PDF viewer builds on PDF.js.
Quick Start
You can use the starter to initialize a demo app to explore how to use this package in your own project.
bash
# initialize a demo project with a quick starter
npm create @document-kits/viewer@latest my-app
# There will be prompt to let you choose a template to start,
# currently support Vue3, Lit and Solid.js.
cd my-app
# install dependencies
npm install
# run the dev server and open the default browser to view the demo
npm run dev --openbash
# initialize a demo project with a quick starter
pnpm create @document-kits/viewer@latest my-app
# There will be prompt to let you choose a template to start,
# currently support Vue3, Lit and Solid.js.
cd my-app
# install dependencies
pnpm install
# run the dev server and open the default browser to view the demo
pnpm run dev --openPrepare Resources
PDF.js depends on some resources to work.
All the necessary resources are located in node_modules/@document-kits/viewer/dist/generic/. When building the app using a bundler, make sure to copy these resources.
Resource List
web/locale/viewer.propertiesfor i18nweb/viewer.cssfor viewer stylebuild/pdf.worker.jsbuild/pdf.sandbox.jsweb/standard_fonts/*