Display PDF from shared memory buffers without saving it to persistent storage

Product: PDFTron Android SDK

Product Version: 9.0.1

Please give a brief summary of your issue:
Load PDF into memory buffers and access it from there without saving

Please describe your issue and provide steps to reproduce it:

I would like to load PDF (from a web url ) into memory and one of my app component will access that buffers and update it that with watermark or some other extra information. Once component done with updating I would like to use those memory buffers to render PDF.

How can we achieve this with PDF Tron.

Please provide a link to a minimal sample where the issue is reproducible:

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:



It is possible to load a document into memory using PDFDoc(byte[])
If possible could you elaborate more on the feature you would like to implement so we can better assist you?


Thanks for quick reply, following is my use case

I have an encrypted pdf at remote url, I would like retrieve that PDF and load into memory buffers and once it is done I will invoke my decrypt logic that will decrypt that file and place it into same memory buffers and my PDFViewer will render using that buffers.
In whole process, I would never like to save that PDF to device storage.

Please assist me how can we achieve this.

Thanks in Advance

Hi, based on your description, you will want to handle download yourself, decrypt it, then pass the byte array to PDFDoc (linked in our previous reply). Then the document will never touch the disk and you have full control over it. See guide for how to use PDFViewCtrl and PDFDoc here: https://www.pdftron.com/documentation/android/guides/basics/open/view/.