Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Annotations do not render correctly and miss styling #1938

Open
4 tasks done
tb-viktor opened this issue Jan 23, 2025 · 0 comments
Open
4 tasks done

Annotations do not render correctly and miss styling #1938

tb-viktor opened this issue Jan 23, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@tb-viktor
Copy link

Before you start - checklist

  • I followed instructions in documentation written for my React-PDF version
  • I have checked if this bug is not already reported
  • I have checked if an issue is not listed in Known issues
  • If I have a problem with PDF rendering, I checked if my PDF renders properly in PDF.js demo

Description

Hey guys,

We're having some problems getting annotations to render correctly. They are created using a Python library called pypdf as FreeText and contain some styling, and should look like this:

Image

The library renders them as:

Image

You can noticed the border, font size and background are missing in the first annotation, and the color is wrong in the second one.

We've checked a couple of PDF viewers and got mixed results - some do not render them at all, some render like the library does, and others render them correctly (for example PDF-XChange, https://smallpdf.com/edit-pdf). I get the impression this is a broader issue with PDF readers.

Any ideas how we can get it to render correctly with react-pdf?

Steps to reproduce

Load the file: annotations_test.pdf

Note: If you are immediately opening the file in the browser's PDF viewer - Chrome renders nothing, Firefox renders like react-pdf does.

Expected behavior

Render annotations with the provided styling.

Actual behavior

The annotations show, but miss almost all of the styling. console.logging the annotations via onGetAnnotationsSuccess shows that almost all properties are null:

Image

Additional information

No response

Environment

  • Browser (if applicable):
  • React-PDF version:
  • React version:
  • Bundler name and version (if applicable):
@tb-viktor tb-viktor added the bug Something isn't working label Jan 23, 2025
@tb-viktor tb-viktor changed the title Annotation do not render correctly and miss styling Annotations do not render correctly and miss styling Jan 23, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant