Skip to content

Conversation

@dsolankii
Copy link

Summary

  • add addXFA entry point to embed XFA payloads and toggle NeedRendering
  • normalize stream/array inputs, emit XFA packets during document build, and keep AcroForm fallbacks intact
  • add regression coverage and extend TypeScript typings for the new API

Testing

  • npm run build
  • npm run test-unit
  • npm run test-node
  • npm run test-amd
  • npm run test-esm
  • npm run test-globals
  • npm run test-typescript
  • npm run test-webworker

Closes #3886

(Friendly note: I’m participating in Hacktoberfest—thanks for tagging or merging!)

Copy link

@JDziurlaj JDziurlaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this! There is one typo that is causing issues, otherwise LGTM! (Looking back at the originating issue, the typo was mine! 😳)

" R"
);
if (scope.internal.acroformPlugin.needRendering === true) {
scope.internal.write("/NeedRendering true");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be NeedsRendering (plural). Check and fix throughout PR.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that! I’ve updated the code/tests to use /NeedsRendering and pushed the change.

@dsolankii dsolankii force-pushed the feature/add-xfa-support branch from 8b46a68 to 58511ce Compare October 27, 2025 05:53
Copy link
Collaborator

@HackbrettXXX HackbrettXXX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR. I'm no expert regarding XFA, but the code generally looks good. Could you add a test case that creates/compares a PDF with a reference, so I can check if the created PDF works.

internal: null,
isInitialized: false
isInitialized: false,
needRendering: false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also rename this field to "needsRendering"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Add XFA Support to jsPDF

3 participants