Skip to content

Commit b944d5a

Browse files
committed
[RELEASE] iText 7 pdfHTML 4.0.1
2 parents e5c7149 + 6d6feda commit b944d5a

File tree

778 files changed

+5959
-5868
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

778 files changed

+5959
-5868
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
<parent>
66
<groupId>com.itextpdf</groupId>
77
<artifactId>root</artifactId>
8-
<version>7.2.0</version>
8+
<version>7.2.1</version>
99
<relativePath />
1010
</parent>
1111

1212
<artifactId>html2pdf</artifactId>
13-
<version>4.0.0</version>
13+
<version>4.0.1</version>
1414

1515
<name>pdfHTML</name>
1616
<description>pdfHTML is an iText 7 add-on that lets you to parse (X)HTML snippets and the associated CSS and converts

src/main/java/com/itextpdf/html2pdf/actions/data/PdfHtmlProductData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This file is part of the iText (R) project.
3030
*/
3131
public final class PdfHtmlProductData {
3232
private static final String PDF_HTML_PUBLIC_PRODUCT_NAME = "pdfHTML";
33-
private static final String PDF_HTML_VERSION = "4.0.0";
33+
private static final String PDF_HTML_VERSION = "4.0.1";
3434
private static final int PDF_HTML_COPYRIGHT_SINCE = 2000;
3535
private static final int PDF_HTML_COPYRIGHT_TO = 2021;
3636

src/main/java/com/itextpdf/html2pdf/attach/impl/DefaultTagWorkerMapping.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ class DefaultTagWorkerMapping {
196196
workerMapping.putMapping(TagConstants.UL, CssConstants.INLINE, (lhs, rhs) -> new SpanTagWorker(lhs, rhs));
197197
workerMapping.putMapping(TagConstants.LI, CssConstants.INLINE, (lhs, rhs) -> new SpanTagWorker(lhs, rhs));
198198
workerMapping.putMapping(TagConstants.LI, CssConstants.INLINE_BLOCK, (lhs, rhs) -> new DivTagWorker(lhs, rhs));
199+
workerMapping.putMapping(TagConstants.LI, CssConstants.BLOCK, (lhs, rhs) -> new DivTagWorker(lhs, rhs));
199200
workerMapping.putMapping(TagConstants.DD, CssConstants.INLINE, (lhs, rhs) -> new SpanTagWorker(lhs, rhs));
200201
workerMapping.putMapping(TagConstants.DT, CssConstants.INLINE, (lhs, rhs) -> new SpanTagWorker(lhs, rhs));
201202

src/main/java/com/itextpdf/html2pdf/css/CssConstants.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ public class CssConstants extends CommonCssConstants {
7676
/** The Constant DISPLAY. */
7777
public static final String DISPLAY = "display";
7878

79+
/** The Constant LIST_ITEM. */
80+
public static final String LIST_ITEM = "list-item";
81+
7982
/** The Constant MARKS. */
8083
public static final String MARKS = "marks";
8184

src/main/java/com/itextpdf/html2pdf/css/apply/impl/DefaultTagCssApplierMapping.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ class DefaultTagCssApplierMapping {
154154
mapping.putMapping(TagConstants.UL, CssConstants.INLINE, () -> new SpanTagCssApplier());
155155
mapping.putMapping(TagConstants.LI, CssConstants.INLINE, () -> new SpanTagCssApplier());
156156
mapping.putMapping(TagConstants.LI, CssConstants.INLINE_BLOCK, () -> new BlockCssApplier());
157+
mapping.putMapping(TagConstants.LI, CssConstants.BLOCK, () -> new BlockCssApplier());
157158
mapping.putMapping(TagConstants.DD, CssConstants.INLINE, () -> new SpanTagCssApplier());
158159
mapping.putMapping(TagConstants.DT, CssConstants.INLINE, () -> new SpanTagCssApplier());
159160

src/main/java/com/itextpdf/html2pdf/css/apply/impl/SpanTagCssApplier.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,9 @@ public void apply(ProcessorContext context, IStylesContainer stylesContainer, IT
128128
protected void applyChildElementStyles(IPropertyContainer element, Map<String, String> css, ProcessorContext context, IStylesContainer stylesContainer) {
129129
FontStyleApplierUtil.applyFontStyles(css, context, stylesContainer, element);
130130
BackgroundApplierUtil.applyBackground(css, context, element);
131-
//TODO: Border-applying currently doesn't work in html way for spans inside other spans.
132131
BorderStyleApplierUtil.applyBorders(css, context, element);
133132
OutlineApplierUtil.applyOutlines(css, context, element);
134133
HyphenationApplierUtil.applyHyphenation(css, context, stylesContainer, element);
135-
//TODO: Margins-applying currently doesn't work in html way for spans inside other spans. (see SpanTest#spanTest07)
136134
MarginApplierUtil.applyMargins(css, context, element);
137135
PositionApplierUtil.applyPosition(css, context, element);
138136
FloatApplierUtil.applyFloating(css, context, element);

src/main/java/com/itextpdf/html2pdf/css/apply/util/FontStyleApplierUtil.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,16 @@ public static void applyFontStyles(Map<String, String> cssProps, ProcessorContex
139139
String direction = cssProps.get(CssConstants.DIRECTION);
140140
if (CssConstants.RTL.equals(direction)) {
141141
element.setProperty(Property.BASE_DIRECTION, BaseDirection.RIGHT_TO_LEFT);
142-
element.setProperty(Property.TEXT_ALIGNMENT, TextAlignment.RIGHT);
142+
// For list items default behaviour differs from other elements:
143+
// only the list symbol should be aligned differently
144+
if (!CssConstants.LIST_ITEM.equals(cssProps.get(CssConstants.DISPLAY))){
145+
element.setProperty(Property.TEXT_ALIGNMENT, TextAlignment.RIGHT);
146+
}
143147
} else if (CssConstants.LTR.equals(direction)) {
144148
element.setProperty(Property.BASE_DIRECTION, BaseDirection.LEFT_TO_RIGHT);
145-
element.setProperty(Property.TEXT_ALIGNMENT, TextAlignment.LEFT);
149+
if (!CssConstants.LIST_ITEM.equals(cssProps.get(CssConstants.DISPLAY))){
150+
element.setProperty(Property.TEXT_ALIGNMENT, TextAlignment.LEFT);
151+
}
146152
}
147153

148154
if (stylesContainer instanceof IElementNode && ((IElementNode) stylesContainer).parentNode() instanceof IElementNode &&

src/main/java/com/itextpdf/html2pdf/html/HtmlUtils.java

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ This file is part of the iText (R) project.
4949
import com.itextpdf.kernel.numbering.GeorgianNumbering;
5050
import com.itextpdf.kernel.numbering.GreekAlphabetNumbering;
5151
import com.itextpdf.kernel.numbering.RomanNumbering;
52-
import com.itextpdf.styledxmlparser.css.util.CssUtils;
53-
import com.itextpdf.styledxmlparser.node.IElementNode;
5452

5553
/**
5654
* Utilities class with HTML-related functionality.
@@ -122,7 +120,7 @@ private HtmlUtils() {
122120
*/
123121
public static String convertNumberAccordingToGlyphStyle(CounterDigitsGlyphStyle glyphStyle, int number) {
124122
if (glyphStyle == null) {
125-
return String.valueOf(number);
123+
return convertNumberDefault(number);
126124
}
127125
switch (glyphStyle) {
128126
case NONE:
@@ -135,30 +133,35 @@ public static String convertNumberAccordingToGlyphStyle(CounterDigitsGlyphStyle
135133
return CIRCLE_SYMBOL;
136134
case UPPER_ALPHA_AND_LATIN:
137135
return number > 0 ? EnglishAlphabetNumbering.toLatinAlphabetNumberUpperCase(number)
138-
: String.valueOf(number);
136+
: convertNumberDefault(number);
139137
case LOWER_ALPHA_AND_LATIN:
140138
return number > 0 ? EnglishAlphabetNumbering.toLatinAlphabetNumberLowerCase(number)
141-
: String.valueOf(number);
139+
: convertNumberDefault(number);
142140
case LOWER_GREEK:
143141
return number > 0 ? GreekAlphabetNumbering.toGreekAlphabetNumberLowerCase(number)
144-
: String.valueOf(number);
142+
: convertNumberDefault(number);
145143
case LOWER_ROMAN:
146144
return number <= MAX_ROMAN_NUMBER ? RomanNumbering.toRomanLowerCase(number)
147-
: String.valueOf(number);
145+
: convertNumberDefault(number);
148146
case UPPER_ROMAN:
149147
return number <= MAX_ROMAN_NUMBER ? RomanNumbering.toRomanUpperCase(number)
150-
: String.valueOf(number);
148+
: convertNumberDefault(number);
151149
case DECIMAL_LEADING_ZERO:
152-
return (number < 10 ? "0" : "") + String.valueOf(number);
150+
return (number < 10 ? "0" : "") + convertNumberDefault(number);
153151
case GEORGIAN:
154152
return GeorgianNumbering.toGeorgian(number);
155153
case ARMENIAN:
156154
return ArmenianNumbering.toArmenian(number);
155+
case DEFAULT:
157156
default:
158-
return String.valueOf(number); //TODO
157+
return convertNumberDefault(number);
159158
}
160159
}
161160

161+
private static String convertNumberDefault(int number) {
162+
return String.valueOf(number);
163+
}
164+
162165
/**
163166
* Gets a string which contains all glyphs which can be used in number according to given glyph style.
164167
*

src/main/resources/com/itextpdf/html2pdf/NOTICE.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,4 @@ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
105105
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
106106
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
107107
OTHER DEALINGS IN THE FONT SOFTWARE.
108+

src/test/java/com/itextpdf/html2pdf/Html2PdfTest.java

Lines changed: 29 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -42,169 +42,103 @@ This file is part of the iText (R) project.
4242
*/
4343
package com.itextpdf.html2pdf;
4444

45-
import com.itextpdf.html2pdf.attach.IHtmlProcessor;
46-
import com.itextpdf.html2pdf.attach.impl.DefaultHtmlProcessor;
47-
import com.itextpdf.html2pdf.resolver.font.DefaultFontProvider;
4845
import com.itextpdf.html2pdf.logs.Html2PdfLogMessageConstant;
49-
import com.itextpdf.io.logs.IoLogMessageConstant;
50-
import com.itextpdf.io.util.UrlUtil;
51-
import com.itextpdf.kernel.pdf.PdfDocument;
52-
import com.itextpdf.kernel.pdf.PdfWriter;
53-
import com.itextpdf.kernel.utils.CompareTool;
54-
import com.itextpdf.layout.Document;
55-
import com.itextpdf.layout.font.FontProvider;
56-
import com.itextpdf.styledxmlparser.IXmlParser;
5746
import com.itextpdf.styledxmlparser.logs.StyledXmlParserLogMessageConstant;
58-
import com.itextpdf.styledxmlparser.css.media.MediaDeviceDescription;
59-
import com.itextpdf.styledxmlparser.css.media.MediaType;
60-
import com.itextpdf.styledxmlparser.node.IDocumentNode;
61-
import com.itextpdf.styledxmlparser.node.impl.jsoup.JsoupHtmlParser;
62-
import com.itextpdf.test.ExtendedITextTest;
6347
import com.itextpdf.test.annotations.LogMessage;
6448
import com.itextpdf.test.annotations.LogMessages;
6549
import com.itextpdf.test.annotations.type.IntegrationTest;
6650

67-
import java.io.FileInputStream;
68-
import org.junit.Assert;
51+
import java.io.IOException;
6952
import org.junit.BeforeClass;
7053
import org.junit.Test;
7154
import org.junit.experimental.categories.Category;
7255

73-
import java.io.File;
74-
import java.io.IOException;
75-
7656
@Category(IntegrationTest.class)
77-
public class Html2PdfTest extends ExtendedITextTest {
57+
public class Html2PdfTest extends ExtendedHtmlConversionITextTest {
7858

79-
public static final String sourceFolder = "./src/test/resources/com/itextpdf/html2pdf/Html2PdfTest/";
80-
public static final String destinationFolder = "./target/test/com/itextpdf/html2pdf/Html2PdfTest/";
59+
public static final String SOURCE_FOLDER = "./src/test/resources/com/itextpdf/html2pdf/Html2PdfTest/";
60+
public static final String DESTINATION_FOLDER = "./target/test/com/itextpdf/html2pdf/Html2PdfTest/";
8161

8262
@BeforeClass
8363
public static void beforeClass() {
84-
createDestinationFolder(destinationFolder);
64+
createOrClearDestinationFolder(DESTINATION_FOLDER);
8565
}
8666

8767
@Test
8868
public void helloWorldParagraphTest() throws IOException, InterruptedException {
89-
convertAndCompare(sourceFolder + "hello_paragraph.html", destinationFolder + "hello_paragraph.pdf",
90-
sourceFolder + "cmp_hello_paragraph.pdf", destinationFolder, "diff01_");
69+
convertToPdfAndCompare("hello_paragraph", SOURCE_FOLDER, DESTINATION_FOLDER);
9170
}
9271

9372
@Test
94-
// TODO DEVSIX-1124
9573
public void helloParagraphTableTest() throws IOException, InterruptedException {
96-
convertAndCompare(sourceFolder + "hello_paragraph_table.html", destinationFolder + "hello_paragraph_table.pdf",
97-
sourceFolder + "cmp_hello_paragraph_table.pdf", destinationFolder, "diff02_");
74+
convertToPdfAndCompare("hello_paragraph_table", SOURCE_FOLDER, DESTINATION_FOLDER);
9875
}
9976

10077
@Test
10178
public void helloMalformedDocumentTest() throws IOException, InterruptedException {
102-
convertAndCompare(sourceFolder + "hello_malformed.html", destinationFolder + "hello_malformed.pdf",
103-
sourceFolder + "cmp_hello_malformed.pdf", destinationFolder, "diff03_");
79+
convertToPdfAndCompare("hello_malformed", SOURCE_FOLDER, DESTINATION_FOLDER);
10480
}
10581

10682
@Test
10783
public void helloParagraphJunkSpacesDocumentTest() throws IOException, InterruptedException {
108-
convertAndCompare(sourceFolder + "hello_paragraph_junk_spaces.html", destinationFolder + "hello_paragraph_junk_spaces.pdf",
109-
sourceFolder + "cmp_hello_paragraph_junk_spaces.pdf", destinationFolder, "diff03_");
84+
convertToPdfAndCompare("hello_paragraph_junk_spaces", SOURCE_FOLDER, DESTINATION_FOLDER);
11085
}
11186

11287
@Test
113-
// TODO DEVSIX-1124
11488
public void helloParagraphNestedInTableDocumentTest() throws IOException, InterruptedException {
115-
convertAndCompare(sourceFolder + "hello_paragraph_nested_in_table.html", destinationFolder + "hello_paragraph_nested_in_table.pdf",
116-
sourceFolder + "cmp_hello_paragraph_nested_in_table.pdf", destinationFolder, "diff03_");
89+
convertToPdfAndCompare("hello_paragraph_nested_in_table", SOURCE_FOLDER, DESTINATION_FOLDER);
11790
}
11891

11992
@Test
12093
public void helloParagraphWithSpansDocumentTest() throws IOException, InterruptedException {
121-
convertAndCompare(sourceFolder + "hello_paragraph_with_span.html", destinationFolder + "hello_paragraph_with_span.pdf",
122-
sourceFolder + "cmp_hello_paragraph_with_span.pdf", destinationFolder, "diff03_");
94+
convertToPdfAndCompare("hello_paragraph_with_span", SOURCE_FOLDER, DESTINATION_FOLDER);
12395
}
12496

12597
@Test
12698
public void helloDivDocumentTest() throws IOException, InterruptedException {
127-
convertAndCompare(sourceFolder + "hello_div.html", destinationFolder + "hello_div.pdf",
128-
sourceFolder + "cmp_hello_div.pdf", destinationFolder, "diff03_");
99+
convertToPdfAndCompare("hello_div", SOURCE_FOLDER, DESTINATION_FOLDER);
129100
}
130101

131102
@Test
132103
public void aBlockInPTagTest() throws IOException, InterruptedException {
133-
convertAndCompare(sourceFolder + "aBlockInPTag.html", destinationFolder + "aBlockInPTag.pdf",
134-
sourceFolder + "cmp_aBlockInPTag.pdf", destinationFolder, "diff03_");
104+
convertToPdfAndCompare("aBlockInPTag", SOURCE_FOLDER, DESTINATION_FOLDER);
135105
}
136106

137107
@Test
138108
public void base64svgTest() throws IOException, InterruptedException {
139-
HtmlConverter.convertToPdf(new File(sourceFolder + "objectTag_base64svg.html"), new File(destinationFolder + "objectTag_base64svg.pdf"));
140-
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + "objectTag_base64svg.pdf", sourceFolder + "cmp_objectTag_base64svg.pdf", destinationFolder, "diff01_"));
109+
convertToPdfAndCompare("objectTag_base64svg", SOURCE_FOLDER, DESTINATION_FOLDER);
141110
}
142111

143112
@Test
144-
@LogMessages(messages = {@LogMessage(messageTemplate = StyledXmlParserLogMessageConstant.UNABLE_TO_RETRIEVE_STREAM_WITH_GIVEN_BASE_URI, count = 1),
113+
@LogMessages(messages = {
114+
@LogMessage(messageTemplate =
115+
StyledXmlParserLogMessageConstant.UNABLE_TO_RETRIEVE_STREAM_WITH_GIVEN_BASE_URI, count = 1),
145116
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.WORKER_UNABLE_TO_PROCESS_OTHER_WORKER, count = 1)})
146117
public void htmlObjectIncorrectBase64Test() throws IOException, InterruptedException {
147-
HtmlConverter.convertToPdf(new File(sourceFolder + "objectTag_incorrectBase64svg.html"), new File(destinationFolder + "objectTag_incorrectBase64svg.pdf"));
148-
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + "objectTag_incorrectBase64svg.pdf", sourceFolder + "cmp_objectTag_incorrectBase64svg.pdf", destinationFolder, "diff01_"));
149-
118+
convertToPdfAndCompare("objectTag_incorrectBase64svg", SOURCE_FOLDER, DESTINATION_FOLDER);
150119
}
151120

152121
@Test
153-
@LogMessages(messages = {@LogMessage(messageTemplate = Html2PdfLogMessageConstant.WORKER_UNABLE_TO_PROCESS_IT_S_TEXT_CONTENT, count = 1),
122+
//TODO: update after DEVSIX-1346
123+
@LogMessages(messages = {
124+
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.WORKER_UNABLE_TO_PROCESS_IT_S_TEXT_CONTENT,
125+
count = 1),
154126
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.WORKER_UNABLE_TO_PROCESS_OTHER_WORKER, count = 2),
155127
})
156128
public void htmlObjectAltTextTest() throws IOException, InterruptedException {
157-
//update after DEVSIX-1346
158-
HtmlConverter.convertToPdf(new File(sourceFolder + "objectTag_altText.html"), new File(destinationFolder + "objectTag_altText.pdf"));
159-
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + "objectTag_altText.pdf", sourceFolder + "cmp_objectTag_altText.pdf", destinationFolder, "diff01_"));
160-
129+
convertToPdfAndCompare("objectTag_altText", SOURCE_FOLDER, DESTINATION_FOLDER);
161130
}
162131

163132
@Test
164-
@LogMessages(messages = {@LogMessage(messageTemplate = Html2PdfLogMessageConstant.WORKER_UNABLE_TO_PROCESS_OTHER_WORKER, count = 1),})
133+
@LogMessages(messages = {
134+
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.WORKER_UNABLE_TO_PROCESS_OTHER_WORKER,
135+
count = 1),})
165136
public void htmlObjectNestedObjectTest() throws IOException, InterruptedException {
166-
HtmlConverter.convertToPdf(new File(sourceFolder + "objectTag_nestedTag.html"), new File(destinationFolder + "objectTag_nestedTag.pdf"));
167-
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + "objectTag_nestedTag.pdf", sourceFolder + "cmp_objectTag_nestedTag.pdf", destinationFolder, "diff01_"));
137+
convertToPdfAndCompare("objectTag_nestedTag", SOURCE_FOLDER, DESTINATION_FOLDER);
168138
}
169139

170140
@Test
171-
@LogMessages(ignore = true, messages = {
172-
@LogMessage(messageTemplate = StyledXmlParserLogMessageConstant.RULE_IS_NOT_SUPPORTED),
173-
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.CSS_PROPERTY_IN_PERCENTS_NOT_SUPPORTED),
174-
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.PADDING_VALUE_IN_PERCENT_NOT_SUPPORTED),
175-
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.MARGIN_VALUE_IN_PERCENT_NOT_SUPPORTED),
176-
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.ERROR_PARSING_CSS_SELECTOR),
177-
@LogMessage(messageTemplate = IoLogMessageConstant.WIDOWS_CONSTRAINT_VIOLATED),
178-
})
179-
public void batchConversionTest() throws IOException, InterruptedException {
180-
ConverterProperties properties = new ConverterProperties().setBaseUri(sourceFolder)
181-
.setMediaDeviceDescription(new MediaDeviceDescription(MediaType.PRINT));
182-
FontProvider fontProvider = new DefaultFontProvider(true, false, false);
183-
fontProvider.addDirectory(sourceFolder + "fonts/");
184-
properties.setFontProvider(fontProvider);
185-
IHtmlProcessor processor = new DefaultHtmlProcessor(properties);
186-
187-
IXmlParser parser = new JsoupHtmlParser();
188-
String outPdfPath = destinationFolder + "smashing1.pdf";
189-
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outPdfPath));
190-
IDocumentNode doc = parser.parse(new FileInputStream(sourceFolder + "smashing01.html"),
191-
properties.getCharset());
192-
Document document = processor.processDocument(doc, pdfDocument);
193-
document.close();
194-
195-
Assert.assertNull(new CompareTool().compareByContent(outPdfPath,
196-
sourceFolder + "cmp_smashing1.pdf", destinationFolder, "diff01_"));
197-
}
198-
199-
@Test
200-
public void htmlImgBase64SVGTest() throws IOException, InterruptedException {
201-
HtmlConverter.convertToPdf(new File(sourceFolder + "imgTag_base64svg.html"), new File(destinationFolder + "imgTag_base64svg.pdf"));
202-
Assert.assertNull(new CompareTool().compareByContent(destinationFolder + "imgTag_base64svg.pdf", sourceFolder + "cmp_imgTag_base64svg.pdf", destinationFolder, "diff01_"));
203-
}
204-
205-
private void convertAndCompare(String srcFilename, String outFilename, String cmpFilename, String outFolder, String diff) throws IOException, InterruptedException {
206-
HtmlConverter.convertToPdf(new File(srcFilename), new File(outFilename));
207-
System.out.println("html: " + UrlUtil.getNormalizedFileUriString(srcFilename) + "\n");
208-
Assert.assertNull(new CompareTool().compareByContent(outFilename, cmpFilename, outFolder, diff));
141+
public void htmlImgBase64SVGTest() throws IOException, InterruptedException {
142+
convertToPdfAndCompare("imgTag_base64svg", SOURCE_FOLDER, DESTINATION_FOLDER);
209143
}
210144
}

0 commit comments

Comments
 (0)