Hi community,
I'm working with Business Central On-Premise version 25.1 (Platform 25.0.25866.0 + Application 25.1.25873.25900), in a hybrid code environment.
I already have a fully developed embedded PDF viewer (not the lite version), and until now I’ve been loading documents from the database using Document Attachment
.
Now I want to change the approach and read PDF files directly from a local shared folder, for example: \\SRV_NAME\FOLDER_NAME
, without storing them in the database.
My goal is to:
- Read the PDF file from the UNC path.
- Load it into a
TempBlob
. - Display it embedded in Business Central using the viewer I already have.
- Delete the
TempBlob
after viewing.
The Business Central server has access to the shared folder, and the service runs under a user with the necessary permissions.
I don’t yet have the code to read from disk, and I’m not sure how to do it properly in AL (especially in OnPrem extensions). Could someone help me implement this flow step-by-step, with working AL code compatible with OnPrem?
Thanks in advance!