Skip to content

PDFPageCanvas

Namespace: O2S.Components.PDF4NET.Graphics

Defines the graphics surface of a PDF page.

public class PDFPageCanvas : PDFCanvas

Inheritance ObjectPDFCanvasPDFPageCanvas

Methods

BeginOptionalContentGroup(PDFOptionalContentBase)

Begins an optional content group in the page graphics.

public void BeginOptionalContentGroup(PDFOptionalContentBase optionalContent)

Parameters

optionalContent PDFOptionalContentBase
The group object associated with the graphics.

Remarks

Each call to BeginOptionalContentGroup must be paired with a call to PDFPageCanvas.EndOptionalContentGroup().
The page must be included in a document before creating optional content on it.


Clear()

Clears all graphic content from the page.

public void Clear()

Compress()

Compresses the page graphic content.

public void Compress()

Remarks

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 PDFCanvas.CompressAndClose() method to compress the last fragment and close the page content.


CompressAndClose()

Compresses the graphic content and closes the graphics surface.

public void CompressAndClose()

Remarks

Call this method to compress the graphic content and reduce memory usage. If this method is not called, the graphic content is stored uncompressed in the PDF file. After calling this method no more drawing is allowed on the graphics.


EndOptionalContentGroup()

Ends the active optional content group in the page graphics.

public void EndOptionalContentGroup()