Skip to content

ios: Add fitToPage parameter to scale PDF to fit paper#1917

Open
sjg20 wants to merge 1 commit into
DavBfr:masterfrom
sjg20:fix-ios-print-scaling
Open

ios: Add fitToPage parameter to scale PDF to fit paper#1917
sjg20 wants to merge 1 commit into
DavBfr:masterfrom
sjg20:fix-ios-print-scaling

Conversation

@sjg20

@sjg20 sjg20 commented Mar 8, 2026

Copy link
Copy Markdown

On iOS, CGContext.drawPDFPage renders at the PDF's native point size,
which often doesn't match the selected paper size, resulting in content
that only fills a fraction of the page.

Add an opt-in fitToPage parameter that scales the PDF to fit the paper
while preserving aspect ratio and centering the content. Thread the
parameter through the full stack: Dart API (layoutPdf/directPrintPdf)
-> platform interface -> method channel -> iOS PrintingPlugin ->
PrintJob.drawPage, where it conditionally applies the scaling transform.

Fixes #1317

On iOS, CGContext.drawPDFPage renders at the PDF's native point size,
which often doesn't match the selected paper size, resulting in content
that only fills a fraction of the page.

Add an opt-in fitToPage parameter that scales the PDF to fit the paper
while preserving aspect ratio and centering the content. Thread the
parameter through the full stack: Dart API (layoutPdf/directPrintPdf)
-> platform interface -> method channel -> iOS PrintingPlugin ->
PrintJob.drawPage, where it conditionally applies the scaling transform.
@sjg20 sjg20 force-pushed the fix-ios-print-scaling branch from a27a193 to 2110efa Compare March 16, 2026 12:23
@sjg20

sjg20 commented Mar 16, 2026

Copy link
Copy Markdown
Author

Fixed the failing checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Layout issue when printing on IOS

1 participant