54
Views
3
Comments
Solved
[Ultimate PDF] Ultimate PDF - How to get binary data of the PDF?
Question
ultimate-pdf
Reactive icon
Forge asset by Leonardo Fernandes

Hello, 


I am using the block PrintLayout\ScreenToPDF to create an invoice. How can I get the binary data of the generated PDF file? I want to save the file in the DB when I download the file.




2024-07-12 05-57-50
Gourav Shrivastava
Champion
Solution

Hello @Jeffrey Lai 

You have to use PrintToPDF or PrintToPDF_Advanced actions they both give you the binary output you just need to give your invoice screen URL.


 Thanks

Regards Gourav Shrivastava

2026-01-23 11-38-55
Dinesh Murugan
Champion

Hi @Jeffrey Lai ,


I hope this below-mentioned forum reply will help you. 

NOTE : Try to add the download widget in the action.


LINK : https://www.outsystems.com/forums/discussion/80466/download-binarydata-stored-in-db/

UserImage.jpg
Jeffrey Lai

Hi @Dinesh murugan,

Thank you for reply. I know how to download a binary date as file from DB. My Question is how to get the PDF file (in Binary Data format) when I call the block PrintLayout\ScreenToPDF in Ultimate PDF.

The following is how I use the ScreenToPDF Block:

1. I Add the ScreenToPDF Block to a Screen.

2. When I redirect to that Screen, the ScreenToPDF block help me format the Screen and generate the PDF by some kind of API.

3. The PDF is generated by the API, and the file is downloaded automatically.

The output of the API is the binary data of the PDF file, but I don't know how to get it as output parameter.

2024-07-12 05-57-50
Gourav Shrivastava
Champion
Solution

Hello @Jeffrey Lai 

You have to use PrintToPDF or PrintToPDF_Advanced actions they both give you the binary output you just need to give your invoice screen URL.


 Thanks

Regards Gourav Shrivastava

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