You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Th...@HVBSystems.com on 2006/01/10 11:07:17 UTC

Page Numbers in PDF, Merging documents

Dear all, 
 
I have a document which defines a header and footer in RTF. I am using
RTFtoFO to generate the fo file.
Next I am merging another fo document by appending the flow body subtree to
the flow body of the first file.
 
The resulting pdf displays in the footer on page 1 "Page 1 of 1", on page 2
the footer is gone and on page 3 it displays "Page 3 of 1", which is not bad
but still wrong. It should be "Page 3 of 3".
 
Does anybody have a hint where I can start the search for a fix ?
Is the idea of appending document by combining their flow subtrees wrong ?
Can this effect page numbering (because the document's size is increased) ?
 
Thanks, Thomas 
 
 

 
 


Re: AW: Page Numbers in PDF, Merging documents

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
On 10.01.2006 16:03:53 Thomas.Schmitt.extern wrote:
> I am doing this in java, extending the keys is already done.
> What I do not understand, is that the second footer is missing and overall
> number of pages is wrong.

Well, without actually seeing what you're doing it's difficult to help
here. If you can post an FO file that you combined from two FO files,
I can have a closer look.

> Why do I have to combine the layout master ? I only would like to append the
> content.

That step is only necessary if you combine documents with different
layout masters. If all your documents use the same, that step can be
ignored.

> The master of the first document should be kept as it is.
> Or maybe I just misunderstood how page numbers are generated.

FOP simply looks up on which page the element with the "id" is located
for the "ref-id" you specified in a page-number-citation. If you have
the referenced FO on the first page it returns page 1. As simple as that.

> Best, Thomas
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Jeremias Maerki [mailto:dev@jeremias-maerki.ch] 
> Gesendet: Dienstag, 10. Januar 2006 13:12
> An: fop-users@xmlgraphics.apache.org
> Betreff: Re: Page Numbers in PDF, Merging documents
> 
> 
> Page x of y is usually implemented through page-number-citation in XSL-FO.
> When merging documents you have to make sure that the page-number-citation
> points at the correct "id". When combining documents you have to combine the
> layout-master-set and then put the individual page-sequences after each
> other. Furthermore, you need to make sure no "id" attributes will be
> duplicate otherwise you may get errors during processing. I've once written
> a stylesheet that duplicates an XSL-FO document n times into a single
> resulting XSL-FO document. The key here is to prefix all the "id" and
> "ref-id" attribute values so obtain unique IDs.
> 
> On 10.01.2006 11:07:17 Thomas.Schmitt.extern wrote:
> > Dear all,
> >  
> > I have a document which defines a header and footer in RTF. I am using 
> > RTFtoFO to generate the fo file. Next I am merging another fo document 
> > by appending the flow body subtree to the flow body of the first file.
> >  
> > The resulting pdf displays in the footer on page 1 "Page 1 of 1", on 
> > page 2 the footer is gone and on page 3 it displays "Page 3 of 1", 
> > which is not bad but still wrong. It should be "Page 3 of 3".
> >  
> > Does anybody have a hint where I can start the search for a fix ? Is 
> > the idea of appending document by combining their flow subtrees wrong 
> > ? Can this effect page numbering (because the document's size is 
> > increased) ?
> >  
> > Thanks, Thomas
> 
> 
> Jeremias Maerki



Jeremias Maerki


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


Re: Page Numbers in PDF, Merging documents

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Page x of y is usually implemented through page-number-citation in
XSL-FO. When merging documents you have to make sure that the
page-number-citation points at the correct "id". When combining
documents you have to combine the layout-master-set and then put the
individual page-sequences after each other. Furthermore, you need to
make sure no "id" attributes will be duplicate otherwise you may get
errors during processing. I've once written a stylesheet that duplicates
an XSL-FO document n times into a single resulting XSL-FO document. The
key here is to prefix all the "id" and "ref-id" attribute values so
obtain unique IDs.

On 10.01.2006 11:07:17 Thomas.Schmitt.extern wrote:
> Dear all, 
>  
> I have a document which defines a header and footer in RTF. I am using
> RTFtoFO to generate the fo file.
> Next I am merging another fo document by appending the flow body subtree to
> the flow body of the first file.
>  
> The resulting pdf displays in the footer on page 1 "Page 1 of 1", on page 2
> the footer is gone and on page 3 it displays "Page 3 of 1", which is not bad
> but still wrong. It should be "Page 3 of 3".
>  
> Does anybody have a hint where I can start the search for a fix ?
> Is the idea of appending document by combining their flow subtrees wrong ?
> Can this effect page numbering (because the document's size is increased) ?
>  
> Thanks, Thomas 


Jeremias Maerki


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