Set How a PDF Opens: Layout, Page Mode and Window Options
Setting viewer preferences means writing display hints into a PDF's document catalog: the page layout (single page, continuous, two-up), the page mode (plain view, bookmarks panel, thumbnails, or full screen), and window options such as fitting the window or showing the document title. This tool writes those entries into your file locally in the browser. The hints are advisory - conforming readers follow them, but some viewers ignore them.
How it works
The root object of every PDF is the document catalog, and three of its entries control the initial presentation. /PageLayout takes one of six names — SinglePage, OneColumn, TwoColumnLeft, TwoColumnRight, TwoPageLeft, or TwoPageRight — telling the reader whether to page one sheet at a time, scroll continuously, or show facing pages. /PageMode takes UseNone, UseOutlines, UseThumbs, or FullScreen, deciding which navigation panel (if any) opens alongside the first page. The third entry, /ViewerPreferences, is a dictionary of boolean flags such as /HideToolbar, /HideMenubar, /FitWindow, /CenterWindow, and /DisplayDocTitle.
This tool loads your file with pdf-lib, sets the catalog entries you choose, and re-saves the document. Nothing in the page tree is touched: the same content streams, fonts, and images are written back, and only the catalog dictionary gains or changes a few name and boolean entries. That is why the output is virtually identical in size to the input, and why the change is impossible to see until the file is opened in a reader.
The crucial caveat is in the PDF specification itself: these entries are preferences, not commands. Adobe Acrobat and most full desktop readers honor page layout, page mode, and the window flags. Browser-embedded viewers are far more selective — Chrome's and Firefox's viewers keep their own layout controls and ignore most catalog hints, and FullScreen typically triggers a confirmation prompt in readers that support it at all, since silently seizing the display is treated as hostile behavior. Set the preferences that help your audience, but verify in the reader they actually use.
One flag deserves special mention: /DisplayDocTitle true makes conforming readers show the document's metadata Title in the title bar rather than the filename, and accessibility standards including PDF/UA mandate it. Pair it with a meaningful Title set via Change PDF information for the full effect.
Worked example: a 96-page manual that opens on its bookmarks
A software manual — 96 pages, 5.2 MB, with a 60-entry outline tree already in place — was being sent to customers who kept missing the navigation panel and scrolling manually. Running it through this tool with page mode UseOutlines, layout OneColumn, and DisplayDocTitle enabled produced a 5.2 MB output (the catalog grew by roughly 120 bytes; everything else is unchanged).
Opened in Adobe Acrobat Reader, the manual now starts with the bookmarks panel expanded down the left side, scrolls continuously, and shows "Installation and Administration Guide" in the title bar instead of manual_v7_customer.pdf. Opened in Chrome's built-in viewer, it looks exactly as before — a working demonstration that the entries are honored by conforming desktop readers and ignored by minimal ones.
Frequently asked questions
How do I make a PDF open with the bookmarks panel showing?
Set the page mode to UseOutlines with this tool and save the file. Readers that honor the catalog's PageMode entry, including Adobe Acrobat, will open the document with the bookmarks panel expanded. The document needs an outline for the panel to have content.
Can a PDF be forced to open in full screen mode?
You can request it by setting the page mode to FullScreen, which presentation-style PDFs use. Most desktop readers then ask the user to confirm before switching, because taking over the screen without consent is treated as a security concern. Browsers generally ignore the request entirely.
Why does my PDF still open the same way after setting preferences?
Viewer preferences are advisory hints, and each reader decides whether to obey them. Browser viewers such as Chrome and Firefox ignore most of them, while Adobe Acrobat and many desktop readers honor layout and page mode. Test in the reader your audience actually uses.
What does the DisplayDocTitle option actually do?
It tells the reader to show the document's metadata Title in the window title bar instead of the filename. Accessibility standards such as PDF/UA require it, because a descriptive title read by screen readers is more useful than a filename. It only helps if the file also has a Title set.
Do viewer preferences change the pages or content of the PDF?
No. The entries are written into the document catalog, away from the page tree, so content, fonts, and layout stay byte-for-byte equivalent. Printing output is unaffected apart from optional print-scaling and duplex hints.
Which page layout should I choose for a booklet or spread design?
Use TwoPageRight, which shows facing pages side by side with odd pages on the right, matching how a printed book reads. TwoPageLeft is for layouts where page one belongs on the left. Single-column documents are usually best with OneColumn continuous scrolling.