toPdfRect method
Converts the bounds to a PDF-space rectangle for a given page.
Implementation
PdfRect toPdfRect(PdfPage page) {
if (coordinateSystem == PdfCoordinateSystem.pdf && rect != null) {
return rect!;
}
final tl = topLeft;
if (tl == null) {
throw StateError('Bounds top-left nao informados.');
}
// A conversão passa pelo transformador comum: a fórmula anterior só
// subtraía a altura da página, então errava a posição em página com caixa
// deslocada e em página rotacionada.
return PdfCoordinateTransformer.forPage(page).rectFromTopLeft(
left: tl.left,
top: tl.top,
width: tl.width,
height: tl.height,
);
}