tutorial · 2026-04-03
Adding Next/Previous Page Navigation to an In-Game PDF in Unreal Engine 5
Wire UMG buttons, a page counter and a progress slider to Simple PDF Viewer so players can page through a document in the 3D world.
The navigation functions you'll wire
You have a PDF rendering on a wall poster, an open book or a kiosk screen, but it just sits on page one. To let players actually read a manual, lore book or brochure you need real Unreal Engine PDF page navigation buttons: a Next, a Previous, a 'Page X of Y' counter, and ideally a slider for long documents. This tutorial wires all of that with Simple PDF Viewer, entirely in Blueprint.
Simple PDF Viewer exposes its paging as Blueprint-callable functions on the PDF Viewer actor or PDF Render component, so you never touch C++. The five movement functions are 'Next Page', 'Previous Page', 'Go To Page' (jump to an index), 'Go To First Page' and 'Go To Last Page'. To report position, 'Get Current Page' returns where you are and 'Get Page Count' returns the total. For a scrub control there is 'Scroll To Progress' and 'Get Scroll Progress', both on a normalised 0.0 to 1.0 range.
The glue that keeps your UI in sync is the 'On Page Changed' event, which fires on every navigation and hands you New Page and Total Pages. Bind that single event and your label and slider update no matter how the page moved. Two companion events are worth binding too: 'On PDF Loaded' (giving Page Count) so your UI starts in the right state, and 'On PDF Load Failed' (giving an Error Message) so it fails gracefully. Make sure the plugin is installed into Plugins and enabled, and that a PDF is on screen, before you start.
Wiring UMG buttons to NextPage and PreviousPage
Build a small UMG widget with two 'Button' widgets, each with a child 'Text' block, named for example 'Btn_Prev' and 'Btn_Next', plus a 'Text' block named 'Txt_PageCounter'.
1. In the Event Graph, get a reference to your viewer. The cleanest approach is a variable of type APDFViewerActor (or your custom actor with the PDF Renderer component) marked Instance Editable and Expose On Spawn, passed in when you create the widget; alternatively use the library helper 'Get All PDF Viewers' to find one already in the level.
2. Select 'Btn_Next', add its 'On Clicked' event, drag from the viewer reference and call 'Next Page'. That one call advances the document a page.
3. Do the same for 'Btn_Prev', calling 'Previous Page' on the viewer reference.
4. The functions are safe at the document edges, so 'Next Page' on the last page or 'Previous Page' on the first does nothing. Even so, disable the relevant button at each edge using 'Get Current Page' and 'Get Page Count' so the controls reflect reality.
Showing 'Page X of Y' with OnPageChanged
A counter only feels right if it updates the instant the page moves, so drive it from the 'On Page Changed' event rather than reading the page every tick.
1. Get a reference to the viewer and bind a custom event to its 'On Page Changed' delegate.
2. In that event you receive New Page and Total Pages. Build a string like 'Page 3 of 12' with a 'Format Text' node and call 'Set Text' on 'Txt_PageCounter'. Decide once whether you present pages one-based for players (most readable) by adding one to the raw index, then keep that convention everywhere.
3. Set the initial state from the 'On PDF Loaded' event, which gives the Page Count: write the starting label and enable or disable the buttons for the first page. Bind 'On PDF Load Failed' too, and show its Error Message so the player is never left staring at a blank surface.
Driving a slider, and going further
For long documents, add a UMG 'Slider' with Min Value 0 and Max Value 1 to scrub the whole PDF, which maps directly onto the viewer's 0.0 to 1.0 progress range. In the slider's 'On Value Changed', pass its Value straight into 'Scroll To Progress'. To keep the slider in sync when the page changes by other means, call 'Get Scroll Progress' inside your 'On Page Changed' handler and feed the result into the slider's 'Set Value'; raise a simple boolean flag while handling 'On Value Changed' to avoid a feedback loop. If you prefer discrete jumps, multiply the slider Value by the page count, round it and call 'Go To Page' instead.
Beyond a single viewer, the Blueprint library offers 'Get All PDF Viewers' and 'Navigate All Viewers To Page' to move several screens together for a synchronised presentation, plus 'Load PDF Into Viewer' and path helpers to swap documents at runtime. If a PDF lives on a server, EasyHTTP pairs naturally: use 'Async Quick GET' to download the bytes, write them to a local path, then call LoadPDF on the viewer.
Keep two limits in mind. Simple PDF Viewer rasterises pages to textures, so it is an image viewer, not a text-selectable document, with no form filling or hyperlink navigation in the API. Render resolution is capped (RenderWidth clamps 256 to 4096), so for crisp text on a large surface raise RenderQuality rather than expecting unlimited sharpness. With navigation, counter and slider in place, your players have a real paged reading experience driven entirely from UMG.
Simple PDF Viewer navigation API at a glance
| Function / Event | What it does | Use it for |
|---|---|---|
| Next Page | Advance one page (safe at the last page) | A Next button |
| Previous Page | Go back one page (safe at the first page) | A Previous button |
| Go To Page | Jump to a specific page index | Bookmarks, slider-to-page jumps |
| Go To First Page / Go To Last Page | Jump to the start or end | Home / End controls |
| Get Current Page / Get Page Count | Read current position and total | A 'Page X of Y' label |
| Scroll To Progress / Get Scroll Progress | Set or read position as 0.0-1.0 | A scrub slider |
| On Page Changed (New Page, Total Pages) | Fires whenever the page moves | Keeping label and slider in sync |
All functions are Blueprint-callable on the PDF Viewer actor or the PDF Render component.
FAQ
How do I add Unreal Engine PDF page navigation buttons in Blueprint?
Build a UMG widget with two buttons, get a reference to your PDF Viewer actor or PDF Render component, and on each button's 'On Clicked' event call 'Next Page' or 'Previous Page'. Both functions are Blueprint-callable and are safe to call at the document edges, where they simply do nothing.
How do I show the current page and total page count?
Bind to the viewer's 'On Page Changed' event, which fires on every navigation and provides New Page and Total Pages. Format those into a string like 'Page 3 of 12' and call 'Set Text' on a UMG Text block. Set the initial label from the 'On PDF Loaded' event, which gives you the Page Count when the document finishes loading.
Can I use a slider to scrub through the PDF?
Yes. The viewer exposes 'Scroll To Progress' and 'Get Scroll Progress' on a 0.0 to 1.0 range, which maps directly to a UMG Slider with Min 0 and Max 1. Call 'Scroll To Progress' from the slider's 'On Value Changed', and update the slider from 'Get Scroll Progress' inside your 'On Page Changed' handler to keep them in sync.
Does Simple PDF Viewer support text selection or clickable hyperlinks?
No. It rasterises each page to a UTexture2D and displays it as an image, so it is not a text-selectable viewer and there is no form filling or hyperlink navigation in the Blueprint API. For sharp text on a large surface, raise the render resolution (RenderWidth clamps between 256 and 4096).
Which engine versions and platforms does it support?
Simple PDF Viewer ships live packages for Unreal Engine 5.5, 5.6 and 5.7, and is Windows-only (Win64), because page rasterisation is backed by the bundled PDFium library. Do not expect Mac, Linux or mobile support.
Simple PDF Viewer
Display PDFs inside Unreal — render pages to textures on meshes and actors with page navigation, a Blueprint API for loading and querying documents, and editor utilities to preview and auto-build the display material. Powered by PDFium; no telemetry.