Jeremias Maerki wrote: > On 29.08.2005 01:51:21 Stephen Denne wrote: > > Luca Furini wrote: > > > > > The method PageNumberCitationLM.get() allocates the width of > > > the string > > > "MMM" if the id is not already known; > > > > Could a FOP extension element be added to indicate how many > pages the > > document is likely to be, and allocate the initial width > based on that? > > A little hacky IMO. Image a document that is estimated to be between 9 > and 11 pages. You still don't know how many pages there will > effectively > be. In that case this extension will not help at all. It's > better we try > to take the right steps to solve this.
I agree that a effort should be expended in designing and coding the right solution, and I didn't mean for my suggestion to be a complete solution. If an initial estimate is chosen for the width, which turns out to be fairly accurate, then less adjustments to the layouts will be required. With the example of a document that is likely to be between 9 and 11 pages; consider using an initial estimate of needing space for the numbers up to 11, then adjusting the spacings within the lines (or more extensive layout rework) once the actual numbers are resolved. Such an algorithm would work better with a better initial estimate. An initial estimate supplied by the user is bound to be better than allocating space for "MMM". I've also realised that such an extension should actually be an attribute on page-number-citation, indicating how much width is expected for the page number of the ref-id. > > Incidentally, are there any workarounds for right aligning > "Page X of Y" in > > a block in a cell in a row in a table so that it is > correctly right aligned > > with other table rows, even when there are not between 100 > and 999 pages in > > the output? > > Work-arounds for 0.20.5? The new FOP should eventually not require > work-arounds at all. Yes 0.20.5, sorry I didn't mean to divert attention away from development. I perhaps should've asked that question in a new email to fop-users, but I have current user requirements that I'm having difficulty meeting due to a document that can have between two and three pages, and it always has: " Previous right aligned line" " Previous right aligned line" " Page 1 of 3 " and I figured since this problem was being discussed here, I'd ask what people were doing for this scenario? Stephen Denne.
