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

Form Fields Not Rendering in Password-Protected PDF Using react-pdf #1898

Open
4 tasks done
snrthn opened this issue Oct 13, 2024 · 1 comment
Open
4 tasks done

Form Fields Not Rendering in Password-Protected PDF Using react-pdf #1898

snrthn opened this issue Oct 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@snrthn
Copy link

snrthn commented Oct 13, 2024

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

I am using react-pdf to render a password-protected PDF. While the main content is displayed correctly after providing the correct password, the form fields within the PDF document are not being rendered. These fields appear blank or are missing entirely, even though the rest of the document loads without issues. I suspect this might be an issue with how react-pdf or pdf.js handles certain types of form fields or encryption.

Steps to reproduce

  1. This is PDF file url: https://s3-hnapuhdd-cdn.didistatic.com/freight-h5/freight-h5/operation/cwwazbfn3Fj2.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKDD00000000000ISN17K4STMXMZJJ%2F20241013%2Fhnapuhdd%2Fs3%2Faws4_request&X-Amz-Date=20241013T172442Z&X-Amz-Expires=600&X-Amz-SignedHeaders=host&X-Amz-Signature=1bf7091481c0c741d9b41c1cc828962b1db3df076dd1bc5d4669726b47cc4151

  2. Use the following code snippet to render the PDF in react-pdf:
    https://code.meideng.dev/1728840893678955

  3. Render the component in your application.

  4. Notice that the form fields within the document are missing or blank, while the rest of the content renders correctly.

Expected behavior

I expect the form fields (such as input fields, dropdowns, checkboxes, etc.) to be displayed and rendered correctly, just like the other text and images in the document. These fields should not be blank or missing.

Actual behavior

Notice that the form fields within the document are missing or blank, while the rest of the content renders correctly
Normal
Error

Additional information

This is an example pdf file.
天际LTWA35K16MS210008.pdf

Environment

  • Browser (if applicable): e.g. chrome, safari]
  • React-PDF version: All
  • React version: 17.0.2
  • Bundler name and version (if applicable):
@snrthn snrthn added the bug Something isn't working label Oct 13, 2024
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

2 participants
@snrthn and others