David PHAM-VAN

Add a default page format constant

@@ -24,7 +24,7 @@ class PdfPage extends PdfObject { @@ -24,7 +24,7 @@ class PdfPage extends PdfObject {
24 /// 24 ///
25 /// @param pdfDocument Document 25 /// @param pdfDocument Document
26 /// @param pageFormat [PdfPageFormat] describing the page size 26 /// @param pageFormat [PdfPageFormat] describing the page size
27 - PdfPage(PdfDocument pdfDocument, {this.pageFormat = PdfPageFormat.a4}) 27 + PdfPage(PdfDocument pdfDocument, {this.pageFormat = PdfPageFormat.standard})
28 : super(pdfDocument, '/Page') { 28 : super(pdfDocument, '/Page') {
29 pdfDocument.pdfPageList.pages.add(this); 29 pdfDocument.pdfPageList.pages.add(this);
30 } 30 }
@@ -39,6 +39,8 @@ class PdfPageFormat { @@ -39,6 +39,8 @@ class PdfPageFormat {
39 static const PdfPageFormat legal = 39 static const PdfPageFormat legal =
40 PdfPageFormat(8.5 * inch, 14.0 * inch, marginAll: inch); 40 PdfPageFormat(8.5 * inch, 14.0 * inch, marginAll: inch);
41 41
  42 + static const PdfPageFormat standard = a4;
  43 +
42 static const double point = 1.0; 44 static const double point = 1.0;
43 static const double inch = 72.0; 45 static const double inch = 72.0;
44 static const double cm = inch / 2.54; 46 static const double cm = inch / 2.54;
@@ -64,7 +64,7 @@ typedef BuildListCallback = List<Widget> Function(Context context); @@ -64,7 +64,7 @@ typedef BuildListCallback = List<Widget> Function(Context context);
64 64
65 class Page extends BasePage { 65 class Page extends BasePage {
66 Page( 66 Page(
67 - {PdfPageFormat pageFormat = PdfPageFormat.a4, 67 + {PdfPageFormat pageFormat = PdfPageFormat.standard,
68 BuildCallback build, 68 BuildCallback build,
69 this.theme, 69 this.theme,
70 EdgeInsets margin}) 70 EdgeInsets margin})