Skip to content

Set canvas size on addPage and don't destroy PDF surface on width/height change#2552

Open
kayahr wants to merge 1 commit intoAutomattic:masterfrom
kayahr:bugfix/2538-update-pdf-canvas-size-on-addpage
Open

Set canvas size on addPage and don't destroy PDF surface on width/height change#2552
kayahr wants to merge 1 commit intoAutomattic:masterfrom
kayahr:bugfix/2538-update-pdf-canvas-size-on-addpage

Conversation

@kayahr
Copy link
Contributor

@kayahr kayahr commented Feb 5, 2026

Changes explained:

  • Moved cairo_pdf_surface_set_size from addPage method to setSize method of PDF backend. addPage now calls this setSize method so the canvas size is also changed.
  • Changing width/height on canvas now calls the same setSize method so in PDF backend this also affects the PDF surface size.
  • Changing width/height on canvas no longer destroyes the PDF surface, it only changes the page size and resets the context.

Fixes #2538

  • Have you updated CHANGELOG.md?

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.

Canvas size is not updated when adding PDF page with different size than initial canvas size

1 participant