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

Break pages up when long enough on tally report #5290

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

carolinemodic
Copy link
Contributor

Overview

Fixes #5263

On the all bubble ballot the pdf we generate is so long that canvas seg faults when converting to an image. To avoid this problem we can just break up the page when it streches beyond 100 inches, which will never happen in anything but extreme situations. If the content height is longer then a standard paper length but shorter then 100 inches we will still truncate the length of the report to the length of the content (and we will never make it smaller then a standard page).

Note this change should really only affect the all bubble ballot.

Demo Video or Screenshot

PDF of printed all bubble polls open report
print-job-2024-08-21T00:36:50.587Z.pdf

Note the contest starts on the second page because of an unrelated annoyance with how tally reports render for this election.

Testing Plan

Used mock printer and inspected pdfs, ran tests and saw them still pass, added new test.

Checklist

  • I have added logging where appropriate to any new user actions, system updates such as file reads or storage writes, or errors introduced.
  • I have added a screenshot and/or video to this PR to demo the change
  • I have added the "user_facing_change" label to this PR to automate an announcement in #machine-product-updates

@carolinemodic carolinemodic requested a review from adghayes August 21, 2024 18:48
Copy link
Collaborator

@adghayes adghayes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! See one comment.

I'm glad we're fixing the all bubble ballot, but I do hope that we can eventually fix this with #4835 rather than building around canvas's specific limitations.

@@ -24,7 +24,7 @@ export const PAPER_DIMENSIONS = {
// their own, followed by a mostly blank line. This causes stripes in the printed page.
Bmd150: { width: 7.975, height: 13.25 },
Letter: { width: 8.5, height: 11 },
LetterRoll: { width: 8.5, height: Infinity },
LetterRoll: { width: 8.5, height: 100 }, // If we make the height infinite the canvas conversion to an image can seg fault. Break into pages beyond 100inches.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space between "100" and "inches"

@carolinemodic carolinemodic merged commit 4640b66 into main Aug 22, 2024
62 checks passed
@carolinemodic carolinemodic deleted the caro/printer_debug_logging branch August 22, 2024 16:39
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.

VxScan: Scanner crashes on polls open for accuracy test definition
2 participants