html2docx
html2docx copied to clipboard
<img src="data:image/png;base64,xxxx==>
Could you please provide some more information about this issue?
Same issue here... in HTML - there is an easier way to have images - inline as base64
Another project pip html2docx solves this - in this file
More information on this at https://www.w3docs.com/snippets/html/how-to-display-base64-images-in-html.html
Essentially if your html file is self-contained - with images as inline base64 format - content is added as a string instead of an image.
同样的问题... 在HTML中-有一种更简单的图像获取方法-与base64内联
另一个项目pip html2docx解决了这个问题-在此文件中
有关此的更多信息,请访问 https://www.w3docs.com/snippets/html/how-to-display-base64-images-in-html.html
本质上,如果您的html文件是独立的-图像采用内联base64格式-内容将作为字符串而不是图像添加。
thank you
I grabbed code from the file @bpasham suggested and tried to make it work here: https://github.com/abubelinha/html2docx/commit/530b4ed372d960b9a6e67843e8bea1037c1ba853
Looks like it works but I haven't tested it so much. There might be some issues in the original code, too. @abubelinha
@abubelinha thank you so much for the modification. I can confirm it worked on my end!
Hi there, does anyone have done a few tests to check if this modification behaves as intended ? @abubelinha would you mind doing a PR to the main codebase to be able to use it in the main code base ? :) Being able to generate documents with inline base64 images would definitely help me :)
Sorry @almandin but I am not a git user by any means. I use github for reporting issues but have no idea about how to do a PR (I don't actually understand what it is). Maybe @pqzx can solve it.
For my solution, I just edited the code in the .py file installed by pip. It worked for a couple of images I tried. But as I linked above, the original code had an open issue.
Feel free to take it and try to do a PR yourself it you know how to do it.