Load PDF from Memory

In some cases it is required to load a PDF directly from memory. For example when the PDF is hosted in a databse or to design a secure PDF Viewer.

There are lots of advantages of loading a PDF directly from memory to Aloaha. Besides the performance increase it is possible to load a PDF in such a way that there are no temp files on the local harddrive. For example for a secure PDF viewer.

It is very easy to load a document from memory. In the following example editor1 is the referenced aloaha.edit object.

'the following code loads a PDF document in into the bytearray/memory
Dim PDFBytes() As Byte
PDFBytes = editor1.read_bytes_as_variant(cstr("c:\document.pdf")) 

'the following line passes the bytearray to Aloaha
Call editor1.store_PDF_in_MEM(PDFBytes) 

'please use the following line as it is. It instructs Aloaha to load the previous stored bytearray into the viewer.
Call editor1.open_PDF(cstr("http://memory.pdf"))


 LoadFromMemDemo.zip (5,28 KB)

Aloaha Software / Knowledge Base / PDF Form Saver SDK / PDF Forms OCX / Load PDF from Memory
create PDF Software

Load PDF from Memory

Any questions?
Aloaha Software - Load PDF from Memory
ProductsKnowledge BaseShopSupportPress
Deutsche VersionEnglish version