Re: [xsl] Empty lines Strike-out

Subject: Re: [xsl] Empty lines Strike-out
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 01 May 2004 09:03:25 -0400
At 2004-05-01 08:35 +0200, GAIAJPATHY S wrote:
   We have a problem in generating the Pdf using the XSL:FO, we need to
strike out the last page's empty lines if exists.

There are no such contingencies in XSL-FO for "do empty lines exist?".


For eg., if the last page
occupuies the 3/4th page we need to stikeout the 1/4 the page. How we can do
that in the XSL-FO?.

By thinking about backgrounds.


Is there any way we can find out relative position where we are in the page,

No.


If this can be achieved i think we can dynamically
include the image with a diagonal line. OR any other soultion u have please
do help us.

All I can think of is the following two steps:


(1) - create a background illustrating the strike-out region of the page for the full size of body region of the last page (in my example below I'm just using a silver background colour ... you would probably want to use a hash line graphic of some kind)

(2) - wrap all of the flow in a block whose background is white

Then as the formatter has flow, the region-wide surrounding block with the white background obscures the body-region's background ... but this stops when the flow stops and the remainder of the page reveal the background which will be your hashed line example.

If you are using break-before="page" in your flow then you can only use the background image in a conditional page master tested for the last page of the page sequence. If your entire document is simple flow, then it can be the background image for every page.

The example below works with both Antenna House and RenderX.

I hope this helps.

................ Ken

<?xml version="1.0" encoding="utf-8"?><!--gaiajpathy.fo-->
<root xmlns="http://www.w3.org/1999/XSL/Format";
      font-family="Times" font-size="20pt">

  <layout-master-set>
    <simple-page-master master-name="frame"
                        page-height="297mm" page-width="210mm"
                        margin-top="15mm" margin-bottom="15mm"
                        margin-left="15mm" margin-right="15mm">
      <region-body region-name="frame-body" background="silver"/>
    </simple-page-master>
  </layout-master-set>

<page-sequence master-reference="frame">

<flow xmlns="http://www.w3.org/1999/XSL/Format"; flow-name="frame-body"
      font-family="Times" font-size="20pt">

  <block background-color="white">
    <block>This is a test</block>
    <block start-indent="2in" end-indent=".5in" space-before=".5in">
      This is a test
    </block>
  </block>

</flow>
</page-sequence>
</root>


-- Public courses: Spring 2004 world tour of hands-on XSL instruction Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO

Hong Kong May 17-21; Bremen Germany May 24-28; Helsinki June 14-18

World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread