How to Specify PDF Builder for Output
We offer three different means of generating PDF output through our engines: our internal Fluent PDF renderer, Microsoft Office PDF and PdfTron. We use our internal PDF render by default. Here are the instructions on how to specify which PDF builder you want to use for output.
If you use the Java Engine, you can specify your desired PDF builder in the WindwardReports.properties file. To do so set these properties:
- For PDFtron builder:
use.external.output.builder=true
output.builder=net.windward.env.PDFTronOutputBuilder
- For Microsoft Office PDF builder, you will need the "OfficeToPdf.exe" file. You may download it here. Extract the zip to a location on the machine your application will have access to. Once you've done that, enter the following values in the WinwardReports.properties file:
use.external.output.builder=true
OfficeToPdf.exe= "PATH_TO\\OfficeToPdf.exe"
Make sure to include the name of the exe in the PATH_TO\\OfficeToPdf.exe
Some Microsoft Office installations may require the following steps if the engine is being ran as part of a Tomcat service (like with RESTful engine).
Symptom: Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied.
Root cause: Windows services run in Session 0, which is isolated from interactive desktop sessions. Microsoft 365 (Click-to-Run) Office uses a virtualized COM layer that does not respect standard DCOM Launch/Activation permissions when activated from Session 0. Word COM automation requires a real user session context.
Prerequisites
A dedicated Windows user account (local or domain) that has:
- Logged in interactively at least once (to create a full user profile)
- Microsoft Office installed and activated
- "Log on as a service" right granted (Windows will prompt to add this automatically when you assign the account to a service)
- Full Control permissions to the Tomcat install directory
- Full Control permissions to the directory containing OfficeToPdf.exe
Step 1 — Create the Desktop directory for the account (required)
Open PowerShell as Administrator and run:
New-Item -ItemType Directory -Force -Path "C:\Windows\System32\config\systemprofile\Desktop"
New-Item -ItemType Directory -Force -Path "C:\Windows\SysWOW64\config\systemprofile\Desktop"
This is required for Office COM operations to succeed when running from a service context. Without it, the conversion will fail even if all other steps are correctly configured.
Step 2 — Configure the Tomcat service to run as the dedicated user
- Open Services (
services.msc) - Find your Tomcat service → right-click → Properties → Log On tab
- Select This account, enter the dedicated user account and password
- Click OK — Windows will automatically grant "Log on as a service" if needed
Step 3 — Configure DCOM Identity for Microsoft Word
- Open Component Services (
dcomcnfg) - Expand: Component Services → Computers → My Computer → DCOM Config
- Find Microsoft Word 97 - 2003 Document → right-click → Properties
- Go to the Identity tab
- Select This user, enter the same dedicated account used in Step 2
- Click OK
Step 4 — Restart the Tomcat service
- Open Services (
services.msc) - Find your Tomcat service → right-click -> Restart
Notes
- The Tomcat service account and the DCOM Identity account must match.
- All four steps are required — skipping any one of them will result in the same error.
- If Office is updated or reinstalled, recheck the DCOM Identity setting — it may be reset.
- This issue is specific to Click-to-Run Office installations (Microsoft 365, Office 2019+). MSI-based Office installations may respond to DCOM permission changes alone without needing the Identity change.