Skip to content
Commits on Source (3)
Release Notes -- Apache PDFBox -- Version 2.0.10
Release Notes -- Apache PDFBox -- Version 2.0.11
Introduction
------------
The Apache PDFBox library is an open source Java tool for working with PDF documents.
This is an incremental bugfix release based on the earlier 2.0.9 release. It contains
This is an incremental bugfix release based on the earlier 2.0.10 release. It contains
a couple of fixes and small improvements.
For more details on these changes and all the other fixes and improvements
......@@ -14,58 +14,11 @@ PDFBox issue tracker at https://issues.apache.org/jira/browse/PDFBOX.
Bug
[PDFBOX-3585] - National characters not correctly displayed in text form field
[PDFBOX-3631] - Signature interoperability issue / visible signature not visible on some viewers
[PDFBOX-3999] - Merge failed to clone tags
[PDFBOX-4097] - Compressed object will lost when brute force search failed to handle compressed streams
[PDFBOX-4151] - FlateFilter, LZWFilter with predictor causes double memory usage
[PDFBOX-4157] - Flatten ne positonne pas bien le 1er champs si Image avant
[PDFBOX-4158] - COSDocument and PDFMerger may not close all IO resources if closing of one fails
[PDFBOX-4162] - OutOfMemoryError in PDExtendedGraphicsState#getLineDashPattern
[PDFBOX-4164] - NPE in PDFDebugger when expanding page subtree
[PDFBOX-4167] - OutOfMemoryError on FlateFilter - Deflater.end() is missing
[PDFBOX-4169] - PDFPrintable has subsampling but it can not be used
[PDFBOX-4172] - Flatten fails on first form element only
[PDFBOX-4176] - PDImageXObject doesn't support TIFF although JavaDoc says it does
[PDFBOX-4179] - Preflight test fails: Parameter 'directory' is not a directory
[PDFBOX-4180] - TextToPDF Does Not Explicitly Close Reader objects
[PDFBOX-4181] - GlyphList.toUnicode not secured for concurrent access
[PDFBOX-4185] - Fetching options for PDChoice causes ClassCastException
[PDFBOX-4195] - Valid XMP Metadata TimeZone not accepted
[PDFBOX-4197] - PDStructureElement.getAttributes() ignores reference objects
[PDFBOX-4200] - DataFormatException: invalid code lengths set when rendering image
[PDFBOX-4204] - Problem when merging PDF 1.4 and PDF 1.1 Documents
[PDFBOX-4207] - Coordinates shown in PDFDebugger are incorrect on HiDPI displays
[PDFBOX-4218] - image with stencil mask appears interpolated
[PDFBOX-4222] - PDFMergerUtility: java.lang.ClassCastException: org.apache.pdfbox.cos.COSDictionary cannot be cast to org.apache.pdfbox.cos.COSNumber
[PDFBOX-4223] - PDFMergerUtility: java.io.IOException: Error: can't convert to Destination COSArray{[COSName{XYZ}]}
[PDFBOX-4227] - java.util.zip.DataFormatException: invalid distance too far back
[PDFBOX-4228] - PDFBox crashes when a Type3 font don't have an embedded encoding.
[PDFBOX-4230] - NullpointerException in CmapSubtable
[PDFBOX-4235] - NPE when setting the DA of a PDTextField
[PDFBOX-4248] - NPE when rendering a PDF with annotations using a g2d from Batik
Improvement
[PDFBOX-3809] - PDAcroForm.flatten(PDField list, refreshAppearances boolean) flattens all form fields instead of specified ones.
[PDFBOX-4057] - Allow rendering with different X and Y scale
[PDFBOX-4095] - Non Separable Blend Modes implementation(HUE, SATURATION, COLOR, LUMINOSITY)
[PDFBOX-4156] - Possible optimization of SampledImageReader.from8bit by using InterleavedRaster
[PDFBOX-4159] - PDFBox doesn't warn if Special graphics state operators are used in text mode
[PDFBOX-4161] - Overlay class should allow user to influence transform
[PDFBOX-4165] - Support IBM OS/400 font locations
[PDFBOX-4168] - Add a setTextRise() method to PDPageContentStream
[PDFBOX-4171] - getColorKeyMask() not needed for inline images
[PDFBOX-4175] - Update apache parent pom
[PDFBOX-4186] - Add quality option for compressed images to pdfbox-app
[PDFBOX-4187] - Refactor LosslessFactory alpha
[PDFBOX-4192] - Support subsampling in PDFToImage command line tool
[PDFBOX-4198] - Remove one of three LiberationSans-Regular.ttf
Task
[PDFBOX-4170] - Update CCITTFaxDecoderStream.java from twelvemonkeys (2)
[PDFBOX-4173] - New OOM getting LineDashPattern
[PDFBOX-4224] - Update jbig2 plugin usage to 3.0.1
[PDFBOX-4251] - Optimize AFMParser
Release Contents
----------------
......@@ -74,7 +27,7 @@ This release consists of a single source archive packaged as a zip file.
The archive can be unpacked with the jar tool from your JDK installation.
See the README.txt file for instructions on how to build this release.
The source archive is accompanied by SHA512 checksums and a PGP signature
The source archive is accompanied by a SHA512 checksum and a PGP signature
that you can use to verify the authenticity of your download.
The public key used for the PGP signature can be found at
https://svn.apache.org/repos/asf/pdfbox/KEYS.
......
......@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.10</version>
<version>2.0.11</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
......
libpdfbox2-java (2.0.11-1) unstable; urgency=medium
* New upstream version 2.0.11.
-- Markus Koschany <apo@debian.org> Sat, 30 Jun 2018 01:50:14 +0200
libpdfbox2-java (2.0.10-1) unstable; urgency=medium
* New upstream version 2.0.10.
......
......@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.10</version>
<version>2.0.11</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
......
......@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.10</version>
<version>2.0.11</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
......
......@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.10</version>
<version>2.0.11</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
......
......@@ -291,7 +291,7 @@ public class CreateVisibleSignature extends CreateSignatureBase
// PDDocument object anymore, with classic java file random access methods.
// If you can't remember the offset value from ByteRange because your context has changed,
// then open the file with PDFBox, find the field with findExistingSignature() or
// PODDocument.getLastSignatureDictionary() and get the ByteRange from there.
// PDDocument.getLastSignatureDictionary() and get the ByteRange from there.
// Close the file and then write the signature as explained earlier in this comment.
if (isLateExternalSigning())
{
......
......@@ -259,7 +259,7 @@ public class CreateVisibleSignature2 extends CreateSignatureBase
// PDDocument object anymore, with classic java file random access methods.
// If you can't remember the offset value from ByteRange because your context has changed,
// then open the file with PDFBox, find the field with findExistingSignature() or
// PODDocument.getLastSignatureDictionary() and get the ByteRange from there.
// PDDocument.getLastSignatureDictionary() and get the ByteRange from there.
// Close the file and then write the signature as explained earlier in this comment.
if (isLateExternalSigning())
{
......
......@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.10</version>
<version>2.0.11</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
......
......@@ -951,9 +951,11 @@ public class AFMParser
buf.append( (char)nextByte );
//now read the data
while( !isEOL(nextByte = input.read()) )
nextByte = input.read();
while (nextByte != -1 && !isEOL(nextByte))
{
buf.append((char) nextByte);
nextByte = input.read();
}
return buf.toString();
}
......@@ -978,9 +980,11 @@ public class AFMParser
buf.append( (char)nextByte );
//now read the data
while( !isWhitespace(nextByte = input.read()) )
nextByte = input.read();
while (nextByte != -1 && !isWhitespace(nextByte))
{
buf.append((char) nextByte);
nextByte = input.read();
}
return buf.toString();
}
......
......@@ -95,10 +95,13 @@ class RAFDataStream extends TTFDataStream
*/
@Override
public void close() throws IOException
{
if (raf != null)
{
raf.close();
raf = null;
}
}
/**
* Read an unsigned byte.
......
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.fontbox.afm;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import org.apache.fontbox.util.Charsets;
import org.junit.Assert;
import org.junit.Test;
/**
*
* @author Tilman Hausherr
*/
public class AFMParserTest
{
@Test
public void testEof() throws IOException
{
try
{
new AFMParser(new ByteArrayInputStream("huhu".getBytes(Charsets.US_ASCII))).parse();
}
catch (IOException ex)
{
Assert.assertEquals("Error: The AFM file should start with StartFontMetrics and not 'huhu'", ex.getMessage());
}
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.fontbox.ttf;
import java.io.IOException;
import org.junit.Test;
/**
*
* @author Tilman Hausherr
*/
public class RAFDataStreamTest
{
/**
* Test of PDFBOX-4242: make sure that the Closeable.close() contract is fulfilled.
*
* @throws IOException
*/
@Test
public void testDoubleClose() throws IOException
{
RAFDataStream raf = new RAFDataStream("src/test/resources/ttf/LiberationSans-Regular.ttf", "r");
raf.close();
raf.close();
}
}
......@@ -29,7 +29,7 @@
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.10</version>
<version>2.0.11</version>
<packaging>pom</packaging>
<name>PDFBox parent</name>
......@@ -146,7 +146,7 @@
<plugin>
<groupId>org.owasp</groupId>
<artifactId>dependency-check-maven</artifactId>
<version>3.2.0</version>
<version>3.2.1</version>
<configuration>
<failBuildOnAnyVulnerability>true</failBuildOnAnyVulnerability>
</configuration>
......@@ -427,8 +427,8 @@
</developers>
<scm>
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/pom/tags/2.0.10/pdfbox-parent</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/pom/tags/2.0.10/pdfbox-parent</developerConnection>
<url>http://svn.apache.org/viewvc/maven/pom/tags/2.0.10/pdfbox-parent</url>
<connection>scm:svn:http://svn.apache.org/repos/asf/maven/pom/tags/2.0.11/pdfbox-parent</connection>
<developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/pom/tags/2.0.11/pdfbox-parent</developerConnection>
<url>http://svn.apache.org/viewvc/maven/pom/tags/2.0.11/pdfbox-parent</url>
</scm>
</project>
......@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.10</version>
<version>2.0.11</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
......
......@@ -220,9 +220,10 @@ public class COSWriter implements ICOSVisitor, Closeable
private COSArray byteRangeArray;
/**
* COSWriter constructor comment.
* COSWriter constructor.
*
* @param outputStream The wrapped output stream.
* @param outputStream The output stream to write the PDF. It will be closed when this object is
* closed.
*/
public COSWriter(OutputStream outputStream)
{
......@@ -233,7 +234,8 @@ public class COSWriter implements ICOSVisitor, Closeable
/**
* COSWriter constructor for incremental updates.
*
* @param outputStream output stream where the new PDF data will be written
* @param outputStream output stream where the new PDF data will be written. It will be closed
* when this object is closed.
* @param inputData random access read containing source PDF data
*
* @throws IOException if something went wrong
......
......@@ -1253,8 +1253,8 @@ public class PDDocument implements Closeable
/**
* This will save the document to an output stream.
*
* @param output The stream to write to. It is recommended to wrap it in a
* {@link java.io.BufferedOutputStream}, unless it is already buffered.
* @param output The stream to write to. It will be closed when done. It is recommended to wrap
* it in a {@link java.io.BufferedOutputStream}, unless it is already buffered.
*
* @throws IOException if the output could not be written
*/
......@@ -1288,7 +1288,8 @@ public class PDDocument implements Closeable
* Save the PDF as an incremental update. This is only possible if the PDF was loaded from a
* file or a stream, not if the document was created in PDFBox itself.
*
* @param output stream to write. It should <i><b>not</b></i> point to the source file.
* @param output stream to write to. It will be closed when done. It should <i><b>not</b></i>
* point to the source file.
* @throws IOException if the output could not be written
* @throws IllegalStateException if the document was not loaded from a file or a stream.
*/
......@@ -1344,7 +1345,8 @@ public class PDDocument implements Closeable
* {@code PDDocument} instance and only AFTER {@link ExternalSigningSupport} instance is used.
* </p>
*
* @param output stream to write final PDF. It should <i><b>not</b></i> point to the source file.
* @param output stream to write the final PDF. It should <i><b>not</b></i> point to the source
* file. It will be closed when the document is closed.
* @return instance to be used for external signing and setting CMS signature
* @throws IOException if the output could not be written
* @throws IllegalStateException if the document was not loaded from a file or a stream or
......
......@@ -1243,7 +1243,12 @@ public class PageDrawer extends PDFGraphicsStreamEngine
lastClip = null;
//TODO support more annotation flags (Invisible, NoZoom, NoRotate)
// Example for NoZoom can be found in p5 of PDFBOX-2348
int deviceType = graphics.getDeviceConfiguration().getDevice().getType();
int deviceType = -1;
if (graphics.getDeviceConfiguration() != null &&
graphics.getDeviceConfiguration().getDevice() != null)
{
deviceType = graphics.getDeviceConfiguration().getDevice().getType();
}
if (deviceType == GraphicsDevice.TYPE_PRINTER && !annotation.isPrinted())
{
return;
......
......@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.10</version>
<version>2.0.11</version>
<relativePath>parent/pom.xml</relativePath>
</parent>
......@@ -34,12 +34,12 @@
<scm>
<connection>
scm:svn:http://svn.apache.org/repos/asf/pdfbox/tags/2.0.10
scm:svn:http://svn.apache.org/repos/asf/pdfbox/tags/2.0.11
</connection>
<developerConnection>
scm:svn:https://svn.apache.org/repos/asf/pdfbox/tags/2.0.10
scm:svn:https://svn.apache.org/repos/asf/pdfbox/tags/2.0.11
</developerConnection>
<url>http://svn.apache.org/viewvc/pdfbox/tags/2.0.10</url>
<url>http://svn.apache.org/viewvc/pdfbox/tags/2.0.11</url>
</scm>
<modules>
......
......@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.10</version>
<version>2.0.11</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
......