Skip to Content

Can I determine the size of a PDF document before writing it?

Estimated Reading Time: 1 Minutes

The Adobe PDF Library cannot provide a way to estimate the final size of an output PDF document before an application actually writes that PDF document to a disk. Also, any document using subset fonts would require some undetermined amount of extra storage in the output file for those fonts, and the subsets cannot be created until the document is created.

An application could write the file to memory first, rather than to a disk, and then read the size of the memory buffer to estimate the final file size. However, this is not a very practical approach, as it requires a lot of memory to complete and may compromise the system performance.

Can I determine the size of a PDF document before writing it?
  • COMMENT