You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Diego Azevedo <da...@esec.com.br> on 2016/05/16 14:12:24 UTC

Updatable Footer

Hello All,

My question is how can I update a page footer in incremental updates:

My page structure looks like this:

    3 0 obj
    <<
    /Type /Page
    /Parent 2 0 R
    [...]
    /Contents [6 0 R 7 0 R]
     >>
    endobj

The object 7 0 obj contains the footer. But this is a signed pdf, and I 
want to "update" this footer before another signature, creating another 
COSStream with the new contents and giving it the same object number 
(and possibly another revision number -> 7 1 obj, but that's not critical).

I tried to retrieve this PD/COSStream, create the outputstream, write 
the new content and "save incremental" but it didn't work.

On a related subject, can I add a footer (without any signature) to all 
pages with the same object number?

Thanks in advance,

Diego Azevedo

Re: Updatable Footer

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 16.05.2016 um 16:12 schrieb Diego Azevedo:
> Hello All,
>
> My question is how can I update a page footer in incremental updates:
>
> My page structure looks like this:
>
>    3 0 obj
>    <<
>    /Type /Page
>    /Parent 2 0 R
>    [...]
>    /Contents [6 0 R 7 0 R]
>     >>
>    endobj
>
> The object 7 0 obj contains the footer. But this is a signed pdf, and 
> I want to "update" this footer before another signature, creating 
> another COSStream with the new contents and giving it the same object 
> number (and possibly another revision number -> 7 1 obj, but that's 
> not critical).

 From the problems I saw when working on multiple signatures, I'd expect 
that you'd get a "document was modified" notice in Adobe Reader.

>
> I tried to retrieve this PD/COSStream, create the outputstream, write 
> the new content and "save incremental" but it didn't work.

You'd need to set these objects for update, similar as it is done in the 
signature code in PDDocument.addSignature(). Call 
setNeedToBeUpdated(true) on existing objects (e.g. the contents array 
and the page object)

>
> On a related subject, can I add a footer (without any signature) to 
> all pages with the same object number?

Sure.

Tilman

>
>
> Thanks in advance,
>
> Diego Azevedo
>


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