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

endFormObject with duplicate id leaves jsPDF in a bad state #3127

Closed
HackbrettXXX opened this issue Mar 29, 2021 · 4 comments
Closed

endFormObject with duplicate id leaves jsPDF in a bad state #3127

HackbrettXXX opened this issue Mar 29, 2021 · 4 comments

Comments

@HackbrettXXX
Copy link
Collaborator

HackbrettXXX commented Mar 29, 2021

https://github.com/MrRio/jsPDF/blob/e988a043bc6a26957798ce48e6f12e0b96b8b803/src/jspdf.js#L5690-L5707

The early exit must also pop the stack.

See also the original issue: yWorks/svg2pdf.js#166

@Qendolin
Copy link
Contributor

Sounds like it can be fixed very easily.

Replace

if (renderTargetMap[key]) return; 

With

if (renderTargetMap[key]) {
  renderTargetStack.pop().restore(); 
  return:
}

I'ld love for this to get fixed very soon, it's a very problematic issue.

@HackbrettXXX
Copy link
Collaborator Author

@Qendolin could you prepare a pull request? Would be awesome.

Qendolin added a commit to Qendolin/jsPDF that referenced this issue Apr 15, 2021
@Qendolin
Copy link
Contributor

I'll try

@HackbrettXXX
Copy link
Collaborator Author

Fixed in #3135.

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

No branches or pull requests

2 participants