Skip to content

Commit dec8dac

Browse files
committed
[RELEASE] Merge branch 'release/2.0.1'
2 parents 203200b + 87f1f8f commit dec8dac

File tree

225 files changed

+3342
-328
lines changed

Some content is hidden

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

225 files changed

+3342
-328
lines changed

pom.xml

+2-2
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.1.0</version>
8+
<version>7.1.1</version>
99
<relativePath />
1010
</parent>
1111

1212
<artifactId>html2pdf</artifactId>
13-
<version>2.0.0</version>
13+
<version>2.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/LogMessageConstant.java

+12-50
Original file line numberDiff line numberDiff line change
@@ -49,120 +49,82 @@ public final class LogMessageConstant {
4949

5050
/** The Constant CONTENT_PROPERTY_INVALID. */
5151
public static final String CONTENT_PROPERTY_INVALID = "Content property \"{0}\" is either invalid or uses unsupported function.";
52-
5352
/** The Constant CSS_PROPERTY_IN_PERCENTS_NOT_SUPPORTED. */
5453
public static final String CSS_PROPERTY_IN_PERCENTS_NOT_SUPPORTED = "Css property {0} in percents is not supported";
55-
56-
public static final String DEFAULT_VALUE_OF_CSS_PROPERTY_UNKNOWN = "Default value of the css property \"{0}\" is unknown.";
57-
54+
public static final String DEFAULT_VALUE_OF_CSS_PROPERTY_UNKNOWN = "Default value of the css property \"{0}\" is unknown.";
5855
/** The Constant ERROR_LOADING_FONT. */
5956
public static final String ERROR_LOADING_FONT = "Error while loading font";
60-
6157
/** The Constant ERROR_PARSING_CSS_SELECTOR. */
6258
public static final String ERROR_PARSING_CSS_SELECTOR = "Error while parsing css selector: {0}";
63-
6459
/** The Constant ERROR_RESOLVING_PARENT_STYLES. */
6560
public static final String ERROR_RESOLVING_PARENT_STYLES = "Element parent styles are not resolved. Styles for current element might be incorrect.";
66-
6761
/** The Constant ERROR_WHILE_LAYOUT_OF_FORM_FIELD. */
6862
public static final String ERROR_WHILE_LAYOUT_OF_FORM_FIELD = "Cannot layout form field field. It won't be displayed";
69-
7063
/** The Constant ERROR_WHILE_LAYOUT_OF_FORM_FIELD_WITH_TYPE. */
7164
public static final String ERROR_WHILE_LAYOUT_OF_FORM_FIELD_WITH_TYPE = "Error during layout of form filed with type {0}.";
72-
65+
/** The Constant HEIGHT_VALUE_IN_PERCENT_NOT_SUPPORTED. */
66+
public static final String HEIGHT_VALUE_IN_PERCENT_NOT_SUPPORTED = "Height value in percent not supported";
7367
/** The Constant INPUT_FIELD_DOES_NOT_FIT. */
7468
public static final String INPUT_FIELD_DOES_NOT_FIT = "Input field doesn't fit in outer object. It will be clipped";
75-
7669
/** The Constant INPUT_SUPPORTS_ONLY_POINT_WIDTH. */
7770
public static final String INPUT_SUPPORTS_ONLY_POINT_WIDTH = "Input field supports only point width";
78-
79-
/** The Constant HEIGHT_VALUE_IN_PERCENT_NOT_SUPPORTED. */
80-
public static final String HEIGHT_VALUE_IN_PERCENT_NOT_SUPPORTED = "Height value in percent not supported";
81-
8271
/** The Constant INPUT_TYPE_IS_NOT_SUPPORTED. */
8372
public static final String INPUT_TYPE_IS_NOT_SUPPORTED = "Input type {0} is not supported";
84-
8573
/** The Constant INVALID_CSS_PROPERTY_DECLARATION. */
8674
public static final String INVALID_CSS_PROPERTY_DECLARATION = "Invalid css property declaration: {0}";
87-
8875
/** The Constant MARGIN_VALUE_IN_PERCENT_NOT_SUPPORTED. */
8976
public static final String MARGIN_VALUE_IN_PERCENT_NOT_SUPPORTED = "Margin value in percents not supported";
90-
9177
/** The Constant NOT_SUPPORTED_LIST_STYLE_TYPE. */
9278
public static final String NOT_SUPPORTED_LIST_STYLE_TYPE = "Not supported list style type: {0}";
93-
94-
/** The Constant NO_IPROPERTYCONTAINER_RESULT_FOR_THE_TAG. */
95-
public static final String NO_IPROPERTYCONTAINER_RESULT_FOR_THE_TAG = "Tag worker does not produce IPropertyContainer for \"{0}\" tag. An outline for \"{0}\" tag will not be created.";
96-
9779
/** The Constant NO_CONSUMER_FOUND_FOR_CONTENT. */
9880
public static final String NO_CONSUMER_FOUND_FOR_CONTENT = "No consumer found for content";
99-
10081
/** The Constant NO_CSS_APPLIER_FOUND_FOR_TAG. */
10182
public static final String NO_CSS_APPLIER_FOUND_FOR_TAG = "No css applier found for tag {0}";
102-
83+
/** The Constant NO_IPROPERTYCONTAINER_RESULT_FOR_THE_TAG. */
84+
public static final String NO_IPROPERTYCONTAINER_RESULT_FOR_THE_TAG = "Tag worker does not produce IPropertyContainer for \"{0}\" tag. An outline for \"{0}\" tag will not be created.";
10385
/** The Constant NO_WORKER_FOUND_FOR_TAG. */
10486
public static final String NO_WORKER_FOUND_FOR_TAG = "No worker found for tag {0}";
105-
10687
/** The Constant PADDING_VALUE_IN_PERCENT_NOT_SUPPORTED. */
10788
public static final String PADDING_VALUE_IN_PERCENT_NOT_SUPPORTED = "Padding value in percents not supported";
108-
89+
public static final String PAGE_MARGIN_BOX_CONTENT_CANNOT_BE_DRAWN = "Page margin box {0} content cannot be drawn.";
90+
public static final String PAGE_MARGIN_BOX_SOME_PROPERTIES_NOT_PROCESSED = "Page margin box margin, padding, height and width properties are not processed. Passed styles container shall be of PageMarginBoxContextNode type.";
10991
/** The Constant PAGE_SIZE_VALUE_IS_INVALID. */
11092
public static final String PAGE_SIZE_VALUE_IS_INVALID = "Page size value {0} is invalid.";
111-
112-
/** The Constant QUOTE_IS_NOT_CLOSED_IN_CSS_EXPRESSION. */
113-
public static final String QUOTE_IS_NOT_CLOSED_IN_CSS_EXPRESSION = "The quote is not closed in css expression: {0}";
114-
11593
/** The Constant QUOTES_PROPERTY_INVALID. */
11694
public static final String QUOTES_PROPERTY_INVALID = "Quote property \"{0}\" is invalid. It should contain even number of <string> values.";
117-
95+
/** The Constant QUOTE_IS_NOT_CLOSED_IN_CSS_EXPRESSION. */
96+
public static final String QUOTE_IS_NOT_CLOSED_IN_CSS_EXPRESSION = "The quote is not closed in css expression: {0}";
11897
/** The Constant RULE_IS_NOT_SUPPORTED. */
11998
public static final String RULE_IS_NOT_SUPPORTED = "The rule @{0} is unsupported. All selectors in this rule will be ignored.";
120-
12199
/** The Constant TEXT_DECORATION_BLINK_NOT_SUPPORTED. */
122100
public static final String TEXT_DECORATION_BLINK_NOT_SUPPORTED = "text-decoration: blink not supported";
123-
124101
/** The Constant TEXT_WAS_NOT_PROCESSED. */
125102
public static final String TEXT_WAS_NOT_PROCESSED = "Text was not processed: {0}";
126-
127103
/** The Constant UNABLE_TO_PROCESS_EXTERNAL_CSS_FILE. */
128104
public static final String UNABLE_TO_PROCESS_EXTERNAL_CSS_FILE = "Unable to process external css file";
129-
130105
/** The Constant UNABLE_TO_RESOLVE_COUNTER. */
131106
public static final String UNABLE_TO_RESOLVE_COUNTER = "Unable to resolve counter \"{0}\"";
132-
133107
/** The Constant UNABLE_TO_RESOLVE_FONT. */
134108
public static final String UNABLE_TO_RESOLVE_FONT = "Unable to resolve font: {0}. The default one will be used instead";
135-
109+
/** The Constant UNABLE_TO_RETRIEVE_FONT. */
110+
public static final String UNABLE_TO_RETRIEVE_FONT = "Unable to retrieve font:\n {0}";
136111
/** The Constant UNABLE_TO_RETRIEVE_IMAGE_FROM_BASE64_SOURCE. */
137112
public static final String UNABLE_TO_RETRIEVE_IMAGE_FROM_BASE64_SOURCE = "Unable to retrieve image from given base64 source string";
138-
139113
/** The Constant UNABLE_TO_RETRIEVE_IMAGE_WITH_GIVEN_BASE_URI. */
140114
public static final String UNABLE_TO_RETRIEVE_IMAGE_WITH_GIVEN_BASE_URI = "Unable to retrieve image with given base URI ({0}) and image source path ({1})";
141-
142-
/** The Constant UNABLE_TO_RETRIEVE_FONT. */
143-
public static final String UNABLE_TO_RETRIEVE_FONT = "Unable to retrieve font:\n {0}";
144-
145115
/** The Constant UNABLE_TO_RETRIEVE_STREAM_WITH_GIVEN_BASE_URI. */
146116
public static final String UNABLE_TO_RETRIEVE_STREAM_WITH_GIVEN_BASE_URI = "Unable to retrieve stream with given base URI ({0}) and source path ({1})";
147-
148117
/** The Constant UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED. */
149118
public static final String UNKNOWN_ABSOLUTE_METRIC_LENGTH_PARSED = "Unknown absolute metric length parsed \"{0}\".";
150-
151119
/** The Constant UNKNOWN_MARGIN_BOX_CHILD. */
152120
public static final String UNKNOWN_MARGIN_BOX_CHILD = "Unknown margin box child";
153-
154121
public static final String UNSUPPORTED_PSEUDO_CSS_SELECTOR = "Unsupported pseudo css selector: {0}";
155-
156-
public static final String URL_IS_NOT_CLOSED_IN_CSS_EXPRESSION = "url function is not properly closed in expression:{0}";
157-
158122
public static final String URL_IS_EMPTY_IN_CSS_EXPRESSION = "url function is empty in expression:{0}";
159-
123+
public static final String URL_IS_NOT_CLOSED_IN_CSS_EXPRESSION = "url function is not properly closed in expression:{0}";
160124
/** The Constant WAS_NOT_ABLE_TO_DEFINE_BACKGROUND_CSS_SHORTHAND_PROPERTIES. */
161125
public static final String WAS_NOT_ABLE_TO_DEFINE_BACKGROUND_CSS_SHORTHAND_PROPERTIES = "Was not able to define one of the background CSS shorthand properties: {0}";
162-
163126
/** The Constant WORKER_UNABLE_TO_PROCESS_IT_S_TEXT_CONTENT. */
164127
public static final String WORKER_UNABLE_TO_PROCESS_IT_S_TEXT_CONTENT = "Worker of type {0} unable to process it's text content";
165-
166128
/** The Constant WORKER_UNABLE_TO_PROCESS_OTHER_WORKER. */
167129
public static final String WORKER_UNABLE_TO_PROCESS_OTHER_WORKER = "Worker of type {0} unable to process {1}";
168130

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

+9-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
This file is part of the iText (R) project.
33
Copyright (c) 1998-2017 iText Group NV
44
Authors: Bruno Lowagie, Paulo Soares, et al.
5-
5+
66
This program is free software; you can redistribute it and/or modify
77
it under the terms of the GNU Affero General Public License version 3
88
as published by the Free Software Foundation with the addition of the
99
following permission added to Section 15 as permitted in Section 7(a):
1010
FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY
1111
ITEXT GROUP. ITEXT GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT
1212
OF THIRD PARTY RIGHTS
13-
13+
1414
This program is distributed in the hope that it will be useful, but
1515
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
1616
or FITNESS FOR A PARTICULAR PURPOSE.
@@ -20,23 +20,23 @@ This file is part of the iText (R) project.
2020
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
2121
Boston, MA, 02110-1301 USA, or download the license from the following URL:
2222
http://itextpdf.com/terms-of-use/
23-
23+
2424
The interactive user interfaces in modified source and object code versions
2525
of this program must display Appropriate Legal Notices, as required under
2626
Section 5 of the GNU Affero General Public License.
27-
27+
2828
In accordance with Section 7(b) of the GNU Affero General Public License,
2929
a covered work must retain the producer line in every PDF that is created
3030
or manipulated using iText.
31-
31+
3232
You can be released from the requirements of the license by purchasing
3333
a commercial license. Buying such a license is mandatory as soon as you
3434
develop commercial activities involving the iText software without
3535
disclosing the source code of your own applications.
3636
These activities include: offering paid services to customers as an ASP,
3737
serving PDFs on the fly in a web application, shipping iText with a closed
3838
source product.
39-
39+
4040
For more information, please contact iText Software Corp. at this
4141
address: sales@itextpdf.com
4242
*/
@@ -63,6 +63,7 @@ This file is part of the iText (R) project.
6363
import com.itextpdf.html2pdf.attach.impl.tags.MetaTagWorker;
6464
import com.itextpdf.html2pdf.attach.impl.tags.PTagWorker;
6565
import com.itextpdf.html2pdf.attach.impl.tags.PageCountWorker;
66+
import com.itextpdf.html2pdf.attach.impl.tags.PageMarginBoxWorker;
6667
import com.itextpdf.html2pdf.attach.impl.tags.PreTagWorker;
6768
import com.itextpdf.html2pdf.attach.impl.tags.SpanTagWorker;
6869
import com.itextpdf.html2pdf.attach.impl.tags.TableFooterTagWorker;
@@ -75,6 +76,7 @@ This file is part of the iText (R) project.
7576
import com.itextpdf.html2pdf.attach.impl.tags.TrTagWorker;
7677
import com.itextpdf.html2pdf.attach.impl.tags.UlOlTagWorker;
7778
import com.itextpdf.html2pdf.css.CssConstants;
79+
import com.itextpdf.html2pdf.css.page.PageMarginBoxContextNode;
7880
import com.itextpdf.html2pdf.css.pseudo.CssPseudoElementUtil;
7981
import com.itextpdf.html2pdf.css.resolve.func.counter.PageCountElementNode;
8082
import com.itextpdf.html2pdf.html.TagConstants;
@@ -208,6 +210,7 @@ private DefaultTagWorkerMapping() {
208210

209211
// custom elements mapping, implementation-specific
210212
workerMapping.putMapping(PageCountElementNode.PAGE_COUNTER_TAG, PageCountWorker.class);
213+
workerMapping.putMapping(PageMarginBoxContextNode.PAGE_MARGIN_BOX_TAG, PageMarginBoxWorker.class);
211214
}
212215

213216
/**

0 commit comments

Comments
 (0)