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

Base 64 encoded SVG does not load in pdf #484

Closed
adrianrodfer opened this issue May 15, 2020 · 7 comments
Closed

Base 64 encoded SVG does not load in pdf #484

adrianrodfer opened this issue May 15, 2020 · 7 comments

Comments

@adrianrodfer
Copy link

Hi,

I have an image with a Base 64 encoded "svg" in my html file, like this:

<img src="data:image/svg+xml;base64,PD94bWwgdmVyc2...">

I need to have the image in a pdf. But I get the following error:

com.openhtmltopdf.load WARNING:: Unrecognized image format for: data:image/svg+xml;base64,PD94bWwgdmV...
com.openhtmltopdf.exception WARNING:: Can't read XHTML embedded image.

Is there any way to insert a Base64 encoded svg?

Thanks,
Adrian

@syjer
Copy link
Contributor

syjer commented May 15, 2020

hi @adrianrodfer , at the moment it's not supported. But I'll provide a pull request asap.

@rekhubs
Copy link

rekhubs commented Sep 3, 2020

hi @adrianrodfer , at the moment it's not supported. But I'll provide a pull request asap.

I need this too.... Thank you!

@vasilyevia
Copy link

Hi @syjer. Is it possible to support plain text svg data like the following?
data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="9" height="12" viewBox="0 0 9 12"><path ...

@syjer
Copy link
Contributor

syjer commented Oct 20, 2020

hi @vasilyevia , it should not be hard, could you open a new issue as a feature request so I can track it? Thank you.

@vasilyevia
Copy link

vasilyevia commented Oct 20, 2020

hi @vasilyevia , it should not be hard, could you open a new issue as a feature request so I can track it? Thank you.

Thanks. Created a new issue. Not sure how to mark it as a feature request.
#583

@Abhinandan578
Copy link

I am still facing the same issue. SAVG Images are not getting loaded. I am using docx4j-ImportXHTML (11.4.8) which is calling openhtmltopdf-core(1.0.10). Can someone please help here.

@Donghee-Jeong
Copy link

I resolved it by using a workaround of converting the SVG to PNG.

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

6 participants