David PHAM-VAN

PdfPage.pageFormat is final

@@ -20,7 +20,7 @@ part of pdf; @@ -20,7 +20,7 @@ part of pdf;
20 20
21 class PdfPage extends PdfObject { 21 class PdfPage extends PdfObject {
22 /// This is this page format, ie the size of the page, margins, and rotation 22 /// This is this page format, ie the size of the page, margins, and rotation
23 - PdfPageFormat pageFormat; 23 + final PdfPageFormat pageFormat;
24 24
25 /// This holds the contents of the page. 25 /// This holds the contents of the page.
26 List<PdfObjectStream> contents = []; 26 List<PdfObjectStream> contents = [];
@@ -45,10 +45,9 @@ class PdfPage extends PdfObject { @@ -45,10 +45,9 @@ class PdfPage extends PdfObject {
45 /// 45 ///
46 /// @param pdfDocument Document 46 /// @param pdfDocument Document
47 /// @param pageFormat [PdfPageFormat] describing the page size 47 /// @param pageFormat [PdfPageFormat] describing the page size
48 - PdfPage(PdfDocument pdfDocument, {this.pageFormat}) 48 + PdfPage(PdfDocument pdfDocument, {this.pageFormat = PdfPageFormat.a4})
49 : super(pdfDocument, "/Page") { 49 : super(pdfDocument, "/Page") {
50 pdfDocument.pdfPageList.pages.add(this); 50 pdfDocument.pdfPageList.pages.add(this);
51 - if (pageFormat == null) pageFormat = PdfPageFormat.a4;  
52 } 51 }
53 52
54 /// This returns a [PdfGraphics] object, which can then be used to render 53 /// This returns a [PdfGraphics] object, which can then be used to render