Particular PDF only rendering the top right quarter of the PDF (on iOS and web at least)
To Reproduce
Code snippet to reproduce the behavior:
final pdf = pw.Document.load(
pdf_crypto.PdfDocumentParser(bytes),
);
Uint8List pdfBytes = await pdf.save();
Expected behavior
Full page of the PDF is converted to a new PDF
Screenshots
It seems like the issue is with the parsing of only the 2 and 3rd index of MediaBox within pdf_cryptodocument.dartmergeDocument() , but the code below doesn't solve the issue for some reason
double lowerLeftX = (mb.values[0] as PdfNum).value.toDouble().abs();
double lowerLeftY = (mb.values[1] as PdfNum).value.toDouble().abs();
double upperRightX = (mb.values[2] as PdfNum).value.toDouble().abs();
double upperRightY = (mb.values[3] as PdfNum).value.toDouble().abs();
format = PdfPageFormat(
lowerLeftX + upperRightX,
lowerLeftY + upperRightY,
);
Inspecting the contents of the pdf it looks like the CropBox and MediaBox 0 and 1 index are negative values
Describe the bug
Particular PDF only rendering the top right quarter of the PDF (on iOS and web at least)
To Reproduce Code snippet to reproduce the behavior:
Expected behavior
Full page of the PDF is converted to a new PDF
Screenshots
It seems like the issue is with the parsing of only the 2 and 3rd index of MediaBox within
pdf_crypto
document.dart
mergeDocument()
, but the code below doesn't solve the issue for some reasonInspecting the contents of the pdf it looks like the CropBox and MediaBox 0 and 1 index are negative values
Full image correctly rasterized (edited for confidentiality)![full_image](https://github.com/DavBfr/dart_pdf/assets/68708352/df2c1a29-92a3-44ca-af2f-09b72ce9e687)
Flutter Doctor
Desktop (please complete the following information):
Smartphone (please complete the following information):