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 Jason Cowley <ja...@gmail.com> on 2006/06/22 12:33:54 UTC

Changing Orientation on Page Break

Hello all,

I am working on an application that dynamically generates XSL:FO xml,  
from XHTML forms to produce PDF output. On certain large tables  
within a document I would like to change the page orientation from  
portrait to landscape, and then revert back to portrait after the  
table for subsequent pages. So ideally I would like to change the  
page orientation after a page break. Is this possible, and if so can  
someone be so kind as to provide an example?

I use the following to force a page break:

<fo:block break-before="page"/>

I have tried setting the reference-orientation attribute to 90 on the  
block-container surrounding the table like so:

<fo:block-container reference-orientation="0">
   <fo:table>
     ...
   </fo:table>
</fo:block-container>

but this results the table text being rotated, except it is squashed  
into a narrow block so all of the text overlaps and no table borders  
are drawn.

Any help is greatly appreciated.

Thanks,

Jason


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


Re: Changing Orientation on Page Break

Posted by paul <sa...@gmx.ch>.
This works well for me too (thanks!), but another problem arises: My table
doesn't fit on one page. If it is oriented at 0 deg. on a portrait-page, the
table continues, as wished, on the next page, repeating the header in the first
line.
Oriented by 90 deg., the table just gets written across the border on the
righthand side, (or bottom side, if you flip the page to read the text). There's
no page-break.

I guess there's no easy way around this problem, is there?
cheers
ch


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


Re: Changing Orientation on Page Break

Posted by Jason Cowley <ja...@gmail.com>.
Thanks Rick. I'll bear your suggestion in mind for the future. At the  
moment this would be difficult to do because of how I am generating  
the XSL:FO.

Jason


On 22 Jun 2006, at 12:09, Rick Roen wrote:

> Jason,
>
> I have done this for tables that need either landscape or portrait
> orientation based on the width of the table.
>
> I setup two simple-page-masters:
>
> 			<fo:layout-master-set>
> 				<fo:simple-page-master
> master-name="landscape" margin="1cm 1cm 1cm 1cm" page-height="8.5in"
> page-width="11in">
> 					<fo:region-body/>
> 					<fo:region-after extent=".5cm"
> region-name="footer"/>
> 				</fo:simple-page-master>
> 				<fo:simple-page-master
> master-name="portrait" margin="1cm 1cm 1cm 1cm" page-height="11in"
> page-width="8.5in">
> 					<fo:region-body/>
> 					<fo:region-after extent=".5cm"
> region-name="footer"/>
> 				</fo:simple-page-master>
> 			</fo:layout-master-set>
>
>
> Then I make my decision like this:
>
> 				<fo:page-sequence>
> 					<xsl:attribute
> name="master-reference" select="if ($max-pocket gt 6) then  
> 'landscape' else
> 'portrait' "/>
>
> Perhaps you can adapt this to your use?
>
> Rick


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


RE: Changing Orientation on Page Break

Posted by Rick Roen <Ri...@LakeValleySeed.com>.
Jason,

I have done this for tables that need either landscape or portrait
orientation based on the width of the table.

I setup two simple-page-masters:

			<fo:layout-master-set>
				<fo:simple-page-master
master-name="landscape" margin="1cm 1cm 1cm 1cm" page-height="8.5in"
page-width="11in">
					<fo:region-body/>
					<fo:region-after extent=".5cm"
region-name="footer"/>
				</fo:simple-page-master>
				<fo:simple-page-master
master-name="portrait" margin="1cm 1cm 1cm 1cm" page-height="11in"
page-width="8.5in">
					<fo:region-body/>
					<fo:region-after extent=".5cm"
region-name="footer"/>
				</fo:simple-page-master>
			</fo:layout-master-set>


Then I make my decision like this:

				<fo:page-sequence>
					<xsl:attribute
name="master-reference" select="if ($max-pocket gt 6) then 'landscape' else
'portrait' "/>

Perhaps you can adapt this to your use?

Rick

-----Original Message-----
From: Jason Cowley [mailto:jacowley@gmail.com] 
Sent: Thursday, June 22, 2006 5:34 AM
To: fop-users@xmlgraphics.apache.org
Subject: Changing Orientation on Page Break

Hello all,

I am working on an application that dynamically generates XSL:FO xml,  
from XHTML forms to produce PDF output. On certain large tables  
within a document I would like to change the page orientation from  
portrait to landscape, and then revert back to portrait after the  
table for subsequent pages. So ideally I would like to change the  
page orientation after a page break. Is this possible, and if so can  
someone be so kind as to provide an example?

I use the following to force a page break:

<fo:block break-before="page"/>

I have tried setting the reference-orientation attribute to 90 on the  
block-container surrounding the table like so:

<fo:block-container reference-orientation="0">
   <fo:table>
     ...
   </fo:table>
</fo:block-container>

but this results the table text being rotated, except it is squashed  
into a narrow block so all of the text overlaps and no table borders  
are drawn.

Any help is greatly appreciated.

Thanks,

Jason


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



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