PdfDocument class Null safety

This class is the base of the Pdf generator. A PdfDocument class is created for a document, and each page, object, annotation, etc is added to the document. Once complete, the document can be written to a Stream, and the Pdf document's internal structures are kept in sync.


PdfDocument({PdfPageMode pageMode = PdfPageMode.none, DeflateCallback? deflate, bool compress = true, PdfVersion version = PdfVersion.pdf_1_4})
This creates a Pdf document
PdfDocument.load(PdfDocumentParserBase? prev, {PdfPageMode pageMode = PdfPageMode.none, DeflateCallback? deflate, bool compress = true})


catalog ↔ PdfCatalog
This is the Catalog object, which is required by each Pdf Document
read / write
defaultOutlineBorder ↔ PdfObject<PdfDataType>?
This holds a PdfObject describing the default border for annotations. It's only used when the document is being written.
read / write
deflate DeflateCallback?
Callback to compress the stream in the pdf file. Use deflate: zlib.encode if using dart:io No compression by default
documentID Uint8List
Generates the document ID
encryption PdfEncryption?
Object used to encrypt the document
read / write
fonts Set<PdfFont>
This holds the current fonts
graphicStates PdfGraphicStates
Graphic states for opacity and transfer modes
hasGraphicStates bool
This document has at least one graphic state
hashCode int
The hash code for this object. [...]
read-only, inherited
info PdfInfo?
This is the info object. Although this is an optional object, we include it.
@Deprecated('This can safely be removed.'), read / write
objects Set<PdfObject<PdfDataType>>
This vector contains each indirect object within the document.
objser int
outline PdfOutline
The root outline
pdfNames ↔ PdfNames
The name dictionary
read / write
pdfPageList ↔ PdfPageList
This is the Pages object, which is required by each Pdf Document
read / write
prev PdfDocumentParserBase?
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
sign PdfSignature?
Object used to sign the document
read / write
version PdfVersion
PDF version to generate
versionString String
The PDF specification version


genSerial() int
Creates a new serial number
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
page(int page) PdfPage?
This returns a specific page. It's used mainly when using a Serialized template file.
save() Future<Uint8List>
Generate the PDF document as a memory file
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]