Hi,
Am 28.03.2013 05:43, schrieb Chris J Lindberg:
Additional information: The error occurred on Norwegian documents. I just
tested outputting two English Word documents as PDF then combined the two using
Acrobat Pro then ran the code below. The result gave me the same error when
trying to open the output file using Preview.
On Mar 27, 2013, at 6:05 PM, Chris J Lindberg wrote:
Hello,
I generated a multi page document using Acrobat Pro by opening one PDF document
then using insert from file to add a second page. My goal was to switch launch
links to go to links but early on I got an error when trying to open the PDFBox
generated file with either Preview or Acrobat:
The file “NEW_AllPages.pdf” could not be opened.
It may be damaged or use a file format that Preview doesn’t recognize.
I stripped out all of the link code and ran the following where I load the
input file and output a file based on command line arguments.
public class FindActionLinks {
private static void usage() {
System.err.println( "usage: " + FindActionLinks.class.getName() + " <input-file>
<output-file>" );
}
public static void main(String[] args) throws Exception {
PDDocument doc = null;
try {
if (args.length != 2) {
usage();
} else {
doc = PDDocument.load(args[0]);
doc.save( args[1] );
}
} finally {
if (doc != null) {
doc.close();
}
}
}
}
After running this code I the error was the same. I then ran the code on a
single PDF document that had no inserted pages from file. Is this a bug? Any
idea on how to correct this?
That's hard without having a hand on the pdf in question.
Thanks,
Chris
BR
Andreas Lehmkühler