width property

double get width

Gets the width of the page.

//Create a PDF document.
PdfDocument document = PdfDocument();
//Get page width.
double width = document.pageSettings.width;
//Get page height.
double height = document.pageSettings.height;
//Create page and draw text.
document.pages.add().graphics.drawString(
    'Hello World!', PdfStandardFont(PdfFontFamily.helvetica, 12),
    brush: PdfBrushes.black, bounds: Rect.fromLTWH(0, 0, width, height));
//Save and dispose document.
List<int> bytes = await document.save();
document.dispose();

Implementation

double get width => _size.width;