You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by "Morales-Martin, Kristina" <km...@cas.org> on 2015/03/17 14:26:19 UTC

How to retain existing Acrobat/PDF version using Splitter class

Dear all,

In our use of the org.apache.pdfbox.util.Splitter class to split a PDF document according to top level bookmarks,
we have observed that the newly created documents do not retain the existing Acrobat/PDF version of the original document.
(Splitter#createNewDocument()).

Can experienced users/developers direct us to samples or other resources that show how this can be achieved?

We are required to preserve the version of the original.
This is a requirement of a downstream process that consumes the split documents.
For example, if the input PDF is in version Acrobat 6 (PDF 1.5), we would like the resulting split documents to be the same version.

Thank you for your help.

-K.M-Martin

Confidentiality Notice: This electronic message transmission, including any attachment(s), may contain confidential, proprietary, or privileged information from Chemical Abstracts Service ("CAS"), a division of the American Chemical Society ("ACS"). If you have received this transmission in error, be advised that any disclosure, copying, distribution, or use of the contents of this information is strictly prohibited. Please destroy all copies of the message and contact the sender immediately by either replying to this message or calling 614-447-3600.


Re: How to retain existing Acrobat/PDF version using Splitter class

Posted by Andreas Lehmkuehler <an...@lehmi.de>.
Hi,

Am 17.03.2015 um 16:23 schrieb Martin Schröder:
> 2015-03-17 14:26 GMT+01:00 Morales-Martin, Kristina <km...@cas.org>:
>> In our use of the org.apache.pdfbox.util.Splitter class to split a PDF document according to top level bookmarks,
>> we have observed that the newly created documents do not retain the existing Acrobat/PDF version of the original document.
>> (Splitter#createNewDocument()).
>>
>> Can experienced users/developers direct us to samples or other resources that show how this can be achieved?
>
> Hello Kristina,
> can you try the attached patch to org.apache.pdfbox.multipdf.Splitter?
> It should copy the PDF version of the source to the newly created documents.
>
> Note that PDFBox always sets the version in the header to 1.4 and this
> only updates the /Version entry in the Document Catalog. This should
> be enough (at least it works with Adobe Reader).
Not any longer, as I've just fixed that in PDFBOX-2713 at least for the trunk ;-)

> Best
>     Martin

Thanks for the report and the hint!

BR
Andreas Lehmkühler




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


Re: How to retain existing Acrobat/PDF version using Splitter class

Posted by Martin Schröder <ma...@oneiros.de>.
2015-03-17 14:26 GMT+01:00 Morales-Martin, Kristina <km...@cas.org>:
> In our use of the org.apache.pdfbox.util.Splitter class to split a PDF document according to top level bookmarks,
> we have observed that the newly created documents do not retain the existing Acrobat/PDF version of the original document.
> (Splitter#createNewDocument()).
>
> Can experienced users/developers direct us to samples or other resources that show how this can be achieved?

Hello Kristina,
can you try the attached patch to org.apache.pdfbox.multipdf.Splitter?
It should copy the PDF version of the source to the newly created documents.

Note that PDFBox always sets the version in the header to 1.4 and this
only updates the /Version entry in the Document Catalog. This should
be enough (at least it works with Adobe Reader).

Best
   Martin