I just open-sourced EmbedPDF, a modern JavaScript PDF viewer that uses PDFium compiled to WebAssembly — not PDF.js.
If you've ever tried to deeply customize PDF.js or needed high-fidelity rendering, you’ve probably hit its limits. And when looking for alternatives, most roads lead to Apryse (formerly PDFTron) or Nutrient (formerly PSPDFKit) — both powerful, but closed-source and expensive.
There hasn’t really been a good middle ground — until now.
Wow, that really means a lot coming from you! I’ve come across SimplePDF quite a few times while researching! Super impressed by what you’ve built. Thanks for the kind words, fellow PDF’er
Thanks! I’ll be adding clearer documentation soon on how to integrate it with React and other major frameworks.
The viewer is designed to be framework-agnostic, and I’m working on lightweight integration layers for React, Vue, Svelte, etc. Stay tuned!
jerrygenser · 1d ago
Is there any security risk to use as project with an embedded .wasm binary? Is there a build process for this that we can reproduce, or is there a way to bring our own if it's a generally available asset?
Quick update: I just added a new option where you can set a custom wasmUrl when initializing the snippet. This way you can host your own .wasm build if you want to be 100% sure it hasn’t been modified.
Also, if you look in the package.json, there is a wasm script set up. Running pnpm run wasm will build the .wasm file inside Docker, so you get a clean, repeatable build.
chreniuc · 1d ago
Nice, it looks wonderful. I've been using pdf.js and it gave me a lot of headaches.
Another issue with pdfs is generating them, I'm still looking, years later, a library that you can pass a template or something and it generates a pdf. A simple interface to generwting pdfs, I couldn't find any. I was curious if you have plans on also implementing a Pdf generator.
bobsingor · 1d ago
Thanks! Yeah, I really get that, pdf.js gave me a ton of headaches too. Honestly, that’s part of why I started building this. I just needed something that didn’t fight me every step of the way.
Not planning to build a PDF generator just yet, but you're not the first to mention it. If more folks are looking for that kind of thing, I’d definitely consider it. Appreciate you bringing it up!
const_cast · 1d ago
One way to generate PDFs, and it's kind of round-about, using HTML to then convert to PDF with Chromium. You can make the HTML using templates and you get access to CSS, too.
arieldeveloper · 13h ago
had such a hard time with pdf js and getting a good viewer for it working at scale. Thanks for building this, will need to try it in my next project.
How does it work on other browsers other than chrome?
bobsingor · 1h ago
Thanks, really appreciate that. Definitely give it a try on your next project!
I tested it on Chrome, Safari, and Edge, and it’s been working great across all of them.
antman · 15h ago
Looks fast even on mobile. Can it support highlighting?
bobsingor · 1h ago
Yeah, I was surprised too. Rendering actually feels even faster on my iOS device at high zoom than on desktop Chrome. It’s pretty fascinating.
I’m currently working on annotations, highlights, comments, and more. Made good progress and should have something to release soon!
tbrockman · 1d ago
Fantastic! Looking forward to trying it out and replacing all my future links to PDFs with embeds instead.
How heavy of a component is it? (would typically inspect it myself but on my phone at the moment)
bobsingor · 1d ago
Thanks! Really appreciate that — curious to hear how it works out for you.
As for size (gzipped): the main JS file is about 77kB, the web worker is around 43kB, and the largest part is pdfium.wasm at roughly 2.7MB. The wasm handles all the heavy lifting, and it loads separately, so the core viewer stays pretty lightweight.
jmitcheson · 1d ago
Umm this is amazing!
The company I work for displays large engineering drawings in the browser; right now we have to choose between manual png conversion and loading the vectors directly (each one has its own problems). I tried the snippet application with one drawing and it renders perfectly.
For our application we have a 'Google Maps' style viewport where you pan and zoom with the mouse, though. Right now I'm seeing if Gemini 2.5 Pro can refactor the snippet application to work this way. Did you have any plans for building another type of snippet application which works in the fashion?
bobsingor · 1d ago
Thanks so much, that’s a huge compliment, really appreciate it.
Actually, most of what you’re describing is already there. We built a tiling plugin (https://github.com/embedpdf/embed-pdf-viewer/tree/main/packa...) that works kind of like Google Maps — instead of rendering the full document, it splits it into tiles and only renders what’s visible in the viewport. That’s how we keep it fast even for really large documents.
Right now we support pinch-zoom on mobile, but mouse pan/zoom isn’t wired up yet. Would love to see you collaborate on the project if you’re interested. This kind of feedback is a big encouragement!
SigmundA · 1d ago
Nice, I imagine it has the same issue as pdf.js when it comes to printing since its using canvas to render, it will just print bitmaps which leads to blurry print or OOM errors if doing high dpi.
pdf.js was trying to have a SVG renderer for a while which would allow vector printing, think they gave up on that.
bobsingor · 1h ago
Yeah, that’s true. It is not doing vectorized rendering, so printing is bitmap-based like pdf.js. For most use cases it works fine, but I get that for more high-end printing it could be a limitation. It is not something I am focusing on right now, but definitely something to keep in mind if more people need it.
If you've ever tried to deeply customize PDF.js or needed high-fidelity rendering, you’ve probably hit its limits. And when looking for alternatives, most roads lead to Apryse (formerly PDFTron) or Nutrient (formerly PSPDFKit) — both powerful, but closed-source and expensive.
There hasn’t really been a good middle ground — until now.
GitHub: https://github.com/embedpdf/embed-pdf-viewer
Demo & Docs: https://www.embedpdf.com
From another fellow « pdf’er »
The viewer is designed to be framework-agnostic, and I’m working on lightweight integration layers for React, Vue, Svelte, etc. Stay tuned!
Referring to this file: https://github.com/embedpdf/embed-pdf-viewer/blob/main/packa...
Here’s the commit: https://github.com/embedpdf/embed-pdf-viewer/commit/ff928377...
Thanks again for raising the point — really good feedback!
Also, if you look in the package.json, there is a wasm script set up. Running pnpm run wasm will build the .wasm file inside Docker, so you get a clean, repeatable build.
Another issue with pdfs is generating them, I'm still looking, years later, a library that you can pass a template or something and it generates a pdf. A simple interface to generwting pdfs, I couldn't find any. I was curious if you have plans on also implementing a Pdf generator.
Not planning to build a PDF generator just yet, but you're not the first to mention it. If more folks are looking for that kind of thing, I’d definitely consider it. Appreciate you bringing it up!
How does it work on other browsers other than chrome?
I tested it on Chrome, Safari, and Edge, and it’s been working great across all of them.
I’m currently working on annotations, highlights, comments, and more. Made good progress and should have something to release soon!
How heavy of a component is it? (would typically inspect it myself but on my phone at the moment)
As for size (gzipped): the main JS file is about 77kB, the web worker is around 43kB, and the largest part is pdfium.wasm at roughly 2.7MB. The wasm handles all the heavy lifting, and it loads separately, so the core viewer stays pretty lightweight.
The company I work for displays large engineering drawings in the browser; right now we have to choose between manual png conversion and loading the vectors directly (each one has its own problems). I tried the snippet application with one drawing and it renders perfectly.
For our application we have a 'Google Maps' style viewport where you pan and zoom with the mouse, though. Right now I'm seeing if Gemini 2.5 Pro can refactor the snippet application to work this way. Did you have any plans for building another type of snippet application which works in the fashion?
Actually, most of what you’re describing is already there. We built a tiling plugin (https://github.com/embedpdf/embed-pdf-viewer/tree/main/packa...) that works kind of like Google Maps — instead of rendering the full document, it splits it into tiles and only renders what’s visible in the viewport. That’s how we keep it fast even for really large documents.
Right now we support pinch-zoom on mobile, but mouse pan/zoom isn’t wired up yet. Would love to see you collaborate on the project if you’re interested. This kind of feedback is a big encouragement!
pdf.js was trying to have a SVG renderer for a while which would allow vector printing, think they gave up on that.