stephanrauh / ngx-extended-pdf-viewer

A full-blown PDF viewer for Angular 16, 17, and beyond
https://pdfviewer.net
Apache License 2.0
450 stars 167 forks source link

Form field placements off #2343

Closed luke-rogers closed 1 month ago

luke-rogers commented 1 month ago

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

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

Version info 20.0.2

Demo PDF file Hot Works Permit Template.pdf

stephanrauh commented 1 month ago

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

luke-rogers commented 1 month ago

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?

stephanrauh commented 1 month ago

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.

luke-rogers commented 1 month ago

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
stephanrauh commented 1 month ago

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

luke-rogers commented 1 month ago

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