Skip to content

Commit 1ac07eb

Browse files
author
Guillaume Tâche
committed
Fixes conflict
2 parents 953d23b + f1e5129 commit 1ac07eb

File tree

624 files changed

+10643
-7782
lines changed

Some content is hidden

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

624 files changed

+10643
-7782
lines changed

README.md

+39-22
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ ICEpdf is an open source project and is always looking for more contributors. T
1818
[Wiki](https://github.com/pcorless/icepdf/wiki) pages. Create a pull requests and use the issue tracker, the more
1919
help and feedback we get the better we an make the project.
2020

21+
### Getting the jars, javadoc and source from maven central
22+
```xml
23+
<dependency>
24+
<groupId>com.github.pcorless.icepdf</groupId>
25+
<artifactId>icepdf-core</artifactId>
26+
<version>7.1.1</version>
27+
</dependency>
28+
<dependency>
29+
<groupId>com.github.pcorless.icepdf</groupId>
30+
<artifactId>icepdf-viewer</artifactId>
31+
<version>7.1.1</version>
32+
</dependency>
33+
```
34+
2135
## Getting the Code
2236
To get a local copy of the current code, clone it using git:
2337
```
@@ -30,8 +44,29 @@ $ cd icepdf
3044
component you'll also need to build the Viewer library. The project can be built with Gradle or Maven, we have
3145
no preference, pick which ever one makes you more happy.
3246

33-
Builds as they are currently written work best with Java 8 but they can also be easily configured to work with JDK 11+.
34-
47+
Builds as they are currently configured target Java 11.
48+
49+
#### Building With Maven
50+
```
51+
# core module
52+
~$ mvn -pl :icepdf-core package
53+
54+
# viewer module, -am insures dependencies are build
55+
~$ mvn -pl :icepdf-viewer -am package
56+
57+
# Viewer jar with all dependences in one self executing jar
58+
~$ mvn -pl :icepdf-viewer -am package -P assembly
59+
60+
# examples module, -am insures dependencies are build
61+
~$ mvn -pl :png-capture -am package
62+
# or with full group id.
63+
~$ mvn -pl org.icepdf.examples:png-capture -am package
64+
~$ java -jar icepdf-viewer-7.0.0-SNAPSHOT-jar-with-dependencies.jar
65+
66+
# Whole project hierarchy can be built with or with full group id.
67+
~$ mvn package
68+
69+
```
3570
#### Building With Gradle
3671

3772
Build the core jar using the following Gradle command
@@ -55,24 +90,6 @@ Build the distribution zip and tar archives
5590
~$ gradle projectReport, sourcesJar, genPomFileForCoreJarPub, genPomFileForViewerJarPub, osDistZip, osDistTar
5691
```
5792

58-
#### Building With Maven
59-
```
60-
# core module
61-
~$ mvn -pl :icepdf-core package
62-
63-
# viewer module, -am insures dependencies are build
64-
~$ mvn -pl :icepdf-viewer -am package
65-
66-
# examples module, -am insures dependencies are build
67-
~$ mvn -pl :png-capture -am package
68-
# or with full group id.
69-
~$ mvn -pl org.icepdf.os.examples:png-capture -am package
70-
71-
# Whole project hierarchy can be built with or with full group id.
72-
~$ mvn package
73-
74-
```
75-
7693
## Using ICEpdf Viewer Component
7794
The `org.icepdf.core.ri.common.SwingController` class provides convenience methods for the most common UI actions,
7895
such as rotating the document, setting the zoom level, etc. The `org.icepdf.core.ri.common.SwingViewBuilder` class is
@@ -153,14 +170,14 @@ window.setVisible(true);
153170
controller.openDocument(filePath);
154171
```
155172

156-
Make sure to take a look at the [Wiki](https://github.com/pcorless/icepdf/wiki/Examples) for more examples of extracting content.
173+
Make sure to take a look at the [Wiki](https://github.com/pcorless/icepdf/wiki/Usage-Examples)) for more examples of extracting content.
157174

158175
## Learning
159176

160177
### Examples
161178

162179
There are bunch of examples located in the root of the project grouped by common usage scenarios. Similarly the
163-
Wiki contains [example](https://github.com/pcorless/icepdf/wiki/Examples) information.
180+
Wiki contains [example](https://github.com/pcorless/icepdf/wiki/Usage-Examples) information.
164181

165182
### API Documentation
166183

SECURITY.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
| Version | Supported |
6+
|---------|--------------------|
7+
| 7.0.x | :white_check_mark: |
8+
| < 6.3.2 | :x: |
9+
10+
## Vulnerability Report
11+
12+
Currently, no know threats or vulnerabilities in the library and dependencies.
13+
14+
This statement will be updated after each release to maven central.
15+
Validated using Sonatype Lift

build.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ allprojects {
88
options.addStringOption('Xdoclint:none', '-quiet')
99
}
1010

11+
repositories {
12+
mavenCentral()
13+
}
14+
1115
// show api deprecation
1216
// gradle.projectsEvaluated {
1317
// tasks.withType(JavaCompile) {

core/core-awt/build.gradle

+17-8
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ repositories {
1010

1111
dependencies {
1212
// signature validation.
13-
implementation 'org.bouncycastle:bcprov-jdk15on:' + "${BOUNCY_VERSION}"
1413
implementation 'org.bouncycastle:bcprov-ext-jdk15on:' + "${BOUNCY_VERSION}"
1514
implementation 'org.bouncycastle:bcpkix-jdk15on:' + "${BOUNCY_VERSION}"
1615
// tiff, jpeg2000 and jbig decoding
17-
implementation 'com.twelvemonkeys.imageio:imageio-tiff:' + "${MONKEY_VERSION}"
18-
implementation 'com.github.jai-imageio:jai-imageio-jpeg2000:' + "${JAI_VERSION}"
16+
implementation 'com.twelvemonkeys.imageio:imageio-tiff:' + "${MONKEY_VERSION}"
1917
implementation 'org.apache.pdfbox:jbig2-imageio:' + "${JBIG2_VERSION}"
2018
implementation 'org.apache.pdfbox:fontbox:' + "${FONT_BOX_VERSION}"
2119
implementation 'commons-logging:commons-logging:1.2'
20+
runtimeOnly 'com.github.jai-imageio:jai-imageio-jpeg2000:' + "${JAI_VERSION}"
21+
// tests
22+
testImplementation(platform("org.junit:junit-bom:${JUNIT_BOM_VERSION}"))
23+
testImplementation('org.junit.jupiter:junit-jupiter')
2224
}
2325

2426
// generatePomFileForCoreJarPublication
@@ -35,11 +37,11 @@ publishing {
3537
asNode().appendNode('url', 'https://github.com/pcorless/icepdf')
3638
asNode().appendNode('scm')
3739
.appendNode('connection', 'scm:git:https://github.com/pcorless/icepdf').parent()
38-
.appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.txt').parent()
40+
.appendNode('url', 'https://www.apache.org/licenses/LICENSE-2.0.txt').parent()
3941
.appendNode('tag', 'icepdf-' + version + '-maven')
4042
asNode().appendNode('licenses').appendNode('license').with {
4143
appendNode('name', 'Apache License, Version 2.0')
42-
appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.html')
44+
appendNode('url', 'https://www.apache.org/licenses/LICENSE-2.0.html')
4345
appendNode('distribution', 'repo')
4446
}
4547
asNode().appendNode('issueManagement').with {
@@ -100,18 +102,25 @@ compileJava {
100102
def jenkinsBuild = System.getenv("BUILD_NUMBER") ?: "0"
101103
def jenkinsRevision = System.getenv("SVN_REVISION") ?: "0"
102104

103-
copy{
105+
copy {
104106
from 'src/main/resources/org/icepdf/core/application/ProductInfo.java'
105107
into 'src/main/java/org/icepdf/core/application/'
106108
filter(org.apache.tools.ant.filters.ReplaceTokens,
107109
tokens: [company: COMPANY, product: PRODUCT, version: VERSION, type: RELEASE_TYPE,
108-
build: jenkinsBuild, revision: jenkinsRevision])
110+
build : jenkinsBuild, revision: jenkinsRevision])
109111
}
110112
}
111113
}
112114

115+
test {
116+
useJUnitPlatform()
117+
testLogging {
118+
events "passed", "skipped", "failed"
119+
}
120+
}
121+
113122
clean {
114-
doLast{
123+
doLast {
115124
file("src/main/java/org/icepdf/core/application/ProductInfo.java").delete()
116125
}
117126
}

core/core-awt/pom.xml

+53-34
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,28 @@
11
<?xml version="1.0"?>
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/maven-v4_0_0.xsd">
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
34
<modelVersion>4.0.0</modelVersion>
45
<parent>
56
<groupId>com.github.pcorless.icepdf</groupId>
67
<artifactId>core</artifactId>
7-
<version>7.0.0-SNAPSHOT</version>
8+
<version>7.2.0-SNAPSHOT</version>
89
</parent>
910
<artifactId>icepdf-core</artifactId>
1011
<packaging>jar</packaging>
11-
<name>ICEpdf OS :: Core :: Core Swing/AWT</name>
12+
<name>ICEpdf :: Core :: Core Swing/AWT</name>
1213
<description>
1314
The ICEpdf Common rendering core. Contains AWT based rendering core.
1415
</description>
1516

16-
<licenses>
17-
<license>
18-
<name>Apache License, Version 2.0</name>
19-
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
20-
<distribution>repo</distribution>
21-
</license>
22-
</licenses>
23-
24-
<issueManagement>
25-
<system>github</system>
26-
<url>https://github.com/pcorless/icepdf/issues</url>
27-
</issueManagement>
28-
2917
<build>
30-
<finalName>icepdf-core-${version}</finalName>
3118
<plugins>
3219
<plugin>
3320
<groupId>org.codehaus.mojo</groupId>
3421
<artifactId>templating-maven-plugin</artifactId>
3522
<version>1.0.0</version>
3623
<executions>
3724
<execution>
38-
<id>generate-verion-class</id>
25+
<id>generate-version-class</id>
3926
<goals>
4027
<goal>filter-sources</goal>
4128
</goals>
@@ -44,25 +31,57 @@
4431
</plugin>
4532
<plugin>
4633
<groupId>org.apache.maven.plugins</groupId>
47-
<artifactId>maven-javadoc-plugin</artifactId>
34+
<artifactId>maven-surefire-plugin</artifactId>
4835
<version>3.1.0</version>
49-
<configuration>
50-
<source>8</source>
51-
</configuration>
52-
</plugin>
53-
<plugin>
54-
<artifactId>maven-source-plugin</artifactId>
55-
<executions>
56-
<execution>
57-
<id>attach-sources</id>
58-
<phase>verify</phase>
59-
<goals>
60-
<goal>jar</goal>
61-
</goals>
62-
</execution>
63-
</executions>
6436
</plugin>
6537
</plugins>
6638
</build>
6739

40+
<dependencies>
41+
<!-- Bouncy castle is need for building the core bundles as well as digital signature support -->
42+
<dependency>
43+
<groupId>org.bouncycastle</groupId>
44+
<artifactId>bcprov-ext-jdk15on</artifactId>
45+
</dependency>
46+
47+
<dependency>
48+
<groupId>org.bouncycastle</groupId>
49+
<artifactId>bcpkix-jdk15on</artifactId>
50+
</dependency>
51+
52+
<dependency>
53+
<groupId>com.twelvemonkeys.imageio</groupId>
54+
<artifactId>imageio-tiff</artifactId>
55+
</dependency>
56+
57+
<!-- Embedded font library -->
58+
<dependency>
59+
<groupId>org.apache.pdfbox</groupId>
60+
<artifactId>fontbox</artifactId>
61+
</dependency>
62+
<dependency>
63+
<groupId>commons-logging</groupId>
64+
<artifactId>commons-logging</artifactId>
65+
</dependency>
66+
67+
<!-- JPEG2000 and jbig2 image support -->
68+
<dependency>
69+
<groupId>org.apache.pdfbox</groupId>
70+
<artifactId>jbig2-imageio</artifactId>
71+
</dependency>
72+
<dependency>
73+
<groupId>com.github.jai-imageio</groupId>
74+
<artifactId>jai-imageio-jpeg2000</artifactId>
75+
<scope>provided</scope>
76+
</dependency>
77+
78+
<dependency>
79+
<groupId>org.junit.jupiter</groupId>
80+
<artifactId>junit-jupiter</artifactId>
81+
<version>5.9.3</version>
82+
<scope>test</scope>
83+
</dependency>
84+
85+
</dependencies>
86+
6887
</project>

core/core-awt/src/main/java-templates/ProductInfo.java

-5
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,4 @@ public String getVersion(){
8181
return info.toString();
8282
}
8383

84-
public static void main(String[] args) {
85-
ProductInfo app = new ProductInfo();
86-
System.out.println( app.toString() );
87-
}
88-
8984
}

core/core-awt/src/main/java/org/icepdf/core/Memento.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ public interface Memento {
2929
* Restore the state that was caputred when an instance of this object
3030
* was created.
3131
*/
32-
public void restore();
32+
void restore();
3333
}

core/core-awt/src/main/java/org/icepdf/core/SecurityCallback.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ public interface SecurityCallback {
3434
* @param document document being opened.
3535
* @return received password.
3636
*/
37-
public String requestPassword(Document document);
37+
String requestPassword(Document document);
3838
}

core/core-awt/src/main/java/org/icepdf/core/events/PageImageEvent.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
@SuppressWarnings("serial")
3131
public class PageImageEvent extends PageInitializingEvent {
3232

33-
private int index;
34-
private int total;
35-
private long duration;
33+
private final int index;
34+
private final int total;
35+
private final long duration;
3636

3737
/**
3838
* Construct a new PageImageEvent

core/core-awt/src/main/java/org/icepdf/core/events/PageInitializingEvent.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
@SuppressWarnings("serial")
2424
public class PageInitializingEvent extends java.util.EventObject {
2525

26-
private boolean interrupted;
26+
private final boolean interrupted;
2727

2828
public PageInitializingEvent(Object source, boolean interrupted) {
2929
super(source);

core/core-awt/src/main/java/org/icepdf/core/io/BitStream.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class BitStream {
4040
boolean readEOF;
4141

4242
// making value
43-
private static final int masks[] = new int[32];
43+
private static final int[] masks = new int[32];
4444

4545
static {
4646
for (int i = 0; i < 32; i++) {
@@ -148,7 +148,7 @@ public int available() throws IOException {
148148
return 1;
149149
}
150150

151-
public void skipByte() throws IOException {
151+
public void skipByte() {
152152
bits_left = 0;
153153
bits = 0;
154154
}

0 commit comments

Comments
 (0)