14
Views
3
Comments
[HTML2PDF] HTML2PDF returns empty PDF in Development
html2pdf
Service icon
Forge asset by Miguel Antunes
Application Type
Service
Service Studio Version
11.55.69 (Build 64809)
Platform Version
11.40.0 (Build 46369)

Hi everyone,

we are experiencing an issue with the HTML2PDF (O11) component in an OutSystems 11 environment.


Context:

- We are using HTML2PDF as a Service

- It is called from Reactive Web applications

- We use GeneratePDF_Advanced with:

  - URL = "about:blank"

  - HTML = MyHTML (string)


Problem:

- In Development environment, the generated PDFs are always EMPTY

- The PDF file is created and downloaded, but it contains no content

- The same implementation works correctly in Test and in Prod environment


Important test performed:

To isolate the issue, we replaced our dynamic HTML with a minimal static HTML:

PDF TEST


Result:

- In Development → PDF is still EMPTY

This confirms that the issue is NOT related to the HTML content.

Additional observations:

- No visible errors in UI

- wkhtmltopdf seems to execute (based on logs)

- The issue started suddenly without code changes

- It affects multiple applications using the same service


Suspected causes:

- Environment-specific issue (Development only)

- wkhtmltopdf execution context

- Permissions on TEMP folder

- Security / antivirus restrictions

- Blocked execution of binaries


Questions:

- Has anyone experienced empty PDFs even with static HTML?

- Could this be related to environment restrictions or permissions?

- Any known issues with HTML2PDF + wkhtmltopdf in Development environments?


Any help or similar experience would be highly appreciated.

Thanks in advance!





Screenshot 2026-05-04 163646.png
Screenshot 2026-05-04 162721.png
Screenshot 2026-05-04 163007.png
Screenshot 2026-05-04 162654.png
2023-09-21 12-55-43
SIRAJKHILJI

1. 🚫 Execution Permissions / Security Blocking (Top Cause)

Even if wkhtmltopdf.exe runs, security tools may block:

  • HTML rendering
  • File access (temp files, fonts, CSS)

Check:

  • Windows Defender / Antivirus
  • Endpoint protection (CrowdStrike, Symantec, etc.)
  • AppLocker / Group Policy

👉 This is the #1 real-world cause of “empty PDF”

2. 📁 TEMP Folder Access Issue

wkhtmltopdf uses temp files internally.

If Dev environment:

  • Cannot write/read temp files
  • Has restricted %TEMP% or C:\Windows\Temp

👉 Result = empty output

Verify:

  • IIS user (e.g. IIS_IUSRS) has Full Control on:
    • %TEMP%
    • OutSystems temp folders

3. 🔤 Fonts Missing or Blocked

If fonts are unavailable:

  • PDF may render blank

Check:

  • Fonts installed in Dev?
  • Access to:

    C:\Windows\Fonts

4. ⚙️ wkhtmltopdf Binary Issue

Even if it "runs", it might be:

  • Corrupted
  • Wrong version
  • Blocked dependencies (DLLs)

👉 Common after:

  • Windows updates
  • Security patches

5. 🔒 Execution Policy / Sandbox Restrictions

Dev environments often have stricter policies:

  • No external process rendering
  • Limited system calls

6. 🧪 Service Account Differences

Check what account runs OutSystems services:

  • Dev ≠ Test/Prod

👉 That account might lack:

  • File permissions
  • Execution rights
2023-09-06 07-26-35
Sudip Pal

Hey @Binod Comini ,
Although I am not sure but I can assume this problem comes because of the company protected laptop. Have you checked this in your personal environment? I mean personal env inside company laptop and then if the issue, persists then we can assume this problem comes from company protected laptop.

Thanks,

Sudip

UserImage.jpg
Aravind GS

Hi @Binod Comini,

Since the issue also happens with a minimal static HTML, this strongly suggests the problem is environmental rather than related to the HTML itself.

A few additional things you could verify in the Development environment:

1. Test wkhtmltopdf execution directly on the server

Try executing wkhtmltopdf.exe manually from the Dev server using a very simple HTML file.

If the generated PDF is still blank outside OutSystems, then the problem is definitely at OS/security level rather than the application.

2. Check recent Windows or security updates

We experienced similar behavior once after:

Windows security updates

Endpoint protection policy updates

Antivirus signature updates

Even without code changes, these can silently affect wkhtmltopdf rendering.

3. Verify GDI / font rendering permissions

wkhtmltopdf depends heavily on Windows font rendering.

A useful test:

Try generating PDF with plain inline text using default fonts only

Avoid custom CSS/fonts temporarily

Sometimes missing access to:

C:\Windows\Fonts

GDI rendering components can produce completely blank PDFs instead of errors.

4. Validate TEMP file generation during runtime

Since HTML2PDF creates intermediate files internally:

Monitor %TEMP%

Check if temporary HTML/PDF files are created and immediately deleted

Verify IIS/AppPool identity permissions

Especially compare:

Dev AppPool identity

Test/Prod AppPool identity

5. Enable verbose logging for wkhtmltopdf

If possible, try capturing stderr/stdout from the process execution.

In many cases wkhtmltopdf actually outputs warnings like:

blocked local file access

rendering failure

font initialization errors

sandbox restrictions

but the component itself only returns an empty PDF.

6. Compare wkhtmltopdf binary versions

Even if the Forge asset is identical, the actual binary on Dev may differ or become corrupted.

Worth checking:

file hash

execution manually from CMD

reinstalling the binary/service component

The fact that:

Test works

Prod works

multiple apps fail only in Dev

static HTML also fails

makes this look highly likely to be:

permission/security related

temp folder restriction

corrupted wkhtmltopdf runtime

or OS-level rendering restriction.

Hope this helps — curious to know what the root cause turns out to be.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.