Skip to content

Commit f85c04c

Browse files
author
Andrei Stryhelski
committed
Add tests with not tagged content
DEVSIX-8883
1 parent 67c9cfa commit f85c04c

File tree

7 files changed

+57
-0
lines changed

7 files changed

+57
-0
lines changed

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,33 @@ public void inputWithTitleTagTest() throws IOException, InterruptedException, XM
271271
convertToUa2AndCheckCompliance(sourceHtml, destinationPdfUa2, cmpPdfUa2, converterProperties, false);
272272
}
273273

274+
@Test
275+
// TODO DEVSIX-8883 content is not tagged as real content or tagged as artifact after conversion
276+
public void svgBase64Test() throws IOException, InterruptedException, XMPException {
277+
String sourceHtml = SOURCE_FOLDER + "svgBase64.html";
278+
String cmpPdfUa1 = SOURCE_FOLDER + "cmp_svgBase64Ua1.pdf";
279+
String cmpPdfUa2 = SOURCE_FOLDER + "cmp_svgBase64Ua2.pdf";
280+
String destinationPdfUa1 = DESTINATION_FOLDER + "svgBase64Ua1.pdf";
281+
String destinationPdfUa2 = DESTINATION_FOLDER + "svgBase64Ua2.pdf";
282+
283+
convertToUa1AndCheckCompliance(sourceHtml,destinationPdfUa1, cmpPdfUa1, false, null);
284+
convertToUa2AndCheckCompliance(sourceHtml, destinationPdfUa2, cmpPdfUa2, false);
285+
}
286+
287+
@Test
288+
// TODO DEVSIX-8883 content is not tagged as real content or tagged as artifact after conversion
289+
public void pngInDivStyleTest() throws IOException, InterruptedException, XMPException {
290+
String sourceHtml = SOURCE_FOLDER + "pngInDivStyle.html";
291+
String cmpPdfUa1 = SOURCE_FOLDER + "cmp_pngInDivStyleUa1.pdf";
292+
String cmpPdfUa2 = SOURCE_FOLDER + "cmp_pngInDivStyleUa2.pdf";
293+
String destinationPdfUa1 = DESTINATION_FOLDER + "pngInDivStyleUa1.pdf";
294+
String destinationPdfUa2 = DESTINATION_FOLDER + "pngInDivStyleUa2.pdf";
295+
296+
// Investigate why VeraPdf doesn't complain about the missing tag.
297+
convertToUa1AndCheckCompliance(sourceHtml,destinationPdfUa1, cmpPdfUa1, true, null);
298+
convertToUa2AndCheckCompliance(sourceHtml, destinationPdfUa2, cmpPdfUa2, true);
299+
}
300+
274301
private void createSimplePdfUA2Document(PdfDocument pdfDocument) throws IOException, XMPException {
275302
byte[] bytes = Files.readAllBytes(Paths.get(SOURCE_FOLDER + "simplePdfUA2.xmp"));
276303
XMPMeta xmpMeta = XMPMetaFactory.parse(new ByteArrayInputStream(bytes));
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
div {
6+
background: url('blue96x96.png') no-repeat;
7+
width: 200px;
8+
height: 200px;
9+
}
10+
</style>
11+
</head>
12+
<body>
13+
<div></div>
14+
</body>
15+
</html>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<style>
5+
div {
6+
background: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1MDAgNTAwIiB3aWR0aD0iNTAwIiBoZWlnaHQ9IjUwMCI+CiAgPHJlY3Qgd2lkdGg9IjUwMCIgaGVpZ2h0PSI1MDAiIGZpbGw9ImdyZWVuIi8+CiAgPGNpcmNsZSBjeD0iMjUwIiBjeT0iMjUwIiByPSIyNTAiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0icmVkIiAvPgo8L3N2Zz4K") no-repeat;
7+
width: 200px;
8+
height: 200px;
9+
}
10+
</style>
11+
</head>
12+
<body>
13+
<div></div>
14+
</body>
15+
</html>

0 commit comments

Comments
 (0)