size property

Size get size

Gets the size of the canvas.

//Creates a new PDF document.
PdfDocument doc = PdfDocument();
//Create PDF graphics for the page.
PdfGraphics graphics = doc.pages.add().graphics;
//Draw string to PDF page graphics.
graphics.drawString(
    //Get the graphics canvas size.
    'Canvas size: ${graphics.size}',
    PdfStandardFont(PdfFontFamily.courier, 12));
//Saves the document.
List<int> bytes = doc.save();
//Dispose the document.
doc.dispose();

Implementation

Size get size => _canvasSize;