PDF4Java Reference Documentation
com.o2sol.pdf4java.graphics Package / PDFPageCanvas Class / compress Method
Collapse All Expand All
In This Topic

compress Method
In This Topic
Compresses the page graphic content.
Call this method to compress the graphic content and reduce memory usage. This method compresses the current graphic content but it leaves the graphics open so new content can be still added. If you are creating pages with heavy vector graphics, such as maps, you can call this method multiple times, after fragments of the page have been drawn in order to reduce the in-memory size of the graphic content. What the page content has been fully created call the method to compress the last fragment and close the page content.
Syntax

    public void compress()

See Also

#### Reference

PDFPageCanvas Class
PDFPageCanvas Members

© 2025 O2 Solutions All Rights Reserved.

Send comments on this topic.