Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure the code really generates the PAGE_SIZE specified. #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

teesid
Copy link

@teesid teesid commented Sep 5, 2023

The line start_new_page size: PAGE_SIZE, layout: :portrait, margin: margin does indeed set the page size for a new page. However, the initial Prawn::Document.generate call determines the default settings for the entire document, including the page size for the first page.

If the start_new_page method is used later in the code (after the first page has already been created with the default settings), it will apply the PAGE_SIZE setting to the new pages added after the initial page. This means the first page would still be in the default size (LETTER), while subsequent pages would be in A4 size.

One way to tell the page size is with the pdfinfo command line.

The line start_new_page size: PAGE_SIZE, layout: :portrait, margin: margin does indeed set the page size for a new page. However, the initial Prawn::Document.generate call determines the default settings for the entire document, including the page size for the first page.

If the start_new_page method is used later in the code (after the first page has already been created with the default settings), it will apply the PAGE_SIZE setting to the new pages added after the initial page. This means the first page would still be in the default size (LETTER), while subsequent pages would be in A4 size.
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.

1 participant