version property

PdfVersion get version

Gets the version of the PDF document.

//Create a PDF document instance.
PdfDocument document = PdfDocument();
//Set the PDF document version.
document.fileStructure.version = PdfVersion.version1_7;
//Create page and draw text.
document.pages.add().graphics.drawString(
    'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 12),
    brush: PdfBrushes.black, bounds: Rect.fromLTWH(0, 0, 0, 0));
//Save and dispose document.
List<int> bytes = await document.save();
document.dispose();

Implementation

PdfVersion get version => _version;
set version (PdfVersion value)

Sets the version of the PDF document.

//Create a PDF document instance.
PdfDocument document = PdfDocument();
//Set the PDF document version.
document.fileStructure.version = PdfVersion.version1_7;
//Create page and draw text.
document.pages.add().graphics.drawString(
    'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 12),
    brush: PdfBrushes.black, bounds: Rect.fromLTWH(0, 0, 0, 0));
//Save and dispose document.
List<int> bytes = await document.save();
document.dispose();

Implementation

set version(PdfVersion value) {
  _version = value;
  if (value.index <= PdfVersion.version1_3.index) {
    crossReferenceType = PdfCrossReferenceType.crossReferenceTable;
  }
}