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

Expose function to directly convert SVG string into react-pdf nodes #552

Open
danvim opened this issue Jan 24, 2025 · 2 comments
Open

Expose function to directly convert SVG string into react-pdf nodes #552

danvim opened this issue Jan 24, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@danvim
Copy link

danvim commented Jan 24, 2025

Clear and concise description of the problem

Currently, The library seems to only accept taking in a React svg tree as input, but proceeds to serialize it into string anyway. Would it be more beneficial if it also exposes a method that accepts an input of an svg string instead?

Suggested solution

Split webSvgToPdfSvg into reactSvgToPdfSvg that accepts ReactElement as input, which in turns call svgXmlToPdfSvg that accepts string as input, exposing the svgXmlToPdfSvg function.

Additional context

No response

@danvim danvim added the enhancement New feature or request label Jan 24, 2025
@EvHaus
Copy link
Owner

EvHaus commented Jan 24, 2025

What are you hoping to achieve with this?

@danvim
Copy link
Author

danvim commented Jan 26, 2025

Potentially using this with other libraries that emits SVG directly without needing a translation layer in between, e.g. with echarts/highcharts without the their React wrapper package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants