diff --git a/html2image/pom.xml b/html2image/pom.xml
index 5cb9118..f00bfc3 100644
--- a/html2image/pom.xml
+++ b/html2image/pom.xml
@@ -1,63 +1,111 @@
-
+
+
+
4.0.0
+
gui.ava
html2image
jar
- 2.0-SNAPSHOT
+ 3.0.0-SNAPSHOT
html2image
- http://maven.apache.org
+ https://maven.apache.org
+
+
+
+ 17
+ UTF-8
+ ${java.version}
+ ${java.version}
+ ${java.version}
+ 9.9.1
+
+
+
-
- org.xhtmlrenderer
- core-renderer
- R8
-
+
+
+
+
net.sourceforge.nekohtml
nekohtml
- 1.9.14
+ 1.9.22
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ org.xhtmlrenderer
+ flying-saucer-core
+ ${flying-saucer.version}
- commons-lang
- commons-lang
- 2.5
+ org.xhtmlrenderer
+ flying-saucer-pdf
+ ${flying-saucer.version}
+
+
+
- junit
- junit
- 4.8.1
- test
+ org.apache.commons
+ commons-lang3
+ 3.16.0
+
+
+
- org.springframework
- spring-core
- 3.0.3.RELEASE
+ org.junit.jupiter
+ junit-jupiter-engine
+ 5.11.0
test
+
+
jfrog-third-party-releases-local
- http://repo.jfrog.org/artifactory/third-party-releases-local
+ https://repo.jfrog.org/artifactory/third-party-releases-local
+
+
diff --git a/html2image/src/main/java/gui/ava/html/Html2Image.java b/html2image/src/main/java/gui/ava/html/Html2Image.java
index c8a7505..b5c47c9 100644
--- a/html2image/src/main/java/gui/ava/html/Html2Image.java
+++ b/html2image/src/main/java/gui/ava/html/Html2Image.java
@@ -1,5 +1,13 @@
package gui.ava.html;
+import java.io.File;
+import java.io.InputStream;
+import java.io.Reader;
+import java.net.URI;
+import java.net.URL;
+
+import org.w3c.dom.Document;
+
import gui.ava.html.imagemap.HtmlImageMap;
import gui.ava.html.imagemap.HtmlImageMapImpl;
import gui.ava.html.parser.HtmlParser;
@@ -8,19 +16,14 @@
import gui.ava.html.pdf.PdfRendererImpl;
import gui.ava.html.renderer.ImageRenderer;
import gui.ava.html.renderer.ImageRendererImpl;
-import org.w3c.dom.Document;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.Reader;
-import java.net.URI;
-import java.net.URL;
/**
* @author Yoav Aharoni
*/
public class Html2Image {
- private HtmlParser parser = new HtmlParserImpl();
+
+ private final HtmlParser parser = new HtmlParserImpl();
+
private HtmlImageMap htmlImageMap;
private ImageRenderer imageRenderer;
private PdfRenderer pdfRenderer;
@@ -91,4 +94,5 @@ public static Html2Image fromInputStream(InputStream inputStream) {
html2Image.getParser().load(inputStream);
return html2Image;
}
+
}
diff --git a/html2image/src/main/java/gui/ava/html/exception/RenderException.java b/html2image/src/main/java/gui/ava/html/exception/RenderException.java
index 395a0ea..2c499ce 100644
--- a/html2image/src/main/java/gui/ava/html/exception/RenderException.java
+++ b/html2image/src/main/java/gui/ava/html/exception/RenderException.java
@@ -4,7 +4,9 @@
* @author Yoav Aharoni
*/
public class RenderException extends RuntimeException {
+
public RenderException(String message, Throwable cause) {
super(message, cause);
}
+
}
diff --git a/html2image/src/main/java/gui/ava/html/image/HtmlImageGenerator.java b/html2image/src/main/java/gui/ava/html/image/HtmlImageGenerator.java
index aaebabb..9620966 100644
--- a/html2image/src/main/java/gui/ava/html/image/HtmlImageGenerator.java
+++ b/html2image/src/main/java/gui/ava/html/image/HtmlImageGenerator.java
@@ -1,29 +1,29 @@
package gui.ava.html.image;
-import gui.ava.html.image.util.FormatNameUtil;
-import gui.ava.html.image.util.SynchronousHTMLEditorKit;
-import gui.ava.html.link.LinkInfo;
-
-import javax.imageio.ImageIO;
-import javax.swing.*;
import java.awt.*;
+import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.net.URL;
-import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import javax.imageio.ImageIO;
+import javax.swing.*;
+
+import gui.ava.html.link.LinkInfo;
+import gui.ava.html.util.FormatNameUtil;
+
/**
* @author Yoav Aharoni
*/
public class HtmlImageGenerator {
- private JEditorPane editorPane;
- static final Dimension DEFAULT_SIZE = new Dimension(800, 800);
+
+ private static final Dimension DEFAULT_SIZE = new Dimension(800, 800);
+
+ private final JEditorPane editorPane;
public HtmlImageGenerator() {
editorPane = createJEditorPane();
@@ -63,8 +63,8 @@ public void loadUrl(String url) {
public void loadHtml(String html) {
editorPane.setEditable(false);
- editorPane.setText(html);
editorPane.setContentType("text/html");
+ editorPane.setText(html);
onDocumentLoad();
}
@@ -72,15 +72,15 @@ public String getLinksMapMarkup(String mapName) {
final StringBuilder markup = new StringBuilder();
markup.append("