Hello,
We are encountering some errors with pdfbox on a AIX platform. We don't
know how to reproduce the problem, neither how to explain it…
The stacktrace here :
java.io.IOException: No such file or directory
at org.apache.pdfbox.io.RandomAccessFile.length(RandomAccessFile.java:83)
at
org.apache.pdfbox.io.RandomAccessFileOutputStream.<init>(RandomAccessFileOutputStream.java:52)
at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:300)
at org.apache.pdfbox.cos.COSStream.doDecode(COSStream.java:221)
at org.apache.pdfbox.cos.COSStream.getUnfilteredStream(COSStream.java:156)
at
org.apache.pdfbox.pdfparser.PDFStreamParser.<init>(PDFStreamParser.java:105)
at
org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:262)
at
org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:251)
at
org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:225)
at
com.gatetopost.util.pdf.GetPositions.processDocument(GetPositions.java:151)
at com.gatetopost.gestionnaires.[non pdfbox code]
The GetPositions class extends PDFTextStripper and the processDocument
is here :
public void processDocument(final File document, final int numPage,
final File tempDir) throws IOException {
final PDDocument doc;
try {
final BufferedInputStream bis = new BufferedInputStream(
new FileInputStream(document), 1024);
try {
final PDFParser parser = new PDFParser(bis);
if ((tempDir != null) && tempDir.isDirectory()) {
parser.setTempDirectory(tempDir);
}
parser.parse();
doc = parser.getPDDocument();
} finally {
try {
bis.close();
} catch (final IOException e) {
LOG.warn("", e);
}
}
} catch (final IOException e) {
throw e;
} catch (final Exception e) {
LOG.error("Error reading" + document, e);
return;
}
@SuppressWarnings("unchecked")
final List<PDPage> allPages = doc.getDocumentCatalog().getAllPages();
final PDPage page = allPages.get(numPage);
processStream(page, page.findResources(), page.getContents()
.getStream());
}
Can you help me to understand what happen ?
Thank you,