Skip to content

Commit

Permalink
Fixes conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Tâche committed Jul 25, 2023
2 parents bd4c31b + f1e5129 commit 41341be
Show file tree
Hide file tree
Showing 624 changed files with 10,653 additions and 7,796 deletions.
61 changes: 39 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@ ICEpdf is an open source project and is always looking for more contributors. T
[Wiki](https://github.com/pcorless/icepdf/wiki) pages. Create a pull requests and use the issue tracker, the more
help and feedback we get the better we an make the project.

### Getting the jars, javadoc and source from maven central
```xml
<dependency>
<groupId>com.github.pcorless.icepdf</groupId>
<artifactId>icepdf-core</artifactId>
<version>7.1.1</version>
</dependency>
<dependency>
<groupId>com.github.pcorless.icepdf</groupId>
<artifactId>icepdf-viewer</artifactId>
<version>7.1.1</version>
</dependency>
```

## Getting the Code
To get a local copy of the current code, clone it using git:
```
Expand All @@ -30,8 +44,29 @@ $ cd icepdf
component you'll also need to build the Viewer library. The project can be built with Gradle or Maven, we have
no preference, pick which ever one makes you more happy.

Builds as they are currently written work best with Java 8 but they can also be easily configured to work with JDK 11+.

Builds as they are currently configured target Java 11.

#### Building With Maven
```
# core module
~$ mvn -pl :icepdf-core package
# viewer module, -am insures dependencies are build
~$ mvn -pl :icepdf-viewer -am package
# Viewer jar with all dependences in one self executing jar
~$ mvn -pl :icepdf-viewer -am package -P assembly
# examples module, -am insures dependencies are build
~$ mvn -pl :png-capture -am package
# or with full group id.
~$ mvn -pl org.icepdf.examples:png-capture -am package
~$ java -jar icepdf-viewer-7.0.0-SNAPSHOT-jar-with-dependencies.jar
# Whole project hierarchy can be built with or with full group id.
~$ mvn package
```
#### Building With Gradle

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

#### Building With Maven
```
# core module
~$ mvn -pl :icepdf-core package
# viewer module, -am insures dependencies are build
~$ mvn -pl :icepdf-viewer -am package
# examples module, -am insures dependencies are build
~$ mvn -pl :png-capture -am package
# or with full group id.
~$ mvn -pl org.icepdf.os.examples:png-capture -am package
# Whole project hierarchy can be built with or with full group id.
~$ mvn package
```

## Using ICEpdf Viewer Component
The `org.icepdf.core.ri.common.SwingController` class provides convenience methods for the most common UI actions,
such as rotating the document, setting the zoom level, etc. The `org.icepdf.core.ri.common.SwingViewBuilder` class is
Expand Down Expand Up @@ -153,14 +170,14 @@ window.setVisible(true);
controller.openDocument(filePath);
```

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

## Learning

### Examples

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

### API Documentation

Expand Down
15 changes: 15 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Security Policy

## Supported Versions

| Version | Supported |
|---------|--------------------|
| 7.0.x | :white_check_mark: |
| < 6.3.2 | :x: |

## Vulnerability Report

Currently, no know threats or vulnerabilities in the library and dependencies.

This statement will be updated after each release to maven central.
Validated using Sonatype Lift
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ allprojects {
options.addStringOption('Xdoclint:none', '-quiet')
}

repositories {
mavenCentral()
}

// show api deprecation
// gradle.projectsEvaluated {
// tasks.withType(JavaCompile) {
Expand Down
25 changes: 17 additions & 8 deletions core/core-awt/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ repositories {

dependencies {
// signature validation.
implementation 'org.bouncycastle:bcprov-jdk15on:' + "${BOUNCY_VERSION}"
implementation 'org.bouncycastle:bcprov-ext-jdk15on:' + "${BOUNCY_VERSION}"
implementation 'org.bouncycastle:bcpkix-jdk15on:' + "${BOUNCY_VERSION}"
// tiff, jpeg2000 and jbig decoding
implementation 'com.twelvemonkeys.imageio:imageio-tiff:' + "${MONKEY_VERSION}"
implementation 'com.github.jai-imageio:jai-imageio-jpeg2000:' + "${JAI_VERSION}"
implementation 'com.twelvemonkeys.imageio:imageio-tiff:' + "${MONKEY_VERSION}"
implementation 'org.apache.pdfbox:jbig2-imageio:' + "${JBIG2_VERSION}"
implementation 'org.apache.pdfbox:fontbox:' + "${FONT_BOX_VERSION}"
implementation 'commons-logging:commons-logging:1.2'
runtimeOnly 'com.github.jai-imageio:jai-imageio-jpeg2000:' + "${JAI_VERSION}"
// tests
testImplementation(platform("org.junit:junit-bom:${JUNIT_BOM_VERSION}"))
testImplementation('org.junit.jupiter:junit-jupiter')
}

// generatePomFileForCoreJarPublication
Expand All @@ -35,11 +37,11 @@ publishing {
asNode().appendNode('url', 'https://github.com/pcorless/icepdf')
asNode().appendNode('scm')
.appendNode('connection', 'scm:git:https://github.com/pcorless/icepdf').parent()
.appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.txt').parent()
.appendNode('url', 'https://www.apache.org/licenses/LICENSE-2.0.txt').parent()
.appendNode('tag', 'icepdf-' + version + '-maven')
asNode().appendNode('licenses').appendNode('license').with {
appendNode('name', 'Apache License, Version 2.0')
appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.html')
appendNode('url', 'https://www.apache.org/licenses/LICENSE-2.0.html')
appendNode('distribution', 'repo')
}
asNode().appendNode('issueManagement').with {
Expand Down Expand Up @@ -100,18 +102,25 @@ compileJava {
def jenkinsBuild = System.getenv("BUILD_NUMBER") ?: "0"
def jenkinsRevision = System.getenv("SVN_REVISION") ?: "0"

copy{
copy {
from 'src/main/resources/org/icepdf/core/application/ProductInfo.java'
into 'src/main/java/org/icepdf/core/application/'
filter(org.apache.tools.ant.filters.ReplaceTokens,
tokens: [company: COMPANY, product: PRODUCT, version: VERSION, type: RELEASE_TYPE,
build: jenkinsBuild, revision: jenkinsRevision])
build : jenkinsBuild, revision: jenkinsRevision])
}
}
}

test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}

clean {
doLast{
doLast {
file("src/main/java/org/icepdf/core/application/ProductInfo.java").delete()
}
}
87 changes: 53 additions & 34 deletions core/core-awt/pom.xml
Original file line number Diff line number Diff line change
@@ -1,41 +1,28 @@
<?xml version="1.0"?>
<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">
<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 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.github.pcorless.icepdf</groupId>
<artifactId>core</artifactId>
<version>7.0.0-SNAPSHOT</version>
<version>7.2.0-SNAPSHOT</version>
</parent>
<artifactId>icepdf-core</artifactId>
<packaging>jar</packaging>
<name>ICEpdf OS :: Core :: Core Swing/AWT</name>
<name>ICEpdf :: Core :: Core Swing/AWT</name>
<description>
The ICEpdf Common rendering core. Contains AWT based rendering core.
</description>

<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<issueManagement>
<system>github</system>
<url>https://github.com/pcorless/icepdf/issues</url>
</issueManagement>

<build>
<finalName>icepdf-core-${version}</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>templating-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>generate-verion-class</id>
<id>generate-version-class</id>
<goals>
<goal>filter-sources</goal>
</goals>
Expand All @@ -44,23 +31,8 @@
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<source>8</source>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -73,4 +45,51 @@
</plugins>
</build>

<dependencies>
<!-- Bouncy castle is need for building the core bundles as well as digital signature support -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-ext-jdk15on</artifactId>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
</dependency>

<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-tiff</artifactId>
</dependency>

<!-- Embedded font library -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>fontbox</artifactId>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>

<!-- JPEG2000 and jbig2 image support -->
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>jbig2-imageio</artifactId>
</dependency>
<dependency>
<groupId>com.github.jai-imageio</groupId>
<artifactId>jai-imageio-jpeg2000</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.3</version>
<scope>test</scope>
</dependency>

</dependencies>

</project>
5 changes: 0 additions & 5 deletions core/core-awt/src/main/java-templates/ProductInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,4 @@ public String getVersion(){
return info.toString();
}

public static void main(String[] args) {
ProductInfo app = new ProductInfo();
System.out.println( app.toString() );
}

}
2 changes: 1 addition & 1 deletion core/core-awt/src/main/java/org/icepdf/core/Memento.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ public interface Memento {
* Restore the state that was caputred when an instance of this object
* was created.
*/
public void restore();
void restore();
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ public interface SecurityCallback {
* @param document document being opened.
* @return received password.
*/
public String requestPassword(Document document);
String requestPassword(Document document);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
@SuppressWarnings("serial")
public class PageImageEvent extends PageInitializingEvent {

private int index;
private int total;
private long duration;
private final int index;
private final int total;
private final long duration;

/**
* Construct a new PageImageEvent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@SuppressWarnings("serial")
public class PageInitializingEvent extends java.util.EventObject {

private boolean interrupted;
private final boolean interrupted;

public PageInitializingEvent(Object source, boolean interrupted) {
super(source);
Expand Down
4 changes: 2 additions & 2 deletions core/core-awt/src/main/java/org/icepdf/core/io/BitStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class BitStream {
boolean readEOF;

// making value
private static final int masks[] = new int[32];
private static final int[] masks = new int[32];

static {
for (int i = 0; i < 32; i++) {
Expand Down Expand Up @@ -148,7 +148,7 @@ public int available() throws IOException {
return 1;
}

public void skipByte() throws IOException {
public void skipByte() {
bits_left = 0;
bits = 0;
}
Expand Down
Loading

0 comments on commit 41341be

Please sign in to comment.