[
https://issues.apache.org/jira/browse/PDFBOX-3007?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tilman Hausherr updated PDFBOX-3007:
------------------------------------
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
{code}
FileDataSource fd = new FileDataSource(args[0]);
PreflightParser parser = new PreflightParser(fd);
{code}
with
{code}
PreflightParser parser = new PreflightParser(args[0]);
{code}
Edit: removed 2.0, as the example may have to change after solving PDFBOX-3007.
was:
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
{code}
FileDataSource fd = new FileDataSource(args[0]);
PreflightParser parser = new PreflightParser(fd);
{code}
with
{code}
PreflightParser parser = new PreflightParser(args[0]);
{code}
When working on that one, the example could also be copied to the 2.0 cookbook
directory.
> Preflight cookbook example is inefficient
> -----------------------------------------
>
> Key: PDFBOX-3007
> URL: https://issues.apache.org/jira/browse/PDFBOX-3007
> Project: PDFBox
> Issue Type: Improvement
> Components: Documentation
> Affects Versions: 1.8.10, 1.8.11
> Reporter: Tilman Hausherr
> Priority: Minor
> Fix For: 1.8.11
>
>
> 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
> {code}
> FileDataSource fd = new FileDataSource(args[0]);
> PreflightParser parser = new PreflightParser(fd);
> {code}
> with
> {code}
> PreflightParser parser = new PreflightParser(args[0]);
> {code}
> Edit: removed 2.0, as the example may have to change after solving
> PDFBOX-3007.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]