> karthick g <[email protected]> hat am 25. Juli 2017 um 10:34 
> geschrieben:
> 
> 
> Hi team,
> 
> Based on the analysis I have found one thing regarding Linearized PDF in
> 2.0 and above versions of PDFBox.
> 
> COSDocument cDoc = pdDoc.getDocument();
> List<COSObject> lObj = cDoc.getObjects();
>         for (COSObject object : lObj)
>         {
>             System.out.println(object.getObjectNumber());
>    }
> 
> Based on the code am retrieving  cosobject numbers of PDFDocument
> which prints COSObjects sequentially.......
> PDF 1.8.2 and 2.0.6 works same  except the fact that COSObject pointing to
> Linearized dictionary is not added.
> 
> 748 0 obj <</Linearized 1/L 1829691/O 752/E 171783/N 9/T 1814683/H [ 3196
> 824]>> endobj
> 
> The 748, 0 which is present in 1.8.2 is not present in 2.0.6. Is the
> finding is correct and can you guide me to fix it.
There is no fix as it isn't a real problem.

The standard procedure to read a pdf is to start at the end of the document and 
to read the trailer information including the xref table. The linearized 
dictionary is optional and not needed if a parser follows the default procedure.
2.0.x follows the default way which omits the optional linearized dictionary. 
All older versions are using some kind of brute force search (the sequential 
parser only), which reads all objects from the beginning to the end which 
includes the linearized dictionary.

The dictionary won't be read as long as PDFBox 2.0.x doesn't support 
"linearized parsing". AFAIK none of the devs is working on that feature as we 
simply don't need it. But we are happy to accept patches to add support for it.

Andreas

> If it is fixed I can able to retrieve Linearized dictionary without going
> for preflight jar,
> 
> PDFBox 1.8.2
> ===========
> COSObject{1, 0}
> ---------------------
> ------------------------------
> ---------------------------
> COSObject{747, 0}
> COSObject{748, 0}
> COSObject{749, 0}
> ---------
> 
> PDFBox 2.0.6
> ===========
> COSObject{1, 0}
> ---------------------
> ------------------------------
> ---------------------------
> COSObject{747, 0}
> COSObject{749, 0}
> ---------
> 
> Regard,
> Karthick G
> 
> On Thu, Jul 13, 2017 at 12:02 PM, karthick g <[email protected]>
> wrote:
> 
> > Hi Team,
> >
> > In our project we want to take the Linearised dictionary. Before these 2.0
> > versions,
> > We can able to get that dictionary by normal workarounds that without
> > loading preflight document. Now after 2.0 versions we have to load the
> > preflight document to get the linearized property. Which resulting in
> > additional work around and which cost the project performance. Will their
> > be a workaround in next release, Such that linearized property can be
> > retrieved without loading Preflight document.
> >
> > Regards,
> > Karthick G
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to