Skip to content
Commits on Source (3)
Release Notes -- Apache PDFBox -- Version 2.0.9
Release Notes -- Apache PDFBox -- Version 2.0.10
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.8 release. It contains
This is an incremental bugfix release based on the earlier 2.0.9 release. It contains
a couple of fixes and small improvements.
For more details on these changes and all the other fixes and improvements
......@@ -14,98 +14,58 @@ PDFBox issue tracker at https://issues.apache.org/jira/browse/PDFBOX.
Bug
[PDFBOX-2142] some /ICCBased colorspaces not rendered correctly
[PDFBOX-2558] Image missing
[PDFBOX-2917] PDF to Image, faint/dim Images
[PDFBOX-3377] font caching never stops in AIX
[PDFBOX-3401] PDObjectReference getReferencedObject() returns null if referenced obj is not a COSStream
[PDFBOX-3457] Glyphs rendered in wrong width
[PDFBOX-3956] Truncated pdf can't be repaired anymore
[PDFBOX-3990] Rendering will never complete
[PDFBOX-3994] ClassCastException in COSParser.bfSearchForTrailer
[PDFBOX-3997] Cannot encode strings with of surrogate pairs
[PDFBOX-4001] Rendering LineFeed (No Unicode mapping for .notdef (10))
[PDFBOX-4002] Layer Utility - Text not being displayed when overlaying
[PDFBOX-4005] Incorrect use of PDNumberTreeNode in PDPageLabels
[PDFBOX-4006] PDFBox throws NullPointerException when parsing PDF
[PDFBOX-4011] BBox in signature forms has wrong order
[PDFBOX-4012] PDF with incremental save is shown blank
[PDFBOX-4015] java.awt.color.CMMException: LCMS error 13: Couldn't link the profiles
[PDFBOX-4018] NPE in sanitizeType in org.apache.pdfbox.pdmodel.PDPageTree
[PDFBOX-4021] Font missing when building from source makes build fail
[PDFBOX-4027] IndexOutOfBoundsException when XObject form matrix has only 5 elements
[PDFBOX-4030] ClassCastException when matrix array has indirect objects
[PDFBOX-4038] CFF font Blue values and other delta encoded lists read incorrectly
[PDFBOX-4043] ExtractImages doesn't extract images from PDPatterns
[PDFBOX-4044] Unable to process overlay on Cognos PDF documents
[PDFBOX-4052] Number '------------06836305' is getting too long, stop reading at offset 36
[PDFBOX-4053] build test fails on jdk9
[PDFBOX-4058] High memory consumption when extracting image from PDF file
[PDFBOX-4060] Slow rendering of PDF file with DeviceN jpeg file
[PDFBOX-4061] ClassCastException PDActionJavaScript cannot be cast to PDDestination
[PDFBOX-4064] cm operator has 7 numbers
[PDFBOX-4066] Merging documents with nested fields duplicates child fields
[PDFBOX-4083] Line annotation /LL, /LLE and /LLO have wrong default values
[PDFBOX-4084] Can't draw PDFs while ANNOTS is COSStream instead of COSArray
[PDFBOX-4085] COSString cannot be cast to COSDictionary error
[PDFBOX-4088] Root/StructTreeRoot/K/S must be name, not string (merge)
[PDFBOX-4091] Cannot analyze signatures : Wrong type of referenced length object COSObject
[PDFBOX-4093] illegible characters in rendered image
[PDFBOX-4103] Optional Content Groups with same names can't have different visibility
[PDFBOX-4105] Copyright 2011 adam
[PDFBOX-4107] NPE at PDFMergerUtility
[PDFBOX-4108] /Length1 not needed for /CIDToGIDMap
[PDFBOX-4113] Debugger file open dialog has incorrect filter on Mac
[PDFBOX-4114] ICCBased color spaces wrong color output
[PDFBOX-4115] Problem creating PDF with German text using embedded Type1 (PFB) font
[PDFBOX-4125] FDFField.writeXML KO with String
[PDFBOX-4129] Deleted fonts not detected when checking cache
[PDFBOX-4140] Crash when repeating flag is outside of range.
[PDFBOX-4146] Patch: Fix for appearance of visible signature
[PDFBOX-4153] Outlines missing in some versions, not in others
New Feature
[PDFBOX-3198] Visible Signature N2 layer / Support signature with text
[PDFBOX-4106] Vertical text creation
[PDFBOX-4117] Implement GoToE action-type
[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
Improvement
[PDFBOX-1848] Time Stamp Document Level Sigature
[PDFBOX-2092] Very slow rendering of scanned document
[PDFBOX-3340] Image decoded twice without a real need
[PDFBOX-3984] Add validation data of signer to document
[PDFBOX-3992] Implement show text with positioning operator (TJ)
[PDFBOX-3998] Inform the user when not using KCMS with jdk8 or higher + set KCMS in cli
[PDFBOX-4020] Into existing signature embedded signed timestamp for validation
[PDFBOX-4022] Cache ColorSpace instances in PDColorSpace.java
[PDFBOX-4024] YCbCr JPEGs not implemented
[PDFBOX-4025] Other page sizes than US Letter should be selectable in TextToPDF
[PDFBOX-4040] Get/set Viewports in PDPage
[PDFBOX-4119] KCMS takes too much time
[PDFBOX-4121] (-Dorg.apache.pdfbox.rendering.UsePureJavaCMYKConversion=true) takes much time
[PDFBOX-4137] Allow subsampled/downscaled rendering of images, and rendering subimages
[PDFBOX-4139] Optimize memory footprint of CID mappings within CMaps
[PDFBOX-4142] Don't use md5 checksum due to changes to the release distribuition policy
[PDFBOX-4150] Optimize clipping text rendering modes
Wish
[PDFBOX-4094] Add support for a flag disabling the rendering of PDF annotations in PDFRenderer
[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-2852] Improve code quality (2)
[PDFBOX-3991] PDPageContentStream has sometimes float, sometimes double parameters
[PDFBOX-4050] Check user password when decrypting with owner password in build test
[PDFBOX-4055] Output info when PDFBox JBIG2 ImageIO is released
[PDFBOX-4135] Modify PDFBox builds für Apache JBIG2 plugin
[PDFBOX-4143] repository-cached download of fontbox test files
Sub-task
[PDFBOX-4029] Rendering transparency groups in patterns
[PDFBOX-4170] - Update CCITTFaxDecoderStream.java from twelvemonkeys (2)
[PDFBOX-4173] - New OOM getting LineDashPattern
[PDFBOX-4224] - Update jbig2 plugin usage to 3.0.1
Release Contents
----------------
......
......@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
......
libpdfbox2-java (2.0.10-1) unstable; urgency=medium
* New upstream version 2.0.10.
-- Markus Koschany <apo@debian.org> Thu, 28 Jun 2018 23:55:29 +0200
libpdfbox2-java (2.0.9-1) unstable; urgency=medium
* New upstream version 2.0.9.
......
......@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
......
......@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
......
......@@ -18,6 +18,7 @@ package org.apache.pdfbox.debugger;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.FileDialog;
import java.awt.Toolkit;
......@@ -43,6 +44,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
import javax.imageio.spi.IIORegistry;
import javax.print.attribute.HashPrintRequestAttributeSet;
import javax.print.attribute.PrintRequestAttributeSet;
import javax.print.attribute.standard.Sides;
......@@ -105,11 +107,11 @@ import org.apache.pdfbox.debugger.ui.RecentFiles;
import org.apache.pdfbox.debugger.ui.RotationMenu;
import org.apache.pdfbox.debugger.ui.Tree;
import org.apache.pdfbox.debugger.ui.ZoomMenu;
import org.apache.pdfbox.filter.FilterFactory;
import org.apache.pdfbox.io.IOUtils;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.pdmodel.common.PDPageLabels;
import org.apache.pdfbox.pdmodel.encryption.InvalidPasswordException;
import org.apache.pdfbox.pdmodel.font.PDFont;
import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.apache.pdfbox.pdmodel.graphics.color.PDDeviceCMYK;
import org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB;
......@@ -1126,9 +1128,17 @@ public class PDFDebugger extends JFrame
}
}
if (job.printDialog(pras))
{
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try
{
job.print(pras);
}
finally
{
setCursor(Cursor.getDefaultCursor());
}
}
}
catch (PrinterException e)
{
......@@ -1202,6 +1212,8 @@ public class PDFDebugger extends JFrame
// Yes this is always true
PDDeviceCMYK.INSTANCE.toRGB(new float[] { 0, 0, 0, 0} );
PDDeviceRGB.INSTANCE.toRGB(new float[] { 0, 0, 0 } );
IIORegistry.getDefaultInstance();
FilterFactory.INSTANCE.getFilter(COSName.FLATE_DECODE);
}
// open file, if any
......@@ -1249,7 +1261,7 @@ public class PDFDebugger extends JFrame
readPDFFile(file, password);
}
private void readPDFFile(File file, String password) throws IOException
private void readPDFFile(final File file, String password) throws IOException
{
if( document != null )
{
......@@ -1261,7 +1273,17 @@ public class PDFDebugger extends JFrame
}
currentFilePath = file.getPath();
recentFiles.removeFile(file.getPath());
parseDocument( file, password );
DocumentOpener documentOpener = new DocumentOpener(password)
{
@Override
PDDocument open() throws IOException
{
return PDDocument.load(file, password);
}
};
document = documentOpener.parse();
printMenuItem.setEnabled(true);
reopenMenuItem.setEnabled(true);
initTree();
......@@ -1277,7 +1299,7 @@ public class PDFDebugger extends JFrame
addRecentFileItems();
}
private void readPDFurl(String urlString, String password) throws IOException
private void readPDFurl(final String urlString, String password) throws IOException
{
if (document != null)
{
......@@ -1288,8 +1310,15 @@ public class PDFDebugger extends JFrame
}
}
currentFilePath = urlString;
URL url = new URL(urlString);
document = PDDocument.load(url.openStream(), password);
DocumentOpener documentOpener = new DocumentOpener(password)
{
@Override
PDDocument open() throws IOException
{
return PDDocument.load(new URL(urlString).openStream(), password);
}
};
document = documentOpener.parse();
printMenuItem.setEnabled(true);
reopenMenuItem.setEnabled(true);
......@@ -1329,19 +1358,38 @@ public class PDFDebugger extends JFrame
}
/**
* This will parse a document.
* Internal class to avoid double code in password entry loop.
*/
abstract class DocumentOpener
{
String password;
DocumentOpener(String password)
{
this.password = password;
}
/**
* Override to load the actual input type (File, URL, stream), don't call it directly!
*
* @param file The file addressing the document.
* @return
* @throws IOException
*/
abstract PDDocument open() throws IOException;
/**
* Call this!
*
* @throws IOException If there is an error parsing the document.
* @return
* @throws IOException
*/
private void parseDocument( File file, String password )throws IOException
final PDDocument parse() throws IOException
{
while (true)
{
try
{
document = PDDocument.load(file, password);
return open();
}
catch (InvalidPasswordException ipe)
{
......@@ -1351,7 +1399,10 @@ public class PDFDebugger extends JFrame
JPasswordField pass = new JPasswordField(10);
panel.add(label);
panel.add(pass);
String[] options = new String[] {"OK", "Cancel"};
String[] options = new String[]
{
"OK", "Cancel"
};
int option = JOptionPane.showOptionDialog(null, panel, "Enter password",
JOptionPane.NO_OPTION, JOptionPane.PLAIN_MESSAGE,
null, options, "");
......@@ -1362,10 +1413,8 @@ public class PDFDebugger extends JFrame
}
throw ipe;
}
break;
}
printMenuItem.setEnabled(true);
reopenMenuItem.setEnabled(true);
}
}
private void addRecentFileItems()
......
......@@ -28,6 +28,8 @@ import java.awt.event.MouseMotionListener;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutionException;
import javax.swing.BoxLayout;
import javax.swing.JLabel;
......@@ -44,6 +46,10 @@ import org.apache.pdfbox.pdmodel.PDPage;
import org.apache.pdfbox.rendering.PDFRenderer;
import org.apache.pdfbox.debugger.PDFDebugger;
import org.apache.pdfbox.debugger.ui.HighResolutionImageIcon;
import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget;
import org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm;
import org.apache.pdfbox.pdmodel.interactive.form.PDField;
/**
* Display the page number and a page rendering.
......@@ -61,6 +67,10 @@ public class PagePane implements ActionListener, AncestorListener, MouseMotionLi
private RotationMenu rotationMenu;
private final JLabel statuslabel;
private final PDPage page;
private String labelText = "";
private final Map<PDRectangle, String> rectMap = new HashMap<PDRectangle, String>();
private final AffineTransform defaultTransform = GraphicsEnvironment.getLocalGraphicsEnvironment().
getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform();
public PagePane(PDDocument document, COSDictionary pageDict, JLabel statuslabel)
{
......@@ -69,6 +79,27 @@ public class PagePane implements ActionListener, AncestorListener, MouseMotionLi
this.document = document;
this.statuslabel = statuslabel;
initUI();
initRectMap();
}
private void initRectMap()
{
PDAcroForm acroForm = document.getDocumentCatalog().getAcroForm();
if (acroForm == null)
{
return;
}
for (PDField field : acroForm.getFieldTree())
{
String fullyQualifiedName = field.getFullyQualifiedName();
for (PDAnnotationWidget widget : field.getWidgets())
{
if (page.equals(widget.getPage()))
{
rectMap.put(widget.getRectangle(), fullyQualifiedName);
}
}
}
}
private void initUI()
......@@ -185,8 +216,8 @@ public class PagePane implements ActionListener, AncestorListener, MouseMotionLi
float offsetX = page.getCropBox().getLowerLeftX();
float offsetY = page.getCropBox().getLowerLeftY();
float zoomScale = zoomMenu.getPageZoomScale();
float x = e.getX() / zoomScale;
float y = e.getY() / zoomScale;
float x = e.getX() / zoomScale * (float) defaultTransform.getScaleX();
float y = e.getY() / zoomScale * (float) defaultTransform.getScaleY();
int x1, y1;
switch ((RotationMenu.getRotationDegrees() + page.getRotation()) % 360)
{
......@@ -208,7 +239,19 @@ public class PagePane implements ActionListener, AncestorListener, MouseMotionLi
y1 = (int) (height - y + offsetY);
break;
}
statuslabel.setText(x1 + "," + y1);
String text = "x: " + x1 + ", y: " + y1;
// are we in a field widget?
for (Map.Entry<PDRectangle, String> entry : rectMap.entrySet())
{
if (entry.getKey().contains(x1, y1))
{
text += ", field: " + rectMap.get(entry.getKey());
break;
}
}
statuslabel.setText(text);
}
@Override
......@@ -234,7 +277,7 @@ public class PagePane implements ActionListener, AncestorListener, MouseMotionLi
@Override
public void mouseExited(MouseEvent e)
{
statuslabel.setText("");
statuslabel.setText(labelText);
}
/**
......@@ -257,14 +300,16 @@ public class PagePane implements ActionListener, AncestorListener, MouseMotionLi
protected BufferedImage doInBackground() throws IOException
{
label.setIcon(null);
label.setText("Rendering...");
labelText = "Rendering...";
label.setText(labelText);
PDFRenderer renderer = new PDFRenderer(document);
renderer.setSubsamplingAllowed(allowSubsampling);
long t0 = System.currentTimeMillis();
statuslabel.setText("Rendering...");
statuslabel.setText(labelText);
BufferedImage bim = renderer.renderImage(pageIndex, scale);
float t = (System.currentTimeMillis() - t0) / 1000f;
statuslabel.setText("Rendered in " + t + " second" + (t > 1 ? "s" : ""));
labelText = "Rendered in " + t + " second" + (t > 1 ? "s" : "");
statuslabel.setText(labelText);
return ImageUtil.getRotatedImage(bim, rotation);
}
......@@ -280,10 +325,8 @@ public class PagePane implements ActionListener, AncestorListener, MouseMotionLi
// a smaller size than the image to compensate that the
// image is scaled up with some screen configurations (e.g. 125% on windows).
// See PDFBOX-3665 for more sample code and discussion.
AffineTransform tx = GraphicsEnvironment.getLocalGraphicsEnvironment().
getDefaultScreenDevice().getDefaultConfiguration().getDefaultTransform();
label.setSize((int) Math.ceil(image.getWidth() / tx.getScaleX()),
(int) Math.ceil(image.getHeight() / tx.getScaleY()));
label.setSize((int) Math.ceil(image.getWidth() / defaultTransform.getScaleX()),
(int) Math.ceil(image.getHeight() / defaultTransform.getScaleY()));
label.setIcon(new HighResolutionImageIcon(image, label.getWidth(), label.getHeight()));
label.setText(null);
}
......
......@@ -205,14 +205,20 @@ public class PDFTreeCellRenderer extends DefaultTreeCellRenderer
if (dict.containsKey(COSName.TYPE))
{
COSName type = dict.getCOSName(COSName.TYPE);
if (type != null)
{
sb.append(" /T:").append(type.getName());
}
}
if (dict.containsKey(COSName.SUBTYPE))
{
COSName subtype = dict.getCOSName(COSName.SUBTYPE);
if (subtype != null)
{
sb.append(" /S:").append(subtype.getName());
}
}
return sb.toString();
}
else
......
......@@ -65,6 +65,10 @@ public class PageEntry
{
COSDictionary parent = (COSDictionary)node.getDictionaryObject(COSName.PARENT);
COSArray kids = (COSArray)parent.getDictionaryObject(COSName.KIDS);
if (kids == null)
{
return "";
}
int idx = kids.indexOfObject(node);
sb.append("/Kids/[").append(idx).append("]");
node = parent;
......
......@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
......
......@@ -169,6 +169,7 @@ The International Components for Unicode library (http://site.icu-project.org/)
copyright holder.
The file "sRGB Color Space Profile.icm" is:
Copyright (c) 1998 Hewlett-Packard Company
To anyone who acknowledges that the file "sRGB Color Space Profile.icm"
......@@ -180,3 +181,99 @@ used in advertising or publicity pertaining to distribution of the software
without specific, written prior permission. Hewlett-Packard Company makes
no representations about the suitability of this software for any purpose.
Lohit-Bengali font (https://pagure.io/lohit):
Copyright 2011-13 Lohit Fonts Project contributors
<http://fedorahosted.org/lohit>
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
......@@ -21,14 +21,14 @@
</head>
<body>
<a href="http://jakarta.apache.org/ant/index.html">ANT</a> tasks that utilize PDFBox features can be found in this package.
This is an example of using the PDF2Text task:<br/> <br/>
This is an example of using the PDF2Text task:<br> <br>
&lt;taskdef name="pdf2text" classname="org.apache.pdfbox.ant.PDFToTextTask" classpathref="build.classpath" /&gt;<br/>
&lt;taskdef name="pdf2text" classname="org.apache.pdfbox.ant.PDFToTextTask" classpathref="build.classpath" /&gt;<br>
&lt;pdf2text&gt;<br/>
&nbsp;&nbsp;&lt;fileset dir="test"&gt;<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;include name="**/*.pdf" /&gt;<br/>
&nbsp;&nbsp;&lt;/fileset&gt;<br/>
&lt;/pdf2text&gt;<br/>
&lt;pdf2text&gt;<br>
&nbsp;&nbsp;&lt;fileset dir="test"&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;include name="**/*.pdf" /&gt;<br>
&nbsp;&nbsp;&lt;/fileset&gt;<br>
&lt;/pdf2text&gt;<br>
</body>
</html>
......@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-parent</artifactId>
<version>2.0.9</version>
<version>2.0.10</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
......
......@@ -30,3 +30,100 @@ Apache FontBox is based on contributions made to the original FontBox project:
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Lohit-Bengali font (https://pagure.io/lohit):
Copyright 2011-13 Lohit Fonts Project contributors
<http://fedorahosted.org/lohit>
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
......@@ -21,7 +21,7 @@
</head>
<body>
This package holds classes used to parse AFM(Adobe Font Metrics) files.
<br/>
<br>
More information about AFM files can be found at
<a href="http://partners.adobe.com/asn/developer/type/">http://partners.adobe.com/asn/developer/type/</a>
</body>
......
......@@ -45,7 +45,7 @@ public class CmapSubtable implements CmapLookup
private long subTableOffset;
private int[] glyphIdToCharacterCode;
private final Map<Integer, List<Integer>> glyphIdToCharacterCodeMultiple = new HashMap<Integer, List<Integer>>();
private Map<Integer, Integer> characterCodeToGlyphId;
private Map<Integer, Integer> characterCodeToGlyphId= new HashMap<Integer, Integer>();
/**
* This will read the required data from the stream.
......
......@@ -48,18 +48,19 @@ public class FontFileFinder
{
return new WindowsFontDirFinder();
}
else
{
if (osName.startsWith("Mac"))
else if (osName.startsWith("Mac"))
{
return new MacFontDirFinder();
}
else if (osName.startsWith("OS/400"))
{
return new OS400FontDirFinder();
}
else
{
return new UnixFontDirFinder();
}
}
}
/**
* Automagically finds a list of font files on local system.
......
/*
* Copyright 2018 The Apache Software Foundation.
*
* Licensed 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.util.autodetect;
/**
* Font finder for OS/400 systems.
*/
public class OS400FontDirFinder extends NativeFontDirFinder
{
@Override
protected String[] getSearchableDirectories()
{
return new String[] { System.getProperty("user.home") + "/.fonts", // user
"/QIBM/ProdData/OS400/Fonts"
};
}
}