pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Petras Petkus" <petras.pet...@mitsoft.lt>
Subject RE: COSDocument returns incorrect version from header string
Date Thu, 18 Feb 2016 17:02:29 GMT
Yes, I know, that the version in catalog shall be used to determine version
and therefore the version COSDocument#getVersion() method result is expected
to reflect that. But I ask the header string. And it's result differs from
the actual header string in the file after PDFParser finishes its job.

Please, bear also in mind that Extensions Dictionary (see ISO 32000-1
chapter 7.12) validation should consider the values both in document catalog
and header:
"The value of BaseVersion, when treated as a version number, shall be less
than or equal to the PDF version, both in the document header (see 7.5.2,
"File Header") and the catalog Version key value, if present."

As it says "both", that means BaseVersion may not exceed the value neither
in header nor in catalog, therefore we need to validate that.

Petras

-----Original Message-----
From: Tilman Hausherr [mailto:THausherr@t-online.de] 
Sent: Thursday, February 18, 2016 6:28 PM
To: users@pdfbox.apache.org
Subject: Re: COSDocument returns incorrect version from header string



Am 18.02.2016 um 09:30 schrieb Petras Petkus:
> Hello,
>
>   
>
> We are using the latest v1.8.12-SNAPSHOT and we noticed, that
> COSDocument#getHeaderString() method does not return the version 
> indicated in PDF header string, but the version set document catalog 
> (see
> COSDocument#serVersion() which updates header string). Is such side 
> effect behavior intentional?


Yes.

See 7.5.2 File Header in the "32000" specification:

Beginning with PDF 1.4, the Version entry in the document's catalog
dictionary (located via the Root entry in the file's trailer, as described
in 7.5.5, "File Trailer"), if present, shall be used instead of the version
specified in the Header.


Tilman


>
>   
>
> We have validation scenarios (national PDF-based document 
> specification), where version of the header string is checked. In 
> present situation we fail to correctly validate, if header string 
> version is overridden by value in catalog.
>
>   
>
> Petras
>
>   
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message