java-html2image icon indicating copy to clipboard operation
java-html2image copied to clipboard

Problem with IMG embedded in HTML

Open GoogleCodeExporter opened this issue 10 years ago • 2 comments

What steps will reproduce the problem?
1. Get HTML from my WYSIWYG Editor
2. HTML has an image like <img src="voasdasdnunew..."/> in base64
3. when converting to image the img is not recognized

Steps:

HtmlImageGenerator imageGenerator = new HtmlImageGenerator();
imageGenerator.loadHtml("<IMG src=\"data:image/gif;base64,iVBORw0KGgoAA...
imageGenerator.saveAsImage("C:\\tmp\\prueba.png");


What is the expected output? What do you see instead?

I want to get the image as it is displayed in Web browser

What version of the product are you using? On what operating system?

0.9.jar in W7

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 15 Mar 2013 at 9:36

GoogleCodeExporter avatar Jun 10 '15 11:06 GoogleCodeExporter

Is there any way to solve this problem? I could attach any necessary file if 
required.

Original comment by [email protected] on 15 Mar 2013 at 12:21

GoogleCodeExporter avatar Jun 10 '15 11:06 GoogleCodeExporter

You can create your own protocol handler for 'data:' by extending 
java.net.URLStreamHandler. You will need to register your protocol handler 
class by either including its name in the value of the 
java.protocol.handler.pkgs system property or by creating an extension of 
java.net.URLStreamHandlerFactory class and passing an instance of it to the 
java.net.URL.setURLStreamHandlerFactory method.

More information is available at:

http://stackoverflow.com/questions/9388264/jeditorpane-with-inline-image

http://www.jcgonzalez.com/java-change-url-override-protocol-ftp-apache

Original comment by [email protected] on 15 Dec 2013 at 4:05

GoogleCodeExporter avatar Jun 10 '15 11:06 GoogleCodeExporter