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

if editable,cant save; button click event not available #1853

Open
4 tasks done
scottt617 opened this issue Aug 6, 2024 · 0 comments
Open
4 tasks done

if editable,cant save; button click event not available #1853

scottt617 opened this issue Aug 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

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

When the pdf is editable, it can be edited normally, but you can't save the current edited content to the pdf!
When there are some clickable buttons in the pdf (e.g. download, reset, etc.), the button function fails.

viewed some pdfjs code, it looks like the following code does not take effect, did not find a place to control this parameter enableScripting

render() {
    const container = super.render();
    container.classList.add('buttonWidgetAnnotation', 'pushButton');
    const linkElement = container.lastChild;
    if (this.enableScripting && this.hasJSActions && linkElement) {
      this._setDefaultPropertiesFromJS(linkElement);
      linkElement.addEventListener('updatefromsandbox', (jsEvent) => {
        this._dispatchEventFromSandbox({}, jsEvent);
      });
    }

Steps to reproduce

open a PDF file with described function

sorry, cant provide the file

Expected behavior

1.can save the edited msg
2.can click button and trigger event

Actual behavior

1.cant save the edited msg
2.click button cant trigger event

Additional information

No response

Environment

  • Browser (if applicable):
  • React-PDF version:
  • React version:
  • Bundler name and version (if applicable):
@scottt617 scottt617 added the bug Something isn't working label Aug 6, 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

1 participant