incubator-odf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Asier <>
Subject Re: Update page count in generated document
Date Sat, 01 Dec 2012 20:18:29 GMT
On Sábado 01 diciembre 2012 16:29:21 Rob Weir escribió:

> > How can I force an update of all the page count footers and the index?
> An ODF document -- as just a static document on disk -- has no concept
> of a page.  A page only exists when the contents of a document are
> rendered according to a layout algorithm, taking into account page
> size, printer and font metrics, etc.
> So if you are using a tool that modifies the file format directly,
> without a full rendering of the document, it is hard to determine
> absolute page numbers or page counts.  However, once you load the
> generated document in an editor it should re-render the document and
> calculate and update the page breaks, page numbers, page counts, etc.

It's something strange because the "actual" page number is created with the appropiate 
value. Ex:

"Page 20 of 20" -> for last page before adding contents
"Page 21 of 20" -> first added page
"Page 22 of 20" -> second added page

So in a generated document some fields get updated and others not (page count, index)? 

If I can't get the total page count updated via code, I suppose that to render the 
document an instance of OpenOffice/LibreOffice must be used; this could be tricky in a 
headless server environment (at least in my scenario).


  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message