HubSpot PDF viewer module
A PDF link sends visitors to a browser tab, and you lose them there. Inline PDF Viewer keeps the PDF on your page.
Inline PDF Viewer is a free HubSpot module. Pick a PDF from your File Manager, drop the module on a website page, landing page or blog post, and visitors read it in place: page counter, zoom, fit width or whole page, full screen, search, thumbnails, Download and Print. You choose which controls show.
Who it is for
I built it for teams that publish brochures, product guides, reports and white papers on HubSpot and want people to read them on the page, not in a download folder. If you collect contacts for a document today with a landing page and a thank-you link, the form gate can do that inside the viewer.
What it does
Search finds words on any page, even pages not drawn yet, and steps through every match. The thumbnail sidebar jumps to any page. A link that ends in #page=5 opens page 5, and the address follows the reader, so a sales email or a help article can point to the exact page. You can also set the page every visitor starts on.
The form gate uses a HubSpot form. Choose Before reading the rest, with a number of free pages, or Before downloading only. Visitors who submit stay unlocked for the number of days you set. It is a soft gate: the PDF address is in the page source, so it collects contacts and does not protect the file.
The viewer sends page views and read depth (25, 50, 75 and 100 percent of pages) to your data layer, once each, so your analytics can show how far people read. On HubSpot Professional and Enterprise plans it can also send each viewer action to HubSpot as a custom event, so a contact's timeline shows what they read. Each one counts toward HubSpot's monthly custom event limit. Create the event in HubSpot, then paste its internal name into the module. Left blank, nothing goes to HubSpot.
Accessibility, phones and page weight
The toolbar works by keyboard. Arrow keys, Page Up and Page Down, Home and End move between pages, every control has a visible focus ring, and page changes are announced to screen readers. Automated axe checks found no WCAG 2.1 AA issues on the viewer on the demo pages. Automated checks do not catch everything, so test it with your own content. On phones it supports pinch zoom, swipe and full screen.
PDF.js, Mozilla's PDF reader, ships inside the module, so the viewer loads nothing from outside your HubSpot account. It adds about 550 KB, compressed, to pages that use it. PDF.js does not start, and the PDF does not download, until the viewer comes within about 800 px of the screen.
What it does not do
- One PDF per viewer. You can put several viewers on a page.
- Scanned PDFs without a text layer display, but search finds nothing in them.
- The form gate is not a security control. Do not gate a file that must stay private.
- Chinese, Japanese and Korean text in PDFs that do not include their fonts needs an optional setting that loads font data from jsDelivr, a public file host. It is off by default.
Setup order
| Step | What you do | Why it comes here |
|---|---|---|
| 1 | Upload the PDF to the File Manager | The viewer reads PDFs from your HubSpot files |
| 2 | Add Inline PDF Viewer to a page and pick the PDF | Nothing shows until a PDF is picked |
| 3 | Add a document title | It names the viewer for screen readers and the download |
| 4 | Turn off any control you do not want | Fewer buttons for short documents |
| 5 | Add a form gate if you want contacts | Pick the form and the free pages |
| 6 | Preview at desktop and phone width, then publish | Check the starting page and the gate before visitors do |
Frequently asked questions
What does it cost?
Nothing. The module and email support are free.
Do I need another account?
No. It reads PDFs from your HubSpot File Manager and uses HubSpot forms for the gate.
Can I link to a page inside the PDF?
Yes. Add #page= and the page number to the page address. The address also follows the reader as they move through the PDF.
Does the form gate protect my PDF?
No. It collects contacts. Anyone who finds the file address can open the PDF.
How does support work?
Support is free, in English, at info@allgusto.com. It comes to me directly, and I reply within one business day.
Get Inline PDF Viewer
Try the live demo, switch between light and dark and the color presets, and open the gated example. Then read the setup guide. Inline PDF Viewer is free on the HubSpot Marketplace. All Gusto is a HubSpot Solutions Partner, and I build every module I list on the Marketplace and answer its support email myself. You can also see the other HubSpot apps and themes I build.