
Security News
Vite Releases Technical Preview of Rolldown-Vite, a Rust-Based Bundler
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
org.webjars.bower:pdf.js-viewer
Advanced tools
PDF.js is a Portable Document Format (PDF) library that is built with HTML5.
This is a build version of the PDF.js, including the viewer.
bower install pdf.js-viewer
Include viewer.html
using SSI or your favorite templating system.
<html>
<head>
<title>PDF.js viewer</title>
<script src="bower_components/pdf.js-viewer/pdf.js"></script>
<link rel="stylesheet" href="bower_components/pdf.js-viewer/viewer.css">
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div class="pdfjs">
<!--#include virtual="bower_components/pdf.js-viewer/viewer.html" -->
</div>
<script>
// note that the file can also be a Uint8Array if you want to serve binary data
var file = 'some-document.pdf';
// This initializes the webviewer, the file may be passed in to it to initialize the viewer with a pdf directly
window.PDFJS.webViewerLoad();
// open a file in the viewer
window.PDFViewerApplication.open(file);
</script>
</body>
</html>
Normally mozilla's PDF js viewer, will only run as standalone. We forked the project and patched it, so you can include it within a page.
To update this version, get the patched pdf.js source code and build the project
git clone https://github.com/legalthings/pdf.js.git
cd pdf.js
npm install
gulp generic
cd ..
And update the files from source and patch them
cd pdf.js-viewer
npm install
./build.sh ../pdf.js/build/generic/
FAQs
WebJar for pdf.js-viewer
We found that org.webjars.bower:pdf.js-viewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Vite releases Rolldown-Vite, a Rust-based bundler preview offering faster builds and lower memory usage as a drop-in replacement for Vite.
Research
Security News
A malicious npm typosquat uses remote commands to silently delete entire project directories after a single mistyped install.
Research
Security News
Malicious PyPI package semantic-types steals Solana private keys via transitive dependency installs using monkey patching and blockchain exfiltration.