Skip to content

Commit 203200b

Browse files
committed
[RELEASE] Merge branch 'release/2.0.0'
2 parents a1e49be + 75e5a19 commit 203200b

File tree

1,277 files changed

+5553
-2159
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,277 files changed

+5553
-2159
lines changed

BUILDING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
To build **pdfHTML**, [Maven][1] must be installed.
2+
3+
Running install without a profile will generate the **pdfHTML** jar:
4+
```bash
5+
$ mvn clean install \
6+
-Dmaven.test.skip=true \
7+
-Dmaven.javadoc.failOnError=false \
8+
> >(tee mvn.log) 2> >(tee mvn-error.log >&2)
9+
```
10+
11+
To run the tests, [Ghostscript][2] and [Imagemagick][3] must be installed.
12+
```bash
13+
$ mvn clean install \
14+
-Dmaven.test.failure.ignore=false \
15+
-DgsExec=$(which gs) \
16+
-DcompareExec=$(which compare) \
17+
-Dmaven.javadoc.failOnError=false \
18+
> >(tee mvn.log) 2> >(tee mvn-error.log >&2)
19+
```
20+
21+
You can use the supplied `Vagrantfile` to get a [Vagrant][4] VM ([Ubuntu][5] 14.04 LTS - Trusty Tahr, with [VirtualBox][6]) with all the required software installed.
22+
```bash
23+
$ vagrant box add ubuntu/trusty64
24+
$ vagrant up
25+
$ vagrant ssh -- \
26+
'cd /vagrant ; mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.failOnError=false' \
27+
> >(tee mvn.log) 2> >(tee mvn-error.log >&2)
28+
```
29+
30+
[1]: http://maven.apache.org/
31+
[2]: http://www.ghostscript.com/
32+
[3]: http://www.imagemagick.org/
33+
[4]: https://www.vagrantup.com/
34+
[5]: http://www.ubuntu.com/
35+
[6]: https://www.virtualbox.org/

pom.xml

Lines changed: 74 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,98 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project xmlns="http://maven.apache.org/POM/4.0.0"
3-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
53
<modelVersion>4.0.0</modelVersion>
64

75
<parent>
86
<groupId>com.itextpdf</groupId>
97
<artifactId>root</artifactId>
10-
<version>7.0.5</version>
11-
<relativePath/>
8+
<version>7.1.0</version>
9+
<relativePath />
1210
</parent>
1311

1412
<artifactId>html2pdf</artifactId>
15-
<version>1.0.2</version>
13+
<version>2.0.0</version>
1614

1715
<name>pdfHTML</name>
1816
<description>pdfHTML is an iText 7 add-on that lets you to parse (X)HTML snippets and the associated CSS and converts
19-
them to PDF.
20-
</description>
17+
them to PDF.</description>
2118
<url>http://itextpdf.com/</url>
2219

2320
<properties>
2421
<itext.version>${project.parent.version}</itext.version>
2522
<javadoc.version>2.10.4</javadoc.version>
2623
</properties>
2724

25+
<repositories>
26+
<repository>
27+
<snapshots>
28+
<enabled>true</enabled>
29+
</snapshots>
30+
<id>itext-snapshot</id>
31+
<name>iText Repository - snapshots</name>
32+
<url>https://repo.itextsupport.com/snapshot</url>
33+
</repository>
34+
<repository>
35+
<snapshots>
36+
<enabled>false</enabled>
37+
</snapshots>
38+
<id>itext-releases</id>
39+
<name>iText Repository - releases</name>
40+
<url>https://repo.itextsupport.com/releases</url>
41+
</repository>
42+
</repositories>
43+
2844
<dependencies>
2945
<dependency>
3046
<groupId>com.itextpdf</groupId>
31-
<artifactId>layout</artifactId>
47+
<artifactId>forms</artifactId>
3248
<version>${itext.version}</version>
3349
</dependency>
3450
<dependency>
3551
<groupId>com.itextpdf</groupId>
36-
<artifactId>pdftest</artifactId>
52+
<artifactId>layout</artifactId>
3753
<version>${itext.version}</version>
38-
<scope>test</scope>
3954
</dependency>
4055
<dependency>
4156
<groupId>com.itextpdf</groupId>
42-
<artifactId>pdfa</artifactId>
57+
<artifactId>hyph</artifactId>
4358
<version>${itext.version}</version>
4459
<scope>test</scope>
4560
</dependency>
4661
<dependency>
4762
<groupId>com.itextpdf</groupId>
48-
<artifactId>hyph</artifactId>
63+
<artifactId>pdfa</artifactId>
4964
<version>${itext.version}</version>
5065
<scope>test</scope>
5166
</dependency>
5267
<dependency>
5368
<groupId>com.itextpdf</groupId>
54-
<artifactId>forms</artifactId>
69+
<artifactId>pdftest</artifactId>
5570
<version>${itext.version}</version>
71+
<scope>test</scope>
5672
</dependency>
5773
</dependencies>
5874

59-
<repositories>
60-
<repository>
61-
<id>itext-snapshot</id>
62-
<name>iText Repository - snapshots</name>
63-
<url>https://repo.itextsupport.com/snapshot</url>
64-
<snapshots>
65-
<enabled>true</enabled>
66-
</snapshots>
67-
</repository>
68-
<repository>
69-
<id>itext-releases</id>
70-
<name>iText Repository - releases</name>
71-
<url>https://repo.itextsupport.com/releases</url>
72-
<snapshots>
73-
<enabled>false</enabled>
74-
</snapshots>
75-
</repository>
76-
</repositories>
77-
7875
<build>
76+
<resources>
77+
<resource>
78+
<directory>src/main/java</directory>
79+
<includes>
80+
<include>**/*.properties</include>
81+
</includes>
82+
</resource>
83+
<resource>
84+
<directory>src/main/resources</directory>
85+
<includes>
86+
<include>**/*.css</include>
87+
<include>**/*.ttf</include>
88+
</includes>
89+
</resource>
90+
</resources>
7991
<plugins>
8092
<plugin>
81-
<groupId>org.apache.maven.plugins</groupId>
82-
<artifactId>maven-surefire-plugin</artifactId>
83-
<version>2.19.1</version>
84-
<configuration>
85-
<groups>${unittests}</groups>
86-
</configuration>
93+
<groupId>external.atlassian.jgitflow</groupId>
94+
<artifactId>jgitflow-maven-plugin</artifactId>
95+
<version>1.0-m5.1</version>
8796
</plugin>
8897
<plugin>
8998
<groupId>org.apache.maven.plugins</groupId>
@@ -96,45 +105,10 @@
96105
<groups>${integrationtests}</groups>
97106
</configuration>
98107
</plugin>
99-
<plugin>
100-
<groupId>org.pitest</groupId>
101-
<artifactId>pitest-maven</artifactId>
102-
<version>1.1.11</version>
103-
<configuration>
104-
<skip>true</skip>
105-
</configuration>
106-
</plugin>
107-
<plugin>
108-
<groupId>org.apache.maven.plugins</groupId>
109-
<artifactId>maven-source-plugin</artifactId>
110-
<version>3.0.0</version>
111-
<configuration>
112-
<excludes>
113-
<exclude>**</exclude>
114-
</excludes>
115-
</configuration>
116-
</plugin>
117-
<plugin>
118-
<groupId>org.revapi</groupId>
119-
<artifactId>revapi-maven-plugin</artifactId>
120-
<version>0.8.2</version>
121-
<configuration>
122-
<skip>true</skip>
123-
</configuration>
124-
</plugin>
125-
<plugin>
126-
<groupId>external.atlassian.jgitflow</groupId>
127-
<artifactId>jgitflow-maven-plugin</artifactId>
128-
<version>1.0-m5.1</version>
129-
</plugin>
130108
<plugin>
131109
<groupId>org.apache.maven.plugins</groupId>
132110
<artifactId>maven-javadoc-plugin</artifactId>
133111
<version>${javadoc.version}</version>
134-
<configuration>
135-
<quiet>true</quiet>
136-
<failOnError>true</failOnError>
137-
</configuration>
138112
<executions>
139113
<execution>
140114
<id>attach-javadocs</id>
@@ -143,77 +117,49 @@
143117
</goals>
144118
</execution>
145119
</executions>
120+
<configuration>
121+
<quiet>true</quiet>
122+
<failOnError>true</failOnError>
123+
</configuration>
146124
</plugin>
147125
<plugin>
148-
<groupId>org.apache.felix</groupId>
149-
<artifactId>maven-bundle-plugin</artifactId>
150-
<version>3.2.0</version>
151-
<extensions>true</extensions>
126+
<groupId>org.apache.maven.plugins</groupId>
127+
<artifactId>maven-source-plugin</artifactId>
128+
<version>3.0.1</version>
152129
<executions>
153130
<execution>
154-
<id>bundle-manifest</id>
155-
<phase>process-classes</phase>
131+
<id>attach-sources</id>
132+
<phase>verify</phase>
156133
<goals>
157-
<goal>manifest</goal>
134+
<goal>jar-no-fork</goal>
158135
</goals>
159136
</execution>
160137
</executions>
138+
</plugin>
139+
<plugin>
140+
<groupId>org.apache.maven.plugins</groupId>
141+
<artifactId>maven-surefire-plugin</artifactId>
142+
<version>2.19.1</version>
161143
<configuration>
162-
<unpackBundle>true</unpackBundle>
144+
<groups>${unittests}</groups>
163145
</configuration>
164146
</plugin>
165147
<plugin>
166-
<groupId>com.github.ekryd.sortpom</groupId>
167-
<artifactId>sortpom-maven-plugin</artifactId>
168-
<version>2.4.0</version>
169-
<executions>
170-
<execution>
171-
<phase>verify</phase>
172-
<goals>
173-
<goal>sort</goal>
174-
</goals>
175-
</execution>
176-
</executions>
148+
<groupId>org.pitest</groupId>
149+
<artifactId>pitest-maven</artifactId>
150+
<version>1.1.11</version>
177151
<configuration>
178-
<lineSeparator>\n</lineSeparator>
179-
<encoding>${project.build.sourceEncoding}</encoding>
180-
<sortProperties>true</sortProperties>
181-
<keepBlankLines>true</keepBlankLines>
182-
<expandEmptyElements>false</expandEmptyElements>
183-
<nrOfIndentSpace>2</nrOfIndentSpace>
184-
<sortDependencies>scope</sortDependencies>
185-
<skip>${skipSortPom}</skip>
152+
<skip>true</skip>
186153
</configuration>
187154
</plugin>
188155
<plugin>
189-
<groupId>org.codehaus.mojo</groupId>
190-
<artifactId>tidy-maven-plugin</artifactId>
191-
<version>1.0.0</version>
192-
<executions>
193-
<execution>
194-
<phase>verify</phase>
195-
<goals>
196-
<goal>pom</goal>
197-
</goals>
198-
</execution>
199-
</executions>
156+
<groupId>org.revapi</groupId>
157+
<artifactId>revapi-maven-plugin</artifactId>
158+
<version>0.8.2</version>
159+
<configuration>
160+
<skip>true</skip>
161+
</configuration>
200162
</plugin>
201163
</plugins>
202-
<resources>
203-
<resource>
204-
<directory>src/main/java</directory>
205-
<includes>
206-
<include>**/*.properties</include>
207-
</includes>
208-
</resource>
209-
<resource>
210-
<directory>src/main/resources</directory>
211-
<includes>
212-
<include>**/*.css</include>
213-
<include>**/*.ttf</include>
214-
</includes>
215-
</resource>
216-
</resources>
217164
</build>
218-
219165
</project>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class Html2PdfProductInfo {
5353
public static final String PRODUCT_NAME = "pdfHtml";
5454

5555
/** The major version number. */
56-
public static final int MAJOR_VERSION = 1;
56+
public static final int MAJOR_VERSION = 2;
5757

5858
/** The minor version number. */
5959
public static final int MINOR_VERSION = 0;

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ public final class LogMessageConstant {
151151
/** The Constant UNKNOWN_MARGIN_BOX_CHILD. */
152152
public static final String UNKNOWN_MARGIN_BOX_CHILD = "Unknown margin box child";
153153

154+
public static final String UNSUPPORTED_PSEUDO_CSS_SELECTOR = "Unsupported pseudo css selector: {0}";
155+
154156
public static final String URL_IS_NOT_CLOSED_IN_CSS_EXPRESSION = "url function is not properly closed in expression:{0}";
155157

156158
public static final String URL_IS_EMPTY_IN_CSS_EXPRESSION = "url function is empty in expression:{0}";

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public void reset() {
178178
*/
179179
OutlineHandler addOutline(ITagWorker tagWorker, IElementNode element, ProcessorContext context) {
180180
String tagName = element.name();
181-
if (null != tagWorker && hasTagPriorityMapping(tagName)) {
181+
if (null != tagWorker && hasTagPriorityMapping(tagName) && context.getPdfDocument() != null) {
182182
int level = (int) getTagPriorityMapping(tagName);
183183
if (null == currentOutline) {
184184
currentOutline = context.getPdfDocument().getOutlines(false);
@@ -213,7 +213,7 @@ OutlineHandler addOutline(ITagWorker tagWorker, IElementNode element, ProcessorC
213213
*/
214214
OutlineHandler addDestination(ITagWorker tagWorker, IElementNode element) {
215215
String tagName = element.name();
216-
if (null != tagWorker && hasTagPriorityMapping(tagName)) {
216+
if (null != tagWorker && hasTagPriorityMapping(tagName) && destinationsInProcess.size()>0) {
217217
String content = destinationsInProcess.pop();
218218
if (tagWorker.getElementResult() instanceof IElement) {
219219
tagWorker.getElementResult().setProperty(Property.DESTINATION, content);

0 commit comments

Comments
 (0)