David PHAM-VAN

Reset graphic context

... ... @@ -321,6 +321,10 @@ class PdfGraphics {
buf.putString(']TJ ET\n');
}
void reset() {
buf.putString('0 Tr\n');
}
/// Sets the color for drawing
void setColor(PdfColor color) {
setFillColor(color);
... ...
... ... @@ -212,8 +212,9 @@ class MultiPage extends Page {
pageFormat: pageFormat,
index: index == null ? null : (index++),
);
context =
baseContext.copyWith(page: pdfPage, canvas: pdfPage.getGraphics());
final canvas = pdfPage.getGraphics();
canvas.reset();
context = baseContext.copyWith(page: pdfPage, canvas: canvas);
assert(() {
if (Document.debug) {
... ...
... ... @@ -111,6 +111,7 @@ class Page {
void postProcess(Document document) {
final canvas = _pdfPage.getGraphics();
canvas.reset();
final _margin = margin;
var constraints = mustRotate
? BoxConstraints(
... ...