Hi Andrea, > Andrea Vacondio <[email protected]> hat am 4. März 2015 um 14:15 > geschrieben: > > > Hi, about 2.0.0-SNAPSHOT I was setting version on an existing document and > I noticed the version was set on the Catalog but not in the header so I > took a look at the code and I think there's something odd there (or I'm > missing something). > It first makes sure we are not downgrading the version and then we have the > following code (see my comment): > > if (newVersion >= 1.4f) > { > getDocumentCatalog().setVersion(Float.toString(newVersion)); > //isn't this always false? We already know newVersion is greater... > if (getDocument().getVersion() > newVersion) > { > getDocument().setVersion(newVersion); > } > } > else > { > // versions < 1.4f have a version header only > getDocument().setVersion(newVersion); > } > > I'm not fully sure what's the expected behaviour but I guess it's something > like "if newVer is less then 1.4 then set the header else set both header > and catalog so something like: > if (newVersion >= 1.4f) > { > > getDocumentCatalog().setVersion(Float.toString(newVersion)); > } > getDocument().setVersion(newVersion); > > Am I missing something? You're right there is some room for improvements. I've already reopened the related ticket PDFBOX-2099
Thanks for the pointer BR Andreas Lehmkühler --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

