Re: [xsl] [FO] image on even, table on odd, repeating image if the table is more than one page

Subject: Re: [xsl] [FO] image on even, table on odd, repeating image if the table is more than one page
From: Philip Vallone <philip.vallone@xxxxxxxxxxx>
Date: Wed, 11 Jul 2012 08:38:38 -0400
This looks like a MIL-STD-40051 requirement for a RPSTL work package. The way
I did this was  count the graphics. If the graphic count = 0, then page break
and do not break if graphic-count mod 2 = 0. This works except if the image
and the parts list could fit on a single page. I have the XML author either
add a process instruction to apply no page breaks or use an attribute value to
trigger the page breaks not to break.

Regards,

Phil

Sent from Phil's iPhone

On Jul 11, 2012, at 8:01 AM, "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
wrote:

> At 2012-07-11 13:32 +0200, Geert Bormans wrote:
>> I have a part list table that I need to show on the odd page of a PDF
>> I have an image that goes with the part list, that I have to show on the
even page.
>> In case the table breaks over multiple pages, I need to keep the table on
the odd pages only
>> and I need to repeat the image on each opposite even page.
>>
>> Does anyone have an idea on how to do this?
>
> I think this can be done with markers, but I haven't got the time this
morning to write up a working mock-up:
>
> (1) - create a page sequence master that alternates the odd page having
>       a body region for content with the even page having a body region
>       without content ... this will flow the table on only the odd pages
> (2) - in a perimeter region for the even page, create an absolute block
>       container the same size as odd-page-body-region, and in that
container
>       retrieve, in order, one marker for each diagram that might be
>       needed by the table
> (3) - define all diagram markers as empty
> (4) - when flowing the table, put the image associated with content into
>       that diagram's marker, clearing out the marker when the diagram is
>       no longer relevant
>
>> I would prefer something that works with FOP
>> If this can't be done with FOP, please suggest an alternative
>
> Your requirement is quite particular ... off the top I cannot think of an
alternative.  And I haven't tested the above, but I would write my test
following those steps.
>
> Sadly, having written out the algorithm I worry this won't work because the
markers are defined in the flow *after* the page on which you want the images
... I now think the above steps will put the images on the even page *after*
the odd page, which is not what you need.
>
> You may be out of luck.  There is no "look ahead" in XSL-FO ... I can't see
a way of knowing what to put on page "n" based on content on page "n+1".
>
> No problem with the odd-page-only table flowing ... I just think you can't
get the images to work.
>
> I hope this helps, even if it isn't a solution, in that I hope it helps to
know that there may not be a pure XSL-FO solution.  With post-processing you
might be able to swap pages in some way ... but I think that would be
untenable.
>
> . . . . . . . . . . . Ken
>
>
> --
> Public XSLT, XSL-FO, UBL and code list classes in Europe -- Oct 2012
> Contact us for world-wide XML consulting and instructor-led training
> Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm
> Crane Softwrights Ltd.            http://www.CraneSoftwrights.com/s/
> G. Ken Holman                   mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
> Google+ profile: https://plus.google.com/116832879756988317389/about
> Legal business disclaimers:    http://www.CraneSoftwrights.com/legal

Current Thread