13
Views
3
Comments
[Ultimate PDF] UltimatePDF PrintToPDF does not generate binary in the production stage
Ultimate PDF
Forge asset by OutSystems Labs
Application Type
Reactive, Service

Hello everyone, 

I am new to the Outsystems community, so please forgive me if I don't get everything right in my first post. 

I work in ODC and have the following problem: I want to generate a PDF from a page and save it in a database on another service. This works fine when I test it in the DEV environment. As soon as I am in the production stage, the generated BinaryData is empty without me receiving an error message. 


Flow:

Settings:


Do you have any idea what could be causing this?


Best regards,

Flo


2025-11-19 06-14-01
Miguel Verdasca
Champion

Hi Flo,

This behaviour usually happens in ODC when PrintToPDF works in DEV but returns an empty BinaryData in PROD. Since there is no error, the most common root causes are related to URL accessibility, authentication, or environment restrictions.

Here are the main points to check:

1. The PROD environment might not allow access to the URL you are printing PrintToPDF loads the page in a headless browser. If the page requires authentication, tokens, or is not publicly accessible, the PDF engine in PROD may be receiving an empty response → resulting in an empty PDF.

Try calling the same URL directly from a private/incognito browser window in PROD to confirm whether it loads without login.


2. Absolute URL vs relative URL Ensure that the URL passed to PrintToPDF in PROD is fully valid and reachable. In some setups, CurrEnvironment.BaseURL in PROD returns a different host name or protocol (HTTP/HTTPS mismatch).

You can log the final URL and open it manually to verify.


3. Some components on the page may block rendering in PROD Sometimes scripts or dependencies behave differently in PROD. As a test, create a very simple screen ("Hello world") and try generating a PDF from it. If that works, the issue is in the target screen.


4. Network / firewall / outbound permission Production environments often have stricter outbound rules. The PrintToPDF engine may not be able to fetch stylesheets, fonts or images, which can cause the PDF generator to fail silently.


5. Check the size of the generated PDF If the BinaryData is not null but extremely small (e.g., 200–500 bytes), this indicates a failed or partially loaded page.


Recommended next step

  • Log the full URL

  • Test the URL manually in PROD

  • Try PDF generation on a basic “Hello World” page

  • Compare behaviour between DEV and PROD network access


Best regards, Miguel


2025-12-30 13-46-57
Florian Obersteiner

Hi Miguel, 

Thanks for your help. Here are the results of my testing.


1. I tested the URL in an incognito window and it loads as desired. 

2. I hard-coded the URL. The same behavior occurred here as well. The file name is generated in the flow, but there is no binary data to display. 

Unfortunately, I don't yet know how to integrate logs into ODC. Do you have any tips for me here? 

3. I built a very simple page with only a text field. Here, too, no PDF is generated (binary data). 

4. When I look at the environment settings in the portal, both are set to the default settings. Can I make further settings here? According to these settings, both environments are the same. 

5. I perform a Nullbinary() check and then display an error message directly on the page. This indicates that no binary data is available. FileContent = NullBinary().


I hope you have some more tips for me. I'm really struggling to find the problem now.


If you need more information from the system, please let me know.


Best regards, Flo

2025-11-19 06-14-01
Miguel Verdasca
Champion

Hi Flo,

Thanks for the detailed follow-up, that really helps narrow it down.

Given your results (public URL works, hard-coded URL behaves the same, even a simple “Hello World” page returns NullBinary() in PROD), this strongly points to a platform-level restriction or issue in the PROD environment, not to your implementation.

A few important points:

  1. UltimatePDF / PrintToPDF in ODC: In ODC, PDF generation relies on an internal headless rendering service. If all pages fail in PROD, including simple ones, it usually means the PDF engine cannot execute or is blocked at environment level. This is not something you can fix in the app.

  2. Logging in ODC: You’re right, traditional server logs are limited. What you can do:

    • Use LogMessage actions before and after PrintToPDF to confirm execution flow.

    • Log the returned Binary length (even Length(BinaryToText())) to confirm it’s truly empty.

    • Check Environment → Activity → Errors in the ODC portal for backend failures.

  3. Environment settings: There are no additional portal settings that control the PDF engine directly. If DEV works and PROD doesn’t, with identical config, this further suggests an internal service or permission issue.

At this stage, I strongly recommend opening a ticket with OutSystems Support and referencing:

  • Ultimate PDF (ODC)

  • PROD returns NullBinary() with no error

  • DEV works with the same flow

  • Even minimal pages fail

This is very likely something they need to fix or reconfigure on their side.

Hope this helps, and sorry I can’t give you a more actionable workaround here, you’ve done all the right checks already.

Best regards, Miguel

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