ngx-extended-pdf-viewer icon indicating copy to clipboard operation
ngx-extended-pdf-viewer copied to clipboard

Form field placements off

Open luke-rogers opened this issue 1 year ago • 3 comments

Describe the bug Open the attached PDF and notice the form field placements are off:

  • Fields slightly overlap
  • Radios are off centre

The attached PDF renders perfectly when tested on the Mozilla viewer.

Version info 20.0.2

Demo PDF file Hot Works Permit Template.pdf

luke-rogers avatar May 22 '24 16:05 luke-rogers

Looks like a CSS problem. Do you know whether it looked better in previous versions?

stephanrauh avatar May 22 '24 19:05 stephanrauh

We were on v18 before and it was fine. We jumped to v20 so can't say whether it's reproducible on v19.

Happy to test if that would be useful?

luke-rogers avatar May 22 '24 19:05 luke-rogers

No, don't bother. Your information already helps me to find the missing CSS. Now I know I don't have to dig infinitely into the past.

stephanrauh avatar May 22 '24 19:05 stephanrauh

I think I've managed to track it down to this line of CSS.

Turn it off and the field returns to what I would expect. image

luke-rogers avatar May 24 '24 15:05 luke-rogers

Now that's crazy: pdf.js is using both box-sizing models. I'd call it an antipattern. Quite surprising given that the quality of the library is generally exceptionally good.

Be that as it may, I've applied a patch. It might be temporary - I hope I can find a better solution - but for now it solves both your issue and #2282.

Your bug fix has landed with version 20.1.0.

Enjoy! Stephan

stephanrauh avatar May 24 '24 19:05 stephanrauh

The fix is working great - thanks for the quick turn around!

luke-rogers avatar May 26 '24 09:05 luke-rogers