Skip to content

Commit

Permalink
Merge branch 'master' into read_version_from_manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
asturio authored Nov 17, 2017
2 parents c256a30 + 5acba6e commit 1e30191
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 16 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

OpenPDF is a Java library for creating and editing PDF files with a LGPL and MPL open source license. OpenPDF is based on a fork of iText 4. We welcome contributions from other developers. Please feel free to submit pull-requests and bugreports to this GitHub repository.

[![Join the chat at https://gitter.im/LibrePDF/OpenPDF](https://badges.gitter.im/LibrePDF/OpenPDF.svg)](https://gitter.im/LibrePDF/OpenPDF) [![Build Status](https://api.travis-ci.org/LibrePDF/OpenPDF.png)](https://travis-ci.org/LibrePDF/OpenPDF) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.librepdf/openpdf/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.librepdf/openpdf) [![License (LGPL version 3.0)](https://img.shields.io/badge/license-GNU%20LGPL%20version%203.0-blue.svg?style=flat-square)](http://opensource.org/licenses/LGPL-3.0) [![License (MPL)](https://img.shields.io/badge/license-Mozilla%20Public%20License-yellow.svg?style=flat-square)](http://opensource.org/licenses/MPL-2.0)
[![Join the chat at https://gitter.im/LibrePDF/OpenPDF](https://badges.gitter.im/LibrePDF/OpenPDF.svg)](https://gitter.im/LibrePDF/OpenPDF) [![Build Status](https://travis-ci.org/LibrePDF/OpenPDF.svg?branch=master)](https://travis-ci.org/LibrePDF/OpenPDF) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.librepdf/openpdf/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.librepdf/openpdf) [![License (LGPL version 3.0)](https://img.shields.io/badge/license-GNU%20LGPL%20version%203.0-blue.svg?style=flat-square)](http://opensource.org/licenses/LGPL-3.0) [![License (MPL)](https://img.shields.io/badge/license-Mozilla%20Public%20License-yellow.svg?style=flat-square)](http://opensource.org/licenses/MPL-2.0)

## OpenPDF version 1.0.4 released 2017-10-11 ##
Get version 1.0.4 here - https://github.com/LibrePDF/OpenPDF/releases/tag/1.0.4
## OpenPDF version 1.0.5 released 2017-11-16 ##
Get version 1.0.5 here - https://github.com/LibrePDF/OpenPDF/releases/tag/1.0.5

### Previous Versions
- [Version 1.0.4](https://github.com/LibrePDF/OpenPDF/releases/tag/1.0.4) _released 2017-10-11_
- [Version 1.0.3](https://github.com/LibrePDF/OpenPDF/releases/tag/1.0.3) _released 2017-07-24_
- [Version 1.0.2](https://github.com/LibrePDF/OpenPDF/releases/tag/1.0.2) _released 2017-06-03_
- [Version 1.0.1](https://github.com/LibrePDF/OpenPDF/releases/tag/1.0.1) _released 2017-01-28_
Expand All @@ -26,7 +27,7 @@ Add this to your pom.xml file:
<dependency>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf</artifactId>
<version>1.0.4</version>
<version>1.0.5</version>
</dependency>


Expand All @@ -52,7 +53,7 @@ Release the hounds! Please send all pull requests.

### Required: ###

- BouncyCastle 1.57
- BouncyCastle 1.58
- Provider
- PKIX/CMS
- PDFRenderer
Expand Down
2 changes: 1 addition & 1 deletion openpdf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf-parent</artifactId>
<version>1.0.5-SNAPSHOT</version>
<version>1.0.6-SNAPSHOT</version>
</parent>

<artifactId>openpdf</artifactId>
Expand Down
18 changes: 15 additions & 3 deletions openpdf/src/main/java/com/lowagie/text/pdf/XfaForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.Collection;
import java.util.EmptyStackException;
Expand All @@ -67,9 +67,9 @@
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

Expand Down Expand Up @@ -148,6 +148,12 @@ else if (xfa instanceof PRStream) {
DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
fact.setNamespaceAware(true);
DocumentBuilder db = fact.newDocumentBuilder();
db.setEntityResolver(new EntityResolver() {
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
return new InputSource(new StringReader(""));
}
});
domDocument = db.parse(new ByteArrayInputStream(bout.toByteArray()));
extractNodes();
}
Expand Down Expand Up @@ -1119,7 +1125,13 @@ public void fillXfaForm(InputStream is) throws ParserConfigurationException, SAX

public void fillXfaForm(InputSource is) throws ParserConfigurationException, SAXException, IOException {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
DocumentBuilder db = dbf.newDocumentBuilder();
db.setEntityResolver(new EntityResolver() {
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
return new InputSource(new StringReader(""));
}
});
Document newdoc = db.parse(is);
fillXfaForm(newdoc.getDocumentElement());
}
Expand Down
9 changes: 9 additions & 0 deletions openpdf/src/main/java/com/lowagie/text/xml/xmp/XmpReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.StringReader;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
Expand All @@ -58,6 +59,8 @@
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

import com.lowagie.text.ExceptionConverter;
Expand Down Expand Up @@ -85,6 +88,12 @@ public XmpReader(byte[] bytes) throws SAXException, IOException {
DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
fact.setNamespaceAware(true);
DocumentBuilder db = fact.newDocumentBuilder();
db.setEntityResolver(new EntityResolver() {
@Override
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
return new InputSource(new StringReader(""));
}
});
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
domDocument = db.parse(bais);
} catch (ParserConfigurationException e) {
Expand Down
2 changes: 1 addition & 1 deletion pdf-html/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf-parent</artifactId>
<version>1.0.5-SNAPSHOT</version>
<version>1.0.6-SNAPSHOT</version>
</parent>

<artifactId>pdf-html</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pdf-rtf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf-parent</artifactId>
<version>1.0.5-SNAPSHOT</version>
<version>1.0.6-SNAPSHOT</version>
</parent>

<artifactId>pdf-rtf</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pdf-swing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf-parent</artifactId>
<version>1.0.5-SNAPSHOT</version>
<version>1.0.6-SNAPSHOT</version>
</parent>

<artifactId>pdf-swing</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pdf-toolbox/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf-parent</artifactId>
<version>1.0.5-SNAPSHOT</version>
<version>1.0.6-SNAPSHOT</version>
</parent>

<artifactId>pdf-toolbox</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import java.io.FileWriter;
import java.io.IOException;

import javax.xml.XMLConstants;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Templates;
Expand Down Expand Up @@ -171,7 +172,7 @@ public static void convert(File infile, File xslfile, File outfile) {
try {
// Create transformer factory
TransformerFactory factory = TransformerFactory.newInstance();

factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true);
// Use the factory to create a template containing the xsl file
Templates template = factory.newTemplates(new StreamSource(
new FileInputStream(xslfile)));
Expand Down
2 changes: 1 addition & 1 deletion pdf-xml/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf-parent</artifactId>
<version>1.0.5-SNAPSHOT</version>
<version>1.0.6-SNAPSHOT</version>
</parent>

<artifactId>pdf-xml</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>com.github.librepdf</groupId>
<artifactId>openpdf-parent</artifactId>
<packaging>pom</packaging>
<version>1.0.5-SNAPSHOT</version>
<version>1.0.6-SNAPSHOT</version>

<licenses>
<license>
Expand Down

0 comments on commit 1e30191

Please sign in to comment.