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 "Readman, Devon" <De...@moh.gov.on.ca> on 2004/01/16 16:16:23 UTC

Set xsl:variable to fo:marker

Hi Everyone.
 
I'm trying to include a text 'note' value in the dynamic running header of
my pdf output. Currently, I'm using fo:marker to set the heading value when
processing which is retrieved within the fo:region-before. This works fine
as there are always only two lines of text so a set width is big enough.
Since the text 'note' can vary throughout the document I need to be able to
resize the fo:region-before through the use of a xsl:variable. Can you set
the value of a xsl:variable to the value of a fo:marker? I've tried with no
success -- just a hardcoded variable value works.
 
Thanks.
Devon
 
 
       <fo:simple-page-master master-name="large_footer">
                    <xsl:variable name="size">
                         <xsl:text
disable-output-escaping="yes">1.1in</xsl:text>
                    </xsl:variable>
          <fo:region-body margin-top="{$size}" margin-bottom="0.5in"/>
          <fo:region-before overflow="scroll" extent="{$size}"/>
          <fo:region-after extent="0.5in"/>
       </fo:simple-page-master>

-----Original Message-----
From: Dennis Myrén [mailto:Dennis.Myren@oslokb.no]
Sent: Friday, January 16, 2004 9:48 AM
To: fop-user@xml.apache.org
Subject: Omit space-before/space-after after page break



Hi.

 

I use FOP to generate a PDF document from FO.

I use space-before/space-after to get space between objects.

When there is not room for an object on the current page, a new page is
created and the rendering continues at the new page.

Sometimes this results in objects starting a little further down on the new
page than specified by the page margin, because of the space-before/after
that I have specified on the current object.

Is it possible to omit any space when rendering continues on a new page?

 

Maybe not well explained, but did you catch it?

 

Shortly, I want space between each object in the PDF, but I always want to
start on the same position on each page (page top margin)

 

Regards,

Dennis JD Myrén

Developer

Oslo Kode Bureau

Tel:      (+47) 98 00 11 92

Mail:   dennis@oslokb.no <ma...@oslokb.no> 

Web:    www.oslokb.no <http://www.oslokb.no> 

 


Re: stylesheets for XHTML -> XSL-FO

Posted by "M. Sean Gilligan" <se...@msgilligan.com>.
There's an article and stylesheet for XHTML -> XSL-FO on IBM DeveloperWorks:

http://www-106.ibm.com/developerworks/library/x-xslfo2app/


-- 
---------------------------------------------------------------------------
M. Sean Gilligan                    :
Catalla Systems, Inc.               : 831-439-9568 x11
---------------------------------------------------------------------------

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


Re: stylesheets for XHTML -> XSL-FO

Posted by Casper Gasper <ca...@caspergasper.com>.
> Is it this one:
>
> http://www.antennahouse.com/XSLsample/sample-xsl-xhtml2fo-200201.zip
>
> ?
>

Yep, that's the one.  Looks like I'll just have to amend it to work 
with Fop.  Someone else sent a link to a different stylesheet which 
also failed; on the basis of a very quick look the AntennaHouse one 
looked more comprehensive.
Thanks anyway,

  casper.


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


RE: stylesheets for XHTML -> XSL-FO

Posted by "Andreas L. Delmelle" <a_...@pandora.be>.
> -----Original Message-----
> From: Casper Gasper [mailto:cas@caspergasper.com]
>
> Are there any general purpose stylesheets out there to transform XHTML
> to the type of XSL-FO that Fop likes?  I've found one, but it produces

Is it this one:

http://www.antennahouse.com/XSLsample/sample-xsl-xhtml2fo-200201.zip

?

Well, it's meant for use with AntennaHouse... but anyway.
(Hmmm... maybe we could provide a small demo package to come with FOP
someday. I've pointed a few people to these stylesheets, but never really
had a look at them. Time to start studying them in more detail!)

Hope it helps!

Cheers,

Andreas


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


stylesheets for XHTML -> XSL-FO

Posted by Casper Gasper <ca...@caspergasper.com>.
Are there any general purpose stylesheets out there to transform XHTML 
to the type of XSL-FO that Fop likes?  I've found one, but it produces 
output that Fop hasn't implemented yet.  I have a series of very small 
xhtml files I'd like to render to pdf and I just want to check there 
aren't perfectly good stylesheets out there before I write my own.


  casper.


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


Re: Set xsl:variable to fo:marker

Posted by Clay Leeds <cl...@medata.com>.
I don't think you can different text in the static-content like  
region-before/-after, although you might be able to use footnotes as a  
work-around.

As for dynamically sizing the HEADER/FOOTER regions, I use the  
following system:

In my XSL-FO documents, the HEADER (fo:region-before) & FOOTER  
(fo:region-after) are dynamically sized according to the number of  
lines which will print (the HEADER is a little more complex, because it  
has a minimum size, and in certain cases gets larger). The FOOTER is  
pretty simple. I count the number of lines which will print (up to 6),  
and multiple that count() by my line-height (.3cm). The line-height  
will vary depending on the font-family and font-size you choose. In  
addition, I've found that the output from -pdf and -ps tends to be  
smaller, so you may have to play with it a bit. Thank goodness for  
re-cycled paper!

I hope this helps!

Web Maestro Clay

p.s. Here's some code to get you started. (it's edited from my "real"  
stuff--hopefully it still works!)

<!-- ============================== -->
<!-- BEGIN - ATTRIBUTES and VARIABLES SECTION -->
<!-- ======== -->
<!--    BEGIN - "Dynamic Header and Footer SIZE" VARs -->
<!--      varUnitOfMeasure_DEFAULT | minimum height for EOR - default:  
cm -->
<xsl:variable name="varUnitOfMeasure_DEFAULT">cm</xsl:variable>
<!--      varHeaderMinHeight_DEFAULT | minimum height for EOR -  
default:5.15 (cm) -->
<xsl:variable name="varHeaderMinHeight_DEFAULT">5.15</xsl:variable>
<!--      varLineHeight_DEFAULT | line height for EOR - default:.3 (cm)  
-->
<xsl:variable name="varLineHeight_DEFAULT">.3</xsl:variable>
<!--      varHeadingLineHeight_DEFAULT | Heading line height for EOR  
(includes "Continued on next page..." line) - default:1.25 (cm) -->
<xsl:variable name="varHeadingLineHeight_DEFAULT">1.25</xsl:variable>
<!--      varHeadingFontSize_DEFAULT | font-size for Headings -  
default=9pt - -->
<!--  END - "Dynamic Header and Footer SIZE" VARs -->
<!-- ======== -->
<fo:layout-master-set>
   <fo:simple-page-master master-name="repeating" page-height="28cm"  
page-width="22cm" margin-top="1cm" margin-bottom="1.5cm"  
margin-left="1cm" margin-right="0cm">
     <fo:region-body margin-top="2cm">
       <xsl:attribute name="margin-top"><xsl:value-of  
select="format- 
number($varHeaderMinHeight_DEFAULT+2*$varLineHeight_DEFAULT,'#.00')"/ 
 ><xsl:value-of select="$varUnitOfMeasure_DEFAULT"/></xsl:attribute>
       <xsl:attribute name="margin-bottom"><xsl:value-of  
select="format-number(count(EOB/TRAILER/TRAILERLINE[.! 
=''])*$varLineHeight_DEFAULT+$varHeadingLineHeight_DEFAULT,'#.00')"/ 
 ><xsl:value-of select="$varUnitOfMeasure_DEFAULT"/></xsl:attribute>
     </fo:region-body>
     <fo:region-before>
       <xsl:attribute name="extent"><xsl:value-of  
select="format- 
number($varHeaderMinHeight_DEFAULT+2*$varLineHeight_DEFAULT,'#.00')"/ 
 ><xsl:value-of select="$varUnitOfMeasure_DEFAULT"/></xsl:attribute>
     </fo:region-before>
     <fo:region-after>
       <xsl:attribute name="extent"><xsl:value-of  
select="number(count(EOB/TRAILER/TRAILERLINE[.! 
=''])*$varLineHeight_DEFAULT+$varHeadingLineHeight_DEFAULT)"/><xsl: 
value-of select="$varUnitOfMeasure_DEFAULT"/></xsl:attribute>
     </fo:region-after>
   </fo:simple-page-master>
   <fo:page-sequence-master master-name="repeating_pm">
     <fo:repeatable-page-master-reference master-name="repeating"/>
   </fo:page-sequence-master>
</fo:layout-master-set>

On Jan 16, 2004, at 7:16 AM, Readman, Devon wrote:
> Hi Everyone.
>
> I'm trying to include a text 'note' value in the dynamic running  
> header of my pdf output. Currently, I'm using fo:marker to set the  
> heading value when processing which is retrieved within the  
> fo:region-before. This works fine as there are always only two lines  
> of text so a set width is big enough. Since the text 'note' can vary  
> throughout the document I need to be able to resize the  
> fo:region-before through the use of a xsl:variable. Can you set the  
> value of a xsl:variable to the value of a fo:marker? I've tried with  
> no success -- just a hardcoded variable value works.
>
> Thanks.
>
> Devon 
>
>        <fo:simple-page-master master-name="large_footer">
>                     <xsl:variable name="size">
>                          <xsl:text  
> disable-output-escaping="yes">1.1in</xsl:text>
>                     </xsl:variable>
>           <fo:region-body margin-top="{$size}" margin-bottom="0.5in"/>
>           <fo:region-before overflow="scroll" extent="{$size}"/>
>           <fo:region-after extent="0.5in"/>
>        </fo:simple-page-master>

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


Re: Set xsl:variable to fo:marker

Posted by Chris Bowditch <bo...@hotmail.com>.
Readman, Devon wrote:

> Hi Everyone.
>  
> I'm trying to include a text 'note' value in the dynamic running header 
> of my pdf output. Currently, I'm using fo:marker to set the heading 
> value when processing which is retrieved within the fo:region-before. 
> This works fine as there are always only two lines of text so a set 
> width is big enough. Since the text 'note' can vary throughout the 
> document I need to be able to resize the fo:region-before through the 
> use of a xsl:variable. Can you set the value of a xsl:variable to the 
> value of a fo:marker? I've tried with no success -- just a hardcoded 
> variable value works.

The short answer is No, you cant.

xsl:variable is processed at XSLT stage whilst fo:marker is processed by 
FOP after XSLT processing has completed. So xsl:variable has no 
visibility of fo:marker.

Also xsl:variable can only be set once. The name variable is a bit 
misleading.

Chris




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