Skip to content

Better HTML to SVG, and lossless HTML to PDF via Typst#589

Open
Explosion-Scratch wants to merge 1 commit intop2r3:masterfrom
Explosion-Scratch:svg-typst-pdf
Open

Better HTML to SVG, and lossless HTML to PDF via Typst#589
Explosion-Scratch wants to merge 1 commit intop2r3:masterfrom
Explosion-Scratch:svg-typst-pdf

Conversation

@Explosion-Scratch
Copy link
Copy Markdown
Contributor

The HTML to SVG handler now uses this library to convert DOM to SVG (which works impressively well), then SVGs can be embedded into Typst to create vector PDFs!

@Explosion-Scratch
Copy link
Copy Markdown
Contributor Author

Here is what the demo word document turns into!

word (3).pdf

@Explosion-Scratch
Copy link
Copy Markdown
Contributor Author

This can also greatly improve #584 because it can then render to SVG -> PDF via this process.

Note: If #583 is merged then the process of EPUB directly to PDF should be preserved as EPUB -> HTML -> Typst (pandoc) -> PDF works much better in that case

This now works because our SVGs don't have foreignObjects because we're using the new htmlToSvg.ts
@Explosion-Scratch
Copy link
Copy Markdown
Contributor Author

I'm not sure why tests are failing - they work locally. Maybe a cache thing?

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.

1 participant