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

When combining SVGCanvas with pdf.js render function, its generates an invalid SVG in some situations #980

Closed
JoelBrenstrum opened this issue Jan 28, 2025 · 2 comments · Fixed by #986 or #990
Assignees
Labels
bug Something isn't working

Comments

@JoelBrenstrum
Copy link

When generating an SVG image from a pdf page using pdf.js. if the PDF contains images within the page vectors it results in an invalid SVG

Image

note the midding </g> at the end

exact repro steps are unknown and I'm unable to share the PDF document as its private.

If i manually close the g the SVG is valid and renders correctly.

@JoelBrenstrum JoelBrenstrum changed the title When combining and SVGCanvas with pdf.js render function its generates an invalid svg in some situations When combining SVGCanvas with pdf.js render function, its generates an invalid SVG in some situations Jan 28, 2025
@Brooooooklyn Brooooooklyn added the bug Something isn't working label Jan 29, 2025
@Brooooooklyn Brooooooklyn self-assigned this Feb 2, 2025
@JoelBrenstrum
Copy link
Author

@Brooooooklyn Awesome thank you for the quick fix!

@JoelBrenstrum
Copy link
Author

@Brooooooklyn Can we reopen this? I'm still getting the issue.

I've prepared a repro of the issue here:
https://github.com/JoelBrenstrum/stackblitz-starters-xiymu9vu

You will have to clone/ or open ina github codespace as it requires node 20.16 and stackblitz doesn't have support for this.

Then run npm run go to get an output.svg in the project root. You can see its broken

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
2 participants