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

Duplicated Annotation Layer - after update to version 9.0 #1837

Open
4 tasks done
karinaglf opened this issue Jun 27, 2024 · 4 comments
Open
4 tasks done

Duplicated Annotation Layer - after update to version 9.0 #1837

karinaglf opened this issue Jun 27, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@karinaglf
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

After upgrading to react-pdf 9.0.0, we have encountered an issue where some form field inputs seem to be displayed twice. This duplication results in incorrect rendering of these fields. It appears that hidden elements from the Annotation layer are being shown, causing this duplication. Please see the image below for reference.

screen

Steps to reproduce

  • Use react-pdf version 9.0.0.
  • Render a PDF document that includes textWidgetAnnotation elements.
  • Set Page props with renderAnnotationLayer to true and renderForms to false
  • Set the worker setup for legacy browser, as below:
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
	'pdfjs-dist/legacy/build/pdf.worker.min.mjs',
	import.meta.url,
).toString();

Expected behavior

  • Form fields and Annotation Layer should be rendered correctly.

Actual behavior

  • Rendering of elements with the textWidgetAnnotation class is off.
  • These elements are displayed in the viewer despite having the hidden attribute.
  • When renderForm is set to true, the duplication issue is resolved, but some form fields, such as checkboxes, appear with incorrect styles.

Additional information

No response

Environment

  • Browser (if applicable): Chrome, Firefox
  • React-PDF version: 9.0.0
  • React version: 16
  • Bundler name and version (if applicable): webpack v 5.92.1
@karinaglf karinaglf added the bug Something isn't working label Jun 27, 2024
@TangMichael
Copy link

TangMichael commented Jul 16, 2024

Updated our app to react-pdf v9.0.0 and I am getting the same issue. In my use case, the text input cannot be clicked as the annotation layer has a DOM element that prevents it from being clicked.

Any solution regarding this?

@TadasValaitiz
Copy link

I'm facing the same issue

@ajaykarthikr
Copy link

Apart from downgrading to v8, is there any available solution to this? I'm using v8 but that has a serious security vulnerability.

@GomesNayagam
Copy link

i do have the same problem, same content is repeating one w format and one w/o format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants