Skip to content

Commit bdddc61

Browse files
committed
[RELEASE] iText 7 Core - 7.1.12
https://github.com/itext/itext7/releases/tag/7.1.12 * release/7.1.12: [RELEASE] 7.1.12-SNAPSHOT -> 7.1.12 Remove outdated TODOs in TableRenderer Fix ClipperBridge javadoc warnings Register pdfOcr events on kernel level. Treat inner namespaces in ContextManager correctly Remove TODOs in Lab and IccBased colors Add check for pdf names in pdfa Enable khmer and lao word wrapping Add missed doc for exceptions in xmp package Add color spots number check Set zero or negative size log message level to INFO for drawBackground method Fix javadoc warnings Deprecate svg node renderer mapper interface Fix javadoc for TIFFDirectory and TIFFField Add check for number values in pdfa module Add tests for table elements with HorizontalAlignment Add runProcessAndWait method overload and coresponding unit test Update message formatting in SvgConverterIntegrationTest Add check for length of arrays and dictionaries Add check for String lengths in PDFA module Remove ToDo in PdfA1GraphicsTest#transparencyCheckTest1() Add HEIGHT constant to CssDefaults Remove TODO from isiText5licenseLoaded method Add missing copyright headers Add calculating path and text bounding box in SVG Add tests for applying SVG linear gradient to different types of path elements Add PdfDocument as an argument for build linear gradient Add new PdfStreamTest class, new PdfStructTreeRootTest#severalSameElementsInStructTreeRootTest Fix several kernel/pdf/canvas javadoc warnings Add missing copyright headers Fix NullPointerException in AbstractRenderer class and update createXObject method Add missing copyright headers Add shorthand text decoration support Add convenience methods to increase and decrease widths of rectangle in chain Attach JIRA ticket to TODO in SvgConverterUnitTest Linear Gradient update to handle pad properly, Css gradient parsing fix, tests updates Fix problem with desc coordinates domain for gradient Add linear gradient support to ListStyleShorthandResolver class Add ticket references to TODO remarks Add missing copyright headers Special scripts word wrapping support Fix BUILDING.MD Add background image support for text elements for layout module Add test on bug with one coordinate in <tspan> Add SXP linear-gradient tests Improve several kernel/pdf javadocs Improve several kernel JavaDocs Add missing javadocs Fix PdfFileSpec javadoc warnings Add private constгuctor to PdfCanvasConstants to prevent instantation Add missing copyright headers Linear gradient logic Add test on marker parent issue Add check of marker x,y attributes Add test on resolving styles with relative units Change in Jenkinsfile to abort possible already running automatic builds Improve several javadocs in kernel module Fix javadoc for PdfWriter and ReaderProperties Add javadoc for thrown exceptions in CompareTool Add explicit cast Add resourcesCategoryDictionarySetModifiedTest and add minor improvements Fixing issue with font embedding in append mode Add ticket references to TODO-s Remove recordIssues from Jenkinsfile Update notice file Fix javadoc warnings Add missing copyright headers Move WeirdCharactersTest from html2pdf Add exception if no previous shape for smooth curve specified Fix ptoblem with entries in cross-reference stream Adjust some tests in SvgStyleResolverIntegrationTest Update .mailmap Fix several iTextCore javadoc issues Add check if order key presented to PDFA2 and PDFA3 validation Fix PdfViewerPreferences javadoc issues Add tests for kernel.pdf.collection package Add ticket references to toDo remarks Update ToDo remarks in TextSvgBranchRenderer Update CompareTool and fix float precision issues Add missing copyright headers Fix JavaDoc for pdf annotation classes Improve Style documentation and tests Remove ToDo Remove ToDo Remove obsolete toDo remark Fix an issue with splitRenderer having less content than needed when the result is NOTHING Add missing copyright headers Add new Pdf20SigningTest#signExistingFieldWhenDirectAcroformAndNoSigFlagTest Remove clirr-maven-plugin Fix division by zero Add preserveAspectRatio support for images Delete TODO about pseudo-elements in SVG Minor Javadoc fix Remove obsolete toDo remark Add ticket references to toDos Always copy link annotation on draw Remove an unused cmp file Remove obsolete todo Add new tests for creating entries for xref stream Update ToDo remark in BackgroundShorthandResolver Disallow removing flushed pages for tagged documents or documents with acroforms Log warnings in case we need to reset "full compression" setting in append mode Move, refactor merge tests from samples internal repository Add deprecated tag to TextRenderer JavaDoc Fix problem with numerous replaceSpecialWhitespaceGlyhs method calls Add test for not fitted footer in large table Document TableBorder's fields Introduce dedicated tests for axial and radial shadings Add missing copyright headers Add tests to improve code coverage Don't move the whole element to the next area in case its first children cannot be kept together Remove ToDo remark in PdfFormField#drawPdfA1CheckAppearance Fix large table split Add DEVSIX within todo remark Change comment Delete duplicate test Fix bug with text vertical alignment in choice fields Improve imagemagick constants Add DocumentSerializationTest class Optimize replaceSpecialWhitespaceGlyphs method Make image type validation more concise Deprecate unneeded size field in BmpImageData and associated constructors/creators Improve coverage on existing code Introduce ImageTypeDetector class for detecting image types from magic bytes Add missing copyright headers Add some TODO remarks related to COLLAPSING_MARGINS + KEEP_TOGETHER processing Introduce RootRendererStateHandler to process going back and forward. Improve tagging and processing of flushed waiting elements. Refactor storing mechanism Add tests which shows that floats work incorectly with KEEP_TOGETHER Improve ReplaceSpecialWhitespaceGlyphs method performance Discard builds depending on the branch in the Jenkinsfile Add new test to increase code coverage Add possibility to remove outlines in public API Update ToDo remarks in styled-xml-parser module Fix bug with glyph width for PdfType3Font Resolve RND todo remarks Remove obsolete TODOs Improve TIFFLZWDecoder JavaDoc Update TODO in svg Improve documentation for Path class Add missing copyright headers Add TextPreprocessingUtil class and unit test Add new tests Add JPXDecode image extracting test Improve LocationTextExtractionStrategyTest so that it could be ported automatically Reuse the same instance of ResourceResolver in SVG processing Update ToDo remarks Delete TODO Update TODOs in tests about overflow caused by margin/padding/borders Remove TODO-leftovers. Update TODOs with obsolete ticket IDs Add DEVSIX to a TODO Refactor tests after fix, remove Todo remarks Add several unicodes one glyph test Fix a bunch of javadoc errors in XFDF module Review TODOs in svg/src/main/java/com/itextpdf/svg/css/impl Use nightly updated NVD database for dependency-check-maven Fix a bunch of Javadoc warnings in io module Refactoring: remove redundant entries from pom files Move pitest to its own profile Move ImageTest from samples internal repository Remove obsolete TODO Add DR font tests from samples internal repository Add a TODO to indicate in the code known font-family parsing issue Added test and todos for constants Fix layout-related javadoc warnings Fix PdfReader javadoc errors Fix modifing direct acroform in append mode Tests for big stroke for circle and ellipse in svg Add several new tests Add FreeReferencesTest#readingXrefWithLotsOfFreeObjTest Add InheritedPageEntriesTest#copySeveralPagesToDocumentWithInheritedPageRotationTest [RELEASE] Update dependency versions Revert 'protected' FontSelectorStrategy#tempFonts field renaming Add missing copyright headers Remove unused svg.TestUtil class Refactor tests in DefsSvgNodeRendererUnitTest class Add missing copyright headers Add XrefStreamIncrementalUpdatesReadingTest#freeRefReusingInAppendModeTest
2 parents 4a35017 + 6cd3d7c commit bdddc61

File tree

813 files changed

+23079
-2679
lines changed

Some content is hidden

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

813 files changed

+23079
-2679
lines changed

.mailmap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ Peter Goodman <[email protected]> <[email protected]
6464
6565
6666
67-
6867
6968
7069

BUILDING.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,28 @@ $ mvn clean install \
77
> >(tee mvn.log) 2> >(tee mvn-error.log >&2)
88
```
99

10-
To run the tests, [Ghostscript][2] and [Imagemagick][3] must be installed.
10+
Please note that tests are not run in default profile. To run tests, [Ghostscript][2] and [Imagemagick][3] must be installed.
11+
Some of the tests compare generated PDF files with template files that show the correct results, and these tools are used to
12+
visually compare PDF files. Ghostscript is required to render PDF files into images and Imagemagick is used to compare image data.
13+
There are two options for running tests:
14+
1. Pass Ghostscript and Imagemagick compare commands as ITEXT_GS_EXEC and ITEXT_MAGICK_COMPARE_EXEC environment variables, respectively
15+
(Ghostscript and Imagemagick folders must be added to PATH environment variable). This option is suitable for both Windows and Unix systems.
16+
The syntax of commands depends on installed Ghostscript and Imagemagick versions (`gs`, `gswin64c`, `magick compare`).
17+
2. Pass the paths to Ghostscript and Imagemagick compare execution files as ITEXT_GS_EXEC and ITEXT_MAGICK_COMPARE_EXEC
18+
environment variables. Examples of paths on Windows:
19+
- `C:\Program Files\gs\gs9.26\bin\gswin64c.exe`
20+
- `C:\Program Files\ImageMagick-7.0.9-Q16\compare.exe`
21+
22+
If you have a new version of ImageMagick, then there is no compare.exe utility there, wrap the path to magick.exe in quotes and call compare command:
23+
ITEXT_MAGICK_COMPARE_EXEC=`"C:\Program Files\ImageMagick-7.0.9-Q16\magick.exe" compare`
24+
25+
To run build with tests, activate the `test` profile and pass ITEXT_GS_EXEC and ITEXT_MAGICK_COMPARE_EXEC environment variables:
1126
```bash
1227
$ mvn clean install \
28+
-P test \
1329
-Dmaven.test.failure.ignore=false \
14-
-DgsExec=$(which gs) \
15-
-DcompareExec=$(which compare) \
30+
-DITEXT_GS_EXEC="gs command" \
31+
-DITEXT_MAGICK_COMPARE_EXEC="magick compare command" \
1632
> >(tee mvn.log) 2> >(tee mvn-error.log >&2)
1733
```
1834

Jenkinsfile

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
11
#!/usr/bin/env groovy
22
@Library('pipeline-library')_
33

4-
def schedule, sonarBranchName, sonarBranchTarget
5-
switch (env.BRANCH_NAME) {
6-
case ~/.*master.*/:
7-
schedule = '@monthly'
8-
sonarBranchName = '-Dsonar.branch.name=master'
9-
sonarBranchTarget = ''
10-
break
11-
case ~/.*develop.*/:
12-
schedule = '@midnight'
13-
sonarBranchName = '-Dsonar.branch.name=develop'
14-
sonarBranchTarget = '-Dsonar.branch.target=master'
15-
break
16-
default:
17-
schedule = ''
18-
sonarBranchName = '-Dsonar.branch.name=' + env.BRANCH_NAME
19-
sonarBranchTarget = '-Dsonar.branch.target=develop'
20-
break
21-
}
4+
def vars = setBranchDependentVars(env.BRANCH_NAME)
225

236
pipeline {
247

@@ -30,15 +13,22 @@ pipeline {
3013

3114
options {
3215
ansiColor('xterm')
33-
buildDiscarder(logRotator(artifactNumToKeepStr: '1'))
16+
buildDiscarder(
17+
logRotator(
18+
numToKeepStr: vars.buildNumToKeep,
19+
artifactNumToKeepStr: vars.buildArtifactNumToKeep,
20+
daysToKeepStr: vars.buildDaysToKeep,
21+
artifactDaysToKeepStr: vars.buildArtifactDaysToKeep
22+
)
23+
)
3424
parallelsAlwaysFailFast()
3525
skipStagesAfterUnstable()
3626
timeout(time: 2, unit: 'HOURS')
3727
timestamps()
3828
}
3929

4030
triggers {
41-
cron(schedule)
31+
cron(vars.schedule)
4232
}
4333

4434
tools {
@@ -47,6 +37,13 @@ pipeline {
4737
}
4838

4939
stages {
40+
stage('Abort possible previous builds') {
41+
steps {
42+
script {
43+
abortPreviousBuilds()
44+
}
45+
}
46+
}
5047
stage('Build') {
5148
options {
5249
retry(2)
@@ -90,11 +87,6 @@ pipeline {
9087
withMaven(jdk: "${JDK_VERSION}", maven: 'M3', mavenLocalRepo: '.repository') {
9188
sh 'mvn --no-transfer-progress verify --activate-profiles qa -Dpmd.analysisCache=true'
9289
}
93-
recordIssues(tools: [
94-
checkStyle(),
95-
pmdParser(),
96-
spotBugs(useRankAsPriority: true)
97-
])
9890
dependencyCheckPublisher pattern: 'target/dependency-check-report.xml'
9991
}
10092
}
@@ -105,7 +97,7 @@ pipeline {
10597
steps {
10698
withMaven(jdk: "${JDK_VERSION}", maven: 'M3', mavenLocalRepo: '.repository') {
10799
withSonarQubeEnv('Sonar') {
108-
sh 'mvn --no-transfer-progress --activate-profiles test -DgsExec="${gsExec}" -DcompareExec="${compareExec}" -Dmaven.main.skip=true -Dmaven.test.failure.ignore=false org.jacoco:jacoco-maven-plugin:prepare-agent verify org.jacoco:jacoco-maven-plugin:report -Dsonar.java.spotbugs.reportPaths="target/spotbugs.xml" sonar:sonar ' + sonarBranchName + ' ' + sonarBranchTarget
100+
sh "mvn --no-transfer-progress --activate-profiles test -DgsExec=\"$gsExec\" -DcompareExec=\"$compareExec\" -Dmaven.main.skip=true -Dmaven.test.failure.ignore=false org.jacoco:jacoco-maven-plugin:prepare-agent verify org.jacoco:jacoco-maven-plugin:report -Dsonar.java.spotbugs.reportPaths=\"target/spotbugs.xml\" sonar:sonar $vars.sonarBranchName $vars.sonarBranchTarget"
109101
}
110102
}
111103
}
@@ -198,14 +190,14 @@ pipeline {
198190
}
199191
fixed {
200192
script {
201-
if (env.BRANCH_NAME.contains('master') || env.BRANCH_NAME.contains('develop')) {
193+
if (vars.notifySlack) {
202194
slackNotifier("#ci", currentBuild.currentResult, "${env.BRANCH_NAME} - Back to normal")
203195
}
204196
}
205197
}
206198
regression {
207199
script {
208-
if (env.BRANCH_NAME.contains('master') || env.BRANCH_NAME.contains('develop')) {
200+
if (vars.notifySlack) {
209201
slackNotifier("#ci", currentBuild.currentResult, "${env.BRANCH_NAME} - First failure")
210202
}
211203
}

barcodes/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.itextpdf</groupId>
66
<artifactId>root</artifactId>
7-
<version>7.1.11</version>
7+
<version>7.1.12</version>
88
</parent>
99
<artifactId>barcodes</artifactId>
1010
<name>iText 7 - barcodes</name>

font-asian/pom.xml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.itextpdf</groupId>
66
<artifactId>root</artifactId>
7-
<version>7.1.11</version>
7+
<version>7.1.12</version>
88
</parent>
99
<artifactId>font-asian</artifactId>
1010
<name>iText 7 - Asian fonts</name>
@@ -21,33 +21,26 @@
2121
<build>
2222
<plugins>
2323
<plugin>
24-
<groupId>org.apache.maven.plugins</groupId>
2524
<artifactId>maven-failsafe-plugin</artifactId>
26-
<version>${failsafe.version}</version>
2725
<configuration>
2826
<skip>true</skip>
2927
</configuration>
3028
</plugin>
3129
<plugin>
32-
<groupId>org.apache.maven.plugins</groupId>
3330
<artifactId>maven-javadoc-plugin</artifactId>
34-
<version>${javadoc.version}</version>
3531
<configuration>
3632
<skip>true</skip>
3733
</configuration>
3834
</plugin>
3935
<plugin>
40-
<groupId>org.apache.maven.plugins</groupId>
4136
<artifactId>maven-surefire-plugin</artifactId>
42-
<version>${surefire.version}</version>
4337
<configuration>
4438
<skip>true</skip>
4539
</configuration>
4640
</plugin>
4741
<plugin>
4842
<groupId>org.pitest</groupId>
4943
<artifactId>pitest-maven</artifactId>
50-
<version>${pitest.version}</version>
5144
<configuration>
5245
<skip>true</skip>
5346
</configuration>

forms/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>com.itextpdf</groupId>
66
<artifactId>root</artifactId>
7-
<version>7.1.11</version>
7+
<version>7.1.12</version>
88
</parent>
99
<artifactId>forms</artifactId>
1010
<name>iText 7 - forms</name>

forms/src/main/java/com/itextpdf/forms/PdfAcroForm.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -730,10 +730,9 @@ public void flattenFields() {
730730
PdfDictionary parent = fieldObject.getAsDictionary(PdfName.Parent);
731731
if (parent != null) {
732732
PdfArray kids = parent.getAsArray(PdfName.Kids);
733-
if(kids!=null) {
733+
if (kids != null) {
734734
kids.remove(fieldObject);
735-
// TODO what if parent was in it's turn the only child of it's parent (parent of parent)?
736-
// shouldn't we remove them recursively? check it
735+
// TODO DEVSIX-2715 if parent was in it's turn the only child of it's parent, we should remove them recursively
737736
if (kids.isEmpty()) {
738737
fFields.remove(parent);
739738
}
@@ -976,7 +975,7 @@ private void addWidgetAnnotationToPage(PdfPage page, PdfAnnotation annot) {
976975
boolean tagged = page.getDocument().isTagged();
977976
if (tagged) {
978977
tagPointer = page.getDocument().getTagStructureContext().getAutoTaggingPointer();
979-
//TODO attributes?
978+
//TODO DEVSIX-4117 PrintField attributes
980979
tagPointer.addTag(StandardRoles.FORM);
981980
}
982981

@@ -1036,6 +1035,16 @@ public void release() {
10361035
fields = null;
10371036
}
10381037

1038+
@Override
1039+
public PdfObjectWrapper<PdfDictionary> setModified() {
1040+
if (getPdfObject().getIndirectReference() != null) {
1041+
super.setModified();
1042+
} else {
1043+
document.getCatalog().setModified();
1044+
}
1045+
return this;
1046+
}
1047+
10391048
private static PdfDictionary createAcroFormDictionaryByFields(PdfArray fields) {
10401049
PdfDictionary dictionary = new PdfDictionary();
10411050
dictionary.put(PdfName.Fields, fields);

forms/src/main/java/com/itextpdf/forms/fields/PdfFormField.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ This file is part of the iText (R) project.
8989
import com.itextpdf.kernel.pdf.xobject.PdfImageXObject;
9090
import com.itextpdf.layout.Canvas;
9191
import com.itextpdf.layout.Style;
92+
import com.itextpdf.layout.element.Div;
9293
import com.itextpdf.layout.element.Paragraph;
9394
import com.itextpdf.layout.element.Text;
9495
import com.itextpdf.layout.layout.LayoutArea;
@@ -2608,11 +2609,17 @@ private void drawChoiceAppearance(Rectangle rect, float fontSize, String value,
26082609

26092610
Canvas modelCanvas = new Canvas(canvas, new Rectangle(3, 0, Math.max(0, width - widthBorder), Math.max(0, height - heightBorder)));
26102611
modelCanvas.setProperty(Property.APPEARANCE_STREAM_LAYOUT, true);
2612+
Div div = new Div();
2613+
if(getFieldFlag(PdfChoiceFormField.FF_COMBO)) {
2614+
div.setVerticalAlignment(VerticalAlignment.MIDDLE);
2615+
}
2616+
div.setHeight(Math.max(0, height - heightBorder));
26112617
for (int index = 0; index < strings.size(); index++) {
26122618
Boolean isFull = modelCanvas.getRenderer().getPropertyAsBoolean(Property.FULL);
26132619
if (Boolean.TRUE.equals(isFull)) {
26142620
break;
26152621
}
2622+
26162623
Paragraph paragraph = new Paragraph(strings.get(index)).setFont(font).setFontSize(fontSize).setMargins(0, 0, 0, 0).setMultipliedLeading(1);
26172624
paragraph.setProperty(Property.FORCED_PLACEMENT, true);
26182625
paragraph.setTextAlignment(convertJustificationToTextAlignment());
@@ -2636,8 +2643,9 @@ private void drawChoiceAppearance(Rectangle rect, float fontSize, String value,
26362643
}
26372644
}
26382645
}
2639-
modelCanvas.add(paragraph);
2646+
div.add(paragraph);
26402647
}
2648+
modelCanvas.add(div);
26412649
canvas.
26422650
restoreState().
26432651
endVariableText();
@@ -2891,15 +2899,15 @@ protected void drawPdfA2CheckAppearance(float width, float height, String onStat
28912899
}
28922900

28932901
/**
2902+
* Draws PDF/A-1 compliant check appearance.
2903+
*
28942904
* @param width width of the checkbox
28952905
* @param height height of the checkbox
28962906
* @param selectedValue the selected value of the checkbox which determines the appearance of the checkbox
28972907
* @param checkType the type that determines how the checkbox will look like. Allowed values are {@value TYPE_CHECK},
28982908
* {@value TYPE_CIRCLE}, {@value TYPE_CROSS}, {@value TYPE_DIAMOND}, {@value TYPE_SQUARE}, {@value TYPE_STAR}
28992909
* @deprecated use {@link #drawPdfA2CheckAppearance(float, float, String, int)} instead.
29002910
*/
2901-
// TODO when removing the method: check {@link #drawCheckBox(PdfCanvas, float, float, float, boolean)} and consider
2902-
// removing last redundant "on" parameter
29032911
@Deprecated
29042912
protected void drawPdfA1CheckAppearance(float width, float height, String selectedValue, int checkType) {
29052913
PdfStream stream = (PdfStream) new PdfStream().makeIndirect(getDocument());

0 commit comments

Comments
 (0)