Hello, I want to display a pdf file, but the pdf file is in the entity data service record, how to display it directly without downloading it from the entity?
To display a PDF file that is stored in an entity data service record in UiPath without downloading it, you can follow these general steps:
-
Retrieve the PDF Data: Use the appropriate API or integration in UiPath to retrieve the binary data of the PDF file stored in the entity data service record.
- If you’re using UiPath Orchestrator or a custom API to retrieve the entity data, you may need to use activities like
HttpClient
,Get Entity
(if available), orInvoke Method
to get the PDF’s binary data.
- If you’re using UiPath Orchestrator or a custom API to retrieve the entity data, you may need to use activities like
-
Convert Binary to PDF: If the PDF is in a binary format (such as Base64 or byte array), you’ll need to convert it to a format that can be displayed. You can save this binary data to a local file temporarily.
- Use the
Write Binary File
activity to save the byte array or Base64 string as a PDF file on your local machine.
- Use the
-
Display the PDF: Once the PDF is saved as a file, you can display it using an appropriate tool or viewer:
- You can use a PDF viewer like
Adobe Acrobat Reader
or any other program installed on your system, using theStart Process
activity to open the file.
Example of using
Write Binary File
:WriteBinaryFile("filePath.pdf", pdfByteArray)
Example of using
Start Process
:Start Process("filePath.pdf")
Alternatively, if you’re using a web-based solution or custom form, you can embed the PDF directly into a web browser or form by utilizing a
WebView
or embedding the file as an iframe, depending on the environment you’re working in. - You can use a PDF viewer like
This approach will allow you to display the PDF without needing to download it manually to the user, as the file content can be fetched directly from the entity record.