Loading ...
Sorry, an error occurred while loading the content.

Re: Suppress blank page at end of doc

Expand Messages
  • sluderisinthehouse
    ... of ... and ... do ... this? I ... if ... properties are ... having a ... of ... true for ... would get ... used on ... separate ... put the ... last ...
    Message 1 of 3 , Sep 23, 2004
    • 0 Attachment
      --- In XSL-FO@yahoogroups.com, "G. Ken Holman" <gkholman@c...> wrote:
      > At 2004-09-22 18:42 +0000, sluderisinthehouse wrote:
      > >I have searched for a few days on this subject and tried all kinds
      of
      > >tests but no luck. I need to suppress that last page of my report
      > >from printing. The XML created looks something like this:
      > >
      > ><my report>
      > > <resolution id='1234'>...</resolution>
      > > <resolution id='1234'>...</resolution>
      > > <resolution id='1234'>...</resolution>
      > ></my report>
      > >
      > >I can't change the XML much since it affects other reports. My XSL
      > >is setup to break the page after every "<resolution" but that
      > >generates one extra page at the end of the report with only the
      > >header and page count showing. For the moment I hacked the code
      and
      > >added a "footer" element at the end of each resolution except the
      > >last one.
      > >
      > ><my report>
      > > <resolution id='1234'>...<footer/></resolution>
      > > <resolution id='1234'>...<footer/></resolution>
      > > <resolution id='1234'>...</resolution>
      > >
      > ></my report>
      > >
      > >The XSL will break a page for each "footer". This is a bad way to
      do
      > >this but I am not sure what else to do. Has anyone run into
      this? I
      > >can't find any info on this so I assume that this is not a problem
      if
      > >done correctly (which of course I don't believe I am doing now).
      >
      > Just change your logic to do a break-before="page" instead of
      > break-after="page" ... many people don't realize that break
      properties are
      > conditions to be met, not commands to execute.
      >
      > Since the first block of the first page is at the start of a page,
      having a
      > break-before= is redundant but doesn't do anything. The condition
      of
      > having a break before the current position at the page level is
      true for
      > the very first block, so nothing happens. Many people think they
      would get
      > a blank page at the start, which isn't true when the property is
      used on
      > the first block of a page.
      >
      > An alternative for you would be to just put each resolution into a
      separate
      > page-sequence.
      >
      > If you have to do a break-after=, then another alternative is to
      put the
      > addition of break-after= in your XSLT into logic that tests the
      last
      > resolution:
      >
      > <xsl:if test="position()!=last()">
      > <xsl:attribute name="break-after">page</xsl:attribute>
      > </xsl:if>
      >
      > or
      >
      > <xsl:if test="following-sibling::resolution">
      > <xsl:attribute name="break-after">page</xsl:attribute>
      > </xsl:if>
      >
      > So, many ways to get around your problem.
      >
      > I hope one of these helps.
      >
      > ..................... Ken
      >
      > --
      > Upcoming publicly-subscribed XSL delivery: Helsinki Oct 18-20,2004
      > World-wide on-site corporate, govt. & user group XML/XSL training.
      > G. Ken Holman mailto:gkholman@C...
      > Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
      > Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
      > Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
      > Legal business disclaimers: http://www.CraneSoftwrights.com/legal

      Ken,

      The break-before did the trick! Explaining the breaks as conditions
      not commands changes my thought process on how FOP works and should
      make life a lot easier down the road.

      thank you!
      thank you!
      thank you!

      Steve
    Your message has been successfully submitted and would be delivered to recipients shortly.