-
Notifications
You must be signed in to change notification settings - Fork 185
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
Printing with Chrome on a Mac / default settings -> words run off page on US letter #270
Comments
The PDF uses the paper size of "A4, Portrait (8.26 × 11.69 inch)". On a sheet of paper with this size, the margins will appear correctly. The issue is that our lab printer in the U.S. uses "letter" paper (8.50 × 11.00 inch). This page visualizes the size difference: If we switch to letter, then A4 paper will have the sides cutoff. I can imagine a couple options:
We've previously struggled with this issue in #105 and #107. In a535f7b, we switched to letter size, but this is no longer part of the default CSS: rootstock/build/themes/default.html Lines 485 to 489 in 631b8a2
So I guess athenapdf is defaulting to A4. |
I think it makes more sense to specify a default size in whatever is actually doing the printing, rather than in the CSS which is usually harder to change. Thus I don't think we should hard code it into the CSS. Two additional half measures we discussed in person:
Where would we do this in a place that is obvious and useful but not distracting where it is irrelevant.
This might lead to hard to troubleshoot issues where users don't know why their margins aren't square. It's also sort of a dirty workaround, and not an actual solution. I think the true solution is using my 1) above, and somehow making sure in print dialogs that "fit to page" is always selected. |
Supporting print configuration through the command line, whether via an environment variable used by |
I agree. The reason being is that now if someone prints the HTML from their browser, they can print to whatever page size their printer uses / the default for their locale. There is no issue currently when users print from HTML. The issue occurs when users print
athenapdf has a But the main problem is that the person who is printing the PDF manuscript is rarely the one who is configuring |
That is also true for authors who generate a PDF manuscript from LaTeX. I don't see it as a big problem if the person who runs |
Closes manubot#270 The existence of two common pagesizes for physical paper, A4 and Letter, creates user confusion. Sometimes users print a PDF with A4 dimensions onto Letter paper and do not use the "scale to fit" printer setting. This leads to truncated text at the bottom of the page. Ultimately, it is not a Manubot issue, but confuses Manubot users nonetheless. When exporting the HTML to PDF Manubot uses an A4 pagesize, which while less common in the U.S. is an international standard. This commit explicitly specifies the default behavior, such that there is no functional change. However, by specifying the pagesize, its more clear to Manubot users where pagesize gets set. This will hopefully spare users extra debugging. If manuscript viewers would like to export to a pagesize that is different from the one used by manuscript.pdf, the recommendation is for them to print the HTML page to PDF from their browser and specify the desired page size there. For this reason, our CSS style does not specify a default page size, but instead just a margin. athenapdf --pagesize <size> page size of the generated PDF (default: A4, values: A3|A4|A5|Legal|Letter|Tabloid) https://github.com/arachnys/athenapdf/blob/bf3d5d0070b079bc38f76f56aeb2ca09f3b3454c/cli/src/athenapdf.js#L39
See #272. I don't use an environment variable because at this point it's probably easier to change just the one line. General advice to readersIf you are printing a manuscript whose PDF uses a different page size than your physical paper, either:
|
Merges #272 Closes #270 The existence of two common pagesizes for physical paper, A4 and Letter, creates user confusion. Sometimes users print a PDF with A4 dimensions onto Letter paper and do not use the "scale to fit" printer setting. This leads to truncated text at the bottom of the page. Ultimately, it is not a Manubot issue, but confuses Manubot users nonetheless. When exporting the HTML to PDF, Manubot uses an A4 pagesize, which while less common in the U.S. is an international standard. This commit explicitly specifies the default behavior, such that there is no functional change. However, by specifying the pagesize, its more clear to Manubot users where pagesize gets set. This will hopefully spare users of some debugging. If manuscript viewers would like to export to a pagesize that is different from the one used by manuscript.pdf, the recommendation is for them to print the HTML page to PDF from their browser and specify the desired page size there. For this reason, our CSS style does not specify a default page size, but instead just a margin. Documentation of the relevant options: > athenapdf --pagesize <size> > page size of the generated PDF (default: A4, values: A3|A4|A5|Legal|Letter|Tabloid) We did not update the WeasyPrint build command because: > Currently, WeasyPrint does not provide support for adjusting page size or > document margins via command-line flags.
This build is based on 6859ada. This commit was created by the following Travis CI build and job: https://travis-ci.com/manubot/rootstock/builds/131569546 https://travis-ci.com/manubot/rootstock/jobs/244832656 The full commit message that triggered this build is copied below: Specify --pagesize=A4 during PDF export (clarifies default) Merges #272 Closes #270 The existence of two common pagesizes for physical paper, A4 and Letter, creates user confusion. Sometimes users print a PDF with A4 dimensions onto Letter paper and do not use the "scale to fit" printer setting. This leads to truncated text at the bottom of the page. Ultimately, it is not a Manubot issue, but confuses Manubot users nonetheless. When exporting the HTML to PDF, Manubot uses an A4 pagesize, which while less common in the U.S. is an international standard. This commit explicitly specifies the default behavior, such that there is no functional change. However, by specifying the pagesize, its more clear to Manubot users where pagesize gets set. This will hopefully spare users of some debugging. If manuscript viewers would like to export to a pagesize that is different from the one used by manuscript.pdf, the recommendation is for them to print the HTML page to PDF from their browser and specify the desired page size there. For this reason, our CSS style does not specify a default page size, but instead just a margin. Documentation of the relevant options: > athenapdf --pagesize <size> > page size of the generated PDF (default: A4, values: A3|A4|A5|Legal|Letter|Tabloid) We did not update the WeasyPrint build command because: > Currently, WeasyPrint does not provide support for adjusting page size or > document margins via command-line flags.
This build is based on 6859ada. This commit was created by the following Travis CI build and job: https://travis-ci.com/manubot/rootstock/builds/131569546 https://travis-ci.com/manubot/rootstock/jobs/244832656 The full commit message that triggered this build is copied below: Specify --pagesize=A4 during PDF export (clarifies default) Merges #272 Closes #270 The existence of two common pagesizes for physical paper, A4 and Letter, creates user confusion. Sometimes users print a PDF with A4 dimensions onto Letter paper and do not use the "scale to fit" printer setting. This leads to truncated text at the bottom of the page. Ultimately, it is not a Manubot issue, but confuses Manubot users nonetheless. When exporting the HTML to PDF, Manubot uses an A4 pagesize, which while less common in the U.S. is an international standard. This commit explicitly specifies the default behavior, such that there is no functional change. However, by specifying the pagesize, its more clear to Manubot users where pagesize gets set. This will hopefully spare users of some debugging. If manuscript viewers would like to export to a pagesize that is different from the one used by manuscript.pdf, the recommendation is for them to print the HTML page to PDF from their browser and specify the desired page size there. For this reason, our CSS style does not specify a default page size, but instead just a margin. Documentation of the relevant options: > athenapdf --pagesize <size> > page size of the generated PDF (default: A4, values: A3|A4|A5|Legal|Letter|Tabloid) We did not update the WeasyPrint build command because: > Currently, WeasyPrint does not provide support for adjusting page size or > document margins via command-line flags.
Merges manubot/rootstock#272 Closes manubot/rootstock#270 The existence of two common pagesizes for physical paper, A4 and Letter, creates user confusion. Sometimes users print a PDF with A4 dimensions onto Letter paper and do not use the "scale to fit" printer setting. This leads to truncated text at the bottom of the page. Ultimately, it is not a Manubot issue, but confuses Manubot users nonetheless. When exporting the HTML to PDF, Manubot uses an A4 pagesize, which while less common in the U.S. is an international standard. This commit explicitly specifies the default behavior, such that there is no functional change. However, by specifying the pagesize, its more clear to Manubot users where pagesize gets set. This will hopefully spare users of some debugging. If manuscript viewers would like to export to a pagesize that is different from the one used by manuscript.pdf, the recommendation is for them to print the HTML page to PDF from their browser and specify the desired page size there. For this reason, our CSS style does not specify a default page size, but instead just a margin. Documentation of the relevant options: > athenapdf --pagesize <size> > page size of the generated PDF (default: A4, values: A3|A4|A5|Legal|Letter|Tabloid) We did not update the WeasyPrint build command because: > Currently, WeasyPrint does not provide support for adjusting page size or > document margins via command-line flags.
Merges manubot/rootstock#272 Closes manubot/rootstock#270 The existence of two common pagesizes for physical paper, A4 and Letter, creates user confusion. Sometimes users print a PDF with A4 dimensions onto Letter paper and do not use the "scale to fit" printer setting. This leads to truncated text at the bottom of the page. Ultimately, it is not a Manubot issue, but confuses Manubot users nonetheless. When exporting the HTML to PDF, Manubot uses an A4 pagesize, which while less common in the U.S. is an international standard. This commit explicitly specifies the default behavior, such that there is no functional change. However, by specifying the pagesize, its more clear to Manubot users where pagesize gets set. This will hopefully spare users of some debugging. If manuscript viewers would like to export to a pagesize that is different from the one used by manuscript.pdf, the recommendation is for them to print the HTML page to PDF from their browser and specify the desired page size there. For this reason, our CSS style does not specify a default page size, but instead just a margin. Documentation of the relevant options: > athenapdf --pagesize <size> > page size of the generated PDF (default: A4, values: A3|A4|A5|Legal|Letter|Tabloid) We did not update the WeasyPrint build command because: > Currently, WeasyPrint does not provide support for adjusting page size or > document margins via command-line flags.
Printing the PDF generated at https://greenelab.github.io/biopriors-review/v/7e8a3a2c7f58bf8fee3c1547870f54f98141fdb1/manuscript.pdf from Chrome on a mac leads to text that runs off the page.
This isn't apparent before the print dialog in chrome:
The text was updated successfully, but these errors were encountered: