Home / PDF Tools / PDF Embed Code

PDF Embed Code

Generate HTML to embed a PDF on your website: a PDF.js viewer that works on phones, or iframe and object code.

Free, no uploads, no sign-up. Runs 100% in your browser.

How PDF Embed Code works

Builds a copy-ready HTML snippet from your options. The viewer option renders pages with PDF.js from a CDN, so it works in every browser, including phones that do not show PDFs inline. You can preview it with a local file.

Input: URL. Output: HTML.

How to use PDF Embed Code

  1. Drop your PDF onto the PDF Embed Code area, or click to choose it.
  2. Wait a moment while page thumbnails render locally.
  3. Choose the pages and options you need. Previews update as you go.
  4. Press the main action button and download the finished PDF.

Tips

  • Encrypted PDFs must be unlocked first with Unlock PDF.
  • Large scanned PDFs are mostly images. Compress PDF shrinks them the most.
  • Your original file is never modified; you always download a new copy.

PDF Embed Code FAQ

Are my files uploaded?
No. This tool runs entirely in your browser tab. Files are read from your disk into memory and the result is generated locally.
Is it free? Are there limits or watermarks?
Free and open source (MIT). There are no file-size caps, daily quotas, accounts or watermarks.
Does it work offline?
Yes, once the page (and any engine it needs) has loaded, it keeps working without a connection thanks to the service worker cache.

Related tools

  • PDF Reader: Fast viewer with search, zoom, thumbnails and outline.
  • Web-Optimize PDF: Linearize a PDF for fast web view and pack it with compressed object streams.
  • Compress PDF: Shrink PDF size with smart image downsampling and stream compression.
  • Merge PDF: Combine multiple PDFs into one ordered document with drag-and-drop sorting.

OpenFile runs in your browser. Turn on JavaScript to use the tools.