How to print pdf with additional offset?

Viewed 19

I have an api where I get an pdf as Uint8List. Now I want to Print this pdf with an additional offset.

Till now I use the printing package from pub.dev, which is working fine for the printing part. But even so it has a format parameter where I can set a margin, it is ignored.

PdfPageFormat stdFormat = PdfPageFormat.standard;
PdfPageFormat format = PdfPageFormat(stdFormat.width,stdFormat.height,
  marginTop: marginTop,
  marginLeft: marginLeft,
  marginBottom: stdFormat.marginBottom,
  marginRight: stdFormat.marginRight,
);
Printing.directPrintPdf(
  printer: printer,
  format: format,
  onLayout: (_) => bytes,
);

So my question: Is there a way to convert an pdf as Uint8List to a Widget give it a padding and convert it back to a Uint8List? Or is there a better way to print a pdf with an offset?

0 Answers
Related