You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Torsten Erler <er...@net-linx.de> on 2002/04/24 15:07:44 UTC

Manipulating page-width / page-height

Hi all

Is there any way to invoke the width and height property of the PageMaster
instance, to set this page properties from within the java code??? In my xsl
template no width and height is set, but the rendered page comes with
576000x792000 mpixels. Can I manipulate the properties with my data (and if
yes where!).

ThanX Torsten


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


RE: Manipulating page-width / page-height

Posted by Torsten Erler <er...@net-linx.de>.
ThanX that is exactly what I need. I will check it out.
I've tried to overwrite AWTRenderer etc. [ for a lot of hours :( ], but no
usable result arose, because I had only the chance to scale the rendered
image into my format (thats not the right way for different page
geometries), for printing and print preview.

ThanX also to Jeremias Maerki, but I'm not so familiar with XSLT so that I
wasn't able to understand your suggestion correct.

cu all Torsten Erler

-----Original Message-----
From: J.Pietschmann [mailto:j3322ptm@yahoo.de]
Sent: Mittwoch, 24. April 2002 22:58
To: fop-dev@xml.apache.org
Subject: Re: Manipulating page-width / page-height


Torsten Erler wrote:
> Is there any way to invoke the width and height property of the PageMaster
> instance, to set this page properties from within the java code??? In my
xsl
> template no width and height is set, but the rendered page comes with
> 576000x792000 mpixels. Can I manipulate the properties with my data (and
if
> yes where!).

There are a lot of properties. The easiest way is probably
to use XSLT parameters.
Declare global parameters in the XSL file:
   <xsl:stylesheet xmlns:xsl="..." ...>
     <xsl:param name="page-height"/>
     <xsl:param name="page-width"/>

and use them in the page-master
    <xsl:template match="/">
      ...
      <fo:simple-page-master master-name="..."
         page-height={$page-height}
         page-width={$page-width}>
     ...
Look up details in the XSLT spec:
   http://www.w3.org/TR/xslt

You can set values for the parameters from your Java code
by using the setParameter() method of your transformer:
    transformer=factory.newTransformer(xsl);
    transformer.setParameter("page-height","29.1cm");
    transformer.setParameter("page-width","21.9cm");
Lookup details in the JAXP documentation.

J.Pietschmann


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


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


Re: Manipulating page-width / page-height

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Torsten Erler wrote:
> Is there any way to invoke the width and height property of the PageMaster
> instance, to set this page properties from within the java code??? In my xsl
> template no width and height is set, but the rendered page comes with
> 576000x792000 mpixels. Can I manipulate the properties with my data (and if
> yes where!).

There are a lot of properties. The easiest way is probably
to use XSLT parameters.
Declare global parameters in the XSL file:
   <xsl:stylesheet xmlns:xsl="..." ...>
     <xsl:param name="page-height"/>
     <xsl:param name="page-width"/>

and use them in the page-master
    <xsl:template match="/">
      ...
      <fo:simple-page-master master-name="..."
         page-height={$page-height}
         page-width={$page-width}>
     ...
Look up details in the XSLT spec:
   http://www.w3.org/TR/xslt

You can set values for the parameters from your Java code
by using the setParameter() method of your transformer:
    transformer=factory.newTransformer(xsl);
    transformer.setParameter("page-height","29.1cm");
    transformer.setParameter("page-width","21.9cm");
Lookup details in the JAXP documentation.

J.Pietschmann


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


Re: Manipulating page-width / page-height

Posted by Jeremias Maerki <je...@outline.ch>.
If you need to set the page properties dynamically I suggest you use
XSLT parameters that you will then use in your stylesheet. Your idea is
probably a bit difficult.

On 24.04.2002 15:07:44 Torsten Erler wrote:
> Hi all
> 
> Is there any way to invoke the width and height property of the PageMaster
> instance, to set this page properties from within the java code??? In my xsl
> template no width and height is set, but the rendered page comes with
> 576000x792000 mpixels. Can I manipulate the properties with my data (and if
> yes where!).
> 
> ThanX Torsten
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org


Cheers,
Jeremias Maerki


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