Skip to Content

Can APDFL open PDF documents from a memory stream (file in memory) rather than from disk?

Estimated Reading Time: 1 Minutes

The PDF Library communicates use the ASFileSys file system. While it cannot write to a memory buffer directly, it can read and write files in memory as long as an in-memory file system is being used.

An ASFileSys is a collection of functions that implements file system services, such as:

  • opening files
  • deleting files
  • reading data from a file
  • writing data to a file

Each ASFileSys provides these services for one class of devices. Adobe Acrobat and the Adobe PDF Library both offer a built-in ASFileSys that serves the platform's native file system.

Acrobat plug-ins or Adobe PDF Library applications may create additional ASFileSys objects to serve other file systems, such as an in-memory file system. Review the AlternateFileSystem sample program for an example of an alternate file system. This sample program is a basic implementation of an ASFileSys structure, for use in Adobe PDF Library applications which can accept and ASFileSys. It does not read and write to memory, but provides the framework for the functions that are needed.

The Java and .NET interface offers built in support for reading or writing PDF documents from memory streams. The .NET interface uses System.IO.Stream, and the Java interface, javax.imageio.stream. You do not need to implement your own ASFileSys.

Can APDFL open PDF documents from a memory stream (file in memory) rather than from disk?
  • COMMENT

  • Get notified when new articles are added to the knowledge base.