Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.8.10, 1.8.11
-
None
Description
The example shown in
http://pdfbox.apache.org/1.8/cookbook/pdfavalidation.html
passes a DataSource object. This results in the creation of a temporary file. The constructor with the DataSource makes only sense when working with URLs. (And that only if http is cached, because preflight does an openStream() for each PDF stream!)
It would be better to replace
FileDataSource fd = new FileDataSource(args[0]); PreflightParser parser = new PreflightParser(fd);
with
PreflightParser parser = new PreflightParser(args[0]);
Edit: removed 2.0, as the example may have to change after solving PDFBOX-3007.