Before we start, there are two different preview methods we’ll talk about:
FactBox Preview (with image conversion)
- Converts the PDF pages into images (PNG) to display inside the FactBox.
- The image quality may slightly reduce due to conversion.
- Requires runtime 16 or higher because it relies on the new
ExtendedDatatype for the Media type introduced in BC runtime 16.
Action Button Preview (native PDF view)
Opens the actual PDF file directly without conversion, preserving full quality.
Works perfectly for quick previews without the FactBox setup.
Let's start with the Factbox Preview
🧱 Step 1: Create a Table for Storing the Media
We’ll start by creating a simple custom table to store only the Incoming Document Entry No. of attachment as a reference point. We will create the Media field at runtime from PDFs to show them in Factbox.
🧮 Step 2: Create the FactBox Page
Next, we’ll build a CardPart page to preview our document image.
Here, we’ll convert the PDF into a PNG and store it in the Media field we just created.
⚙️ Step 3: Add the FactBox to the General Journal
Let’s now extend the General Journal page and attach our FactBox to it.
🪄 Step 4: Automatically Store Document Entry
Whenever an incoming document is attached, we’ll ensure it’s recorded in our custom table using an event subscriber.
Now you can publish your extension, and the FactBox will show a live preview of your attached PDFs — rendered as images 🎉
📄 Optional: Add Multi-Page PDF Navigation
If your PDF has multiple pages, you can extend your FactBox to show Next and Previous buttons to browse through pages. Change the CardPart code to the below mentioned -


🖱️ Preview PDF via Action Button
If you prefer viewing the actual PDF file in full quality, we can simply trigger the preview using an action button. Although you can view it from the Incoming Documents Factbox, it will make you understand how the code works at backend.
Here’s how we can add it to the General Journal page:
This uses the standard logic from table 137 – “Inc. Doc. Attachment Overview” to fetch and display the attached file, ensuring compatibility with existing Business Central functionality.
✅ Wrapping Up
And that’s it!
You now have two ways to preview PDF attachments in Business Central:
- FactBox View — Converts and displays a snapshot preview directly within the page.
- Action Button View — Opens the actual PDF in full fidelity.
Both are powerful and can be used depending on your user experience goals.
💡 Tip: If you’re using PDFs with multiple pages or large attachments, the FactBox conversion approach may slightly impact performance — so use it carefully in high-volume journal pages.
END
Hope this helps!
Aman K
code snippet widget