zhu915139481 / java-html2image

Automatically exported from code.google.com/p/java-html2image
0 stars 0 forks source link

Problem with IMG embedded in HTML #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 aritz...@gmail.com on 15 Mar 2013 at 9:36

GoogleCodeExporter commented 9 years ago
Is there any way to solve this problem? I could attach any necessary file if 
required.

Original comment by aritz...@gmail.com on 15 Mar 2013 at 12:21

GoogleCodeExporter commented 9 years ago
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 lees.j...@gmail.com on 15 Dec 2013 at 4:05