Skip to content

Commit 9e5bfc1

Browse files
committed
[RELEASE] iText pdfHtml 6.2.0
2 parents cf3001b + 9e65606 commit 9e5bfc1

File tree

1,530 files changed

+5436
-638
lines changed

Some content is hidden

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

1,530 files changed

+5436
-638
lines changed

pom.xml

Lines changed: 8 additions & 8 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>9.1.0</version>
8+
<version>9.2.0</version>
99
<relativePath />
1010
</parent>
1111

1212
<artifactId>html2pdf</artifactId>
13-
<version>6.1.0</version>
13+
<version>6.2.0</version>
1414

1515
<name>pdfHTML</name>
1616
<description>pdfHTML is an iText add-on that lets you to parse (X)HTML snippets and the associated CSS and converts
@@ -62,7 +62,6 @@
6262
<groupId>com.itextpdf</groupId>
6363
<artifactId>pdfua</artifactId>
6464
<version>${itext.version}</version>
65-
<scope>test</scope>
6665
</dependency>
6766
</dependencies>
6867

@@ -106,6 +105,12 @@
106105
<include>**/*.json</include>
107106
</includes>
108107
</resource>
108+
<resource>
109+
<directory>src/main/resources/com/itextpdf/html2pdf</directory>
110+
<includes>
111+
<include>NOTICE.txt</include>
112+
</includes>
113+
</resource>
109114
</resources>
110115
<plugins>
111116
<plugin>
@@ -148,11 +153,6 @@
148153
<artifactId>standard-framework-mapping</artifactId>
149154
<version>1.0-SNAPSHOT</version>
150155
</dependency>
151-
<dependency>
152-
<groupId>sharpen</groupId>
153-
<artifactId>html2pdf-sharpen-mapping</artifactId>
154-
<version>1.0-SNAPSHOT</version>
155-
</dependency>
156156
</dependencies>
157157
<configuration>
158158
<projectName>html2pdf</projectName>

src/main/java/com/itextpdf/html2pdf/ConverterProperties.java

Lines changed: 61 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,19 @@ This file is part of the iText (R) project.
2525
import com.itextpdf.commons.actions.contexts.IMetaInfo;
2626
import com.itextpdf.html2pdf.attach.ITagWorkerFactory;
2727
import com.itextpdf.html2pdf.attach.impl.OutlineHandler;
28+
import com.itextpdf.html2pdf.attach.util.AlternateDescriptionResolver;
2829
import com.itextpdf.html2pdf.css.apply.ICssApplierFactory;
2930
import com.itextpdf.kernel.pdf.PdfAConformance;
31+
import com.itextpdf.kernel.pdf.PdfConformance;
3032
import com.itextpdf.kernel.pdf.PdfOutputIntent;
33+
import com.itextpdf.kernel.pdf.PdfUAConformance;
3134
import com.itextpdf.layout.font.FontProvider;
3235
import com.itextpdf.styledxmlparser.css.media.MediaDeviceDescription;
3336
import com.itextpdf.styledxmlparser.resolver.resource.IResourceRetriever;
3437

3538
import java.io.InputStream;
39+
import java.util.HashMap;
40+
import java.util.Map;
3641

3742
/**
3843
* Properties that will be used by the {@link com.itextpdf.html2pdf.HtmlConverter}.
@@ -44,6 +49,8 @@ public class ConverterProperties {
4449
*/
4550
private static final int DEFAULT_LIMIT_OF_LAYOUTS = 10;
4651

52+
private final HashMap<Class<?>, Object> dependencies = new HashMap<>();
53+
4754
/**
4855
* The media device description.
4956
*/
@@ -117,12 +124,13 @@ public class ConverterProperties {
117124
/**
118125
* Conformance for conversion to pdf/a.
119126
*/
120-
private PdfAConformance aConformance;
127+
private PdfConformance conformance = new PdfConformance();
121128

122129
/**
123130
* Instantiates a new {@link ConverterProperties} instance.
124131
*/
125132
public ConverterProperties() {
133+
this.dependencies.put(AlternateDescriptionResolver.class, new AlternateDescriptionResolver());
126134
}
127135

128136
/**
@@ -145,6 +153,11 @@ public ConverterProperties(ConverterProperties other) {
145153
this.limitOfLayouts = other.limitOfLayouts;
146154
this.immediateFlush = other.immediateFlush;
147155
this.continuousContainerEnabled = other.continuousContainerEnabled;
156+
this.conformance = other.conformance;
157+
this.outputIntent = other.outputIntent;
158+
for (Class<?> aClass : other.dependencies.keySet()) {
159+
this.dependencies.put(aClass, other.dependencies.get(aClass));
160+
}
148161
}
149162

150163
/**
@@ -344,7 +357,6 @@ public boolean isCreateAcroForm() {
344357
* When enabling this acroform creation, it will disable the immediateFlushing property.
345358
*
346359
* @param createAcroForm true if an AcroForm needs to be created
347-
*
348360
* @return the {@link ConverterProperties} instance
349361
*/
350362
public ConverterProperties setCreateAcroForm(boolean createAcroForm) {
@@ -410,16 +422,28 @@ public ConverterProperties setCharset(String charset) {
410422
return this;
411423
}
412424

425+
/**
426+
* Gets pdf document output intent (final destination device) to reproduce the color in the PDF.
427+
*
428+
* <p>
429+
* Note, output intent isn't applicable for HtmlConverter#convertToElements methods
430+
* (e.g. {@link HtmlConverter#convertToElements(InputStream, ConverterProperties)})
431+
*
432+
* @return pdf output intent
433+
*/
434+
public PdfOutputIntent getDocumentOutputIntent() {
435+
return outputIntent;
436+
}
437+
413438
/**
414439
* Sets pdf document output intent (final destination device) to reproduce the color in the PDF.
415-
* Required parameter, when converting to pdf/a one have to specify an explicit output intent.
440+
* Required parameter, when converting to pdf/a one has to specify an explicit output intent.
416441
*
417442
* <p>
418443
* Note, output intent isn't applicable for HtmlConverter#convertToElements methods
419444
* (e.g. {@link HtmlConverter#convertToElements(InputStream, ConverterProperties)})
420445
*
421446
* @param outputIntent a {@link PdfOutputIntent} instance
422-
*
423447
* @return the {@link ConverterProperties} instance
424448
*/
425449
public ConverterProperties setDocumentOutputIntent(PdfOutputIntent outputIntent) {
@@ -428,38 +452,45 @@ public ConverterProperties setDocumentOutputIntent(PdfOutputIntent outputIntent)
428452
}
429453

430454
/**
431-
* Sets the generation and strictness level of the PDF/A that must be followed.
432-
* Required parameter, when converting to pdf/a one have to specify an explicit pdf/a conformance.
455+
* Gets the generation and strictness level of the PDF/A that must be followed.
433456
*
434-
* @param conformance a {@link PdfAConformance} constant
457+
* @return pdf/a conformance
458+
*/
459+
public PdfAConformance getPdfAConformance() {
460+
return conformance.getAConformance();
461+
}
462+
463+
/**
464+
* Sets the generation and strictness level of the PDF/A that must be followed.
465+
* Required parameter, when converting to pdf/a one has to specify an explicit pdf/a conformance.
435466
*
467+
* @param aConformance a {@link PdfAConformance} constant
436468
* @return the {@link ConverterProperties} instance
437469
*/
438-
public ConverterProperties setPdfAConformance(PdfAConformance conformance) {
439-
this.aConformance = conformance;
470+
public ConverterProperties setPdfAConformance(PdfAConformance aConformance) {
471+
this.conformance = new PdfConformance(aConformance, conformance.getUAConformance());
440472
return this;
441473
}
442474

443475
/**
444-
* Gets pdf document output intent (final destination device) to reproduce the color in the PDF.
476+
* Gets the generation and strictness level of the PDF/UA that must be followed.
445477
*
446-
* <p>
447-
* Note, output intent isn't applicable for HtmlConverter#convertToElements methods
448-
* (e.g. {@link HtmlConverter#convertToElements(InputStream, ConverterProperties)})
449-
*
450-
* @return pdf output intent
478+
* @return The PDF/UA conformance level.
451479
*/
452-
public PdfOutputIntent getDocumentOutputIntent() {
453-
return outputIntent;
480+
public PdfUAConformance getPdfUaConformance() {
481+
return conformance.getUAConformance();
454482
}
455483

456484
/**
457-
* Gets the generation and strictness level of the PDF/A that must be followed.
485+
* Sets the generation and strictness level of the PDF/UA that must be followed.
486+
* Required parameter, when converting to PDF/UA one has to specify an explicit PDF/UA conformance.
458487
*
459-
* @return pdf/a conformance
488+
* @param uaConformance a {@link PdfUAConformance} constant
489+
* @return the {@link ConverterProperties} instance
460490
*/
461-
public PdfAConformance getPdfAConformance() {
462-
return aConformance;
491+
public ConverterProperties setPdfUAConformance(PdfUAConformance uaConformance) {
492+
this.conformance = new PdfConformance(conformance.getAConformance(), uaConformance);
493+
return this;
463494
}
464495

465496
/**
@@ -535,4 +566,13 @@ public ConverterProperties setContinuousContainerEnabled(boolean value) {
535566
continuousContainerEnabled = value;
536567
return this;
537568
}
569+
570+
/**
571+
* Gets the dependencies.
572+
*
573+
* @return the dependencies
574+
*/
575+
public Map<Class<?>, Object> getDependencies() {
576+
return dependencies;
577+
}
538578
}

0 commit comments

Comments
 (0)