identity-idp icon indicating copy to clipboard operation
identity-idp copied to clipboard

LG-7180: Fix printed appearance of Barcode

Open aduth opened this issue 2 years ago • 3 comments

Why: Since apparently table cell background colors are made transparent in default printing behavior, whereas cell border coloring is not.

Testing instructions:

  1. Go to http://localhost:3000
  2. Sign in
  3. Go to http://localhost:3000/verify
  4. Complete proofing flow up to document capture
  5. Use attention result test YAML document
  6. Click "Verify your ID in person"
  7. Complete in-person proofing flow
  8. Observe barcode is visible on "You're ready to verify" screen
  9. Print the barcode
  10. Observe barcode is visible and accurate

Screenshots:

Browser content (visually unchanged):

Before After
Screen Shot 2022-08-12 at 10 17 36 AM Screen Shot 2022-08-12 at 10 17 38 AM

Printed content:

Before After
Screen Shot 2022-08-12 at 10 17 14 AM Screen Shot 2022-08-12 at 10 17 25 AM

(the appearance in the preview seems to be affected by scaling)

aduth avatar Aug 12 '22 14:08 aduth

What about using SVG output from the barby gem?

zachmargolis avatar Aug 12 '22 16:08 zachmargolis

What about using SVG output from the barby gem?

We previously used the PNG printer, but switched to the table printer when using it also in email templates since neither data URI images nor embedded SVG have good support in email clients (more context at https://github.com/18F/identity-idp/pull/6580#discussion_r921157807).

We could consider switching how we render the barcode based on the context, but I was hoping to avoid maintaining support for multiple implementations.

aduth avatar Aug 12 '22 17:08 aduth

We could consider switching how we render the barcode based on the context, but I was hoping to avoid maintaining support for multiple implementations.

that seems reasonable, esp if we have to maintain the CSS styles for the emailed ones anyways

zachmargolis avatar Aug 12 '22 17:08 zachmargolis