xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pepone pepone <pepone.on...@gmail.com>
Subject Fop postscript problems
Date Tue, 05 Apr 2005 14:48:18 GMT
Hello I creating a xsl-fo template to producte postscript files
to print. when i use the Driver.RENDER_PS the size of the page
is not the size that i put in the xsl-fo. if i render the same xsl-fo
whit Driver.RENDER_PDF the result is fine.

is this a know bug on  Driver.RENDER_PS or is an error on my page template?

Thanks in advantage

====Xsl Template==========

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
exclude-result-prefixes="fo">
  <xsl:output method="xml" version="1.0" omit-xml-declaration="no"
indent="yes"/>
  <!-- ========================= -->
  <!-- root element: projectteam -->
  <!-- ========================= -->
  <xsl:template match="/">
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
      <fo:layout-master-set>
        <fo:simple-page-master 
			master-name="ticket" 
			page-width="72mm"
			page-height="2000mm" 
			margin-top="2mm" 
			margin-bottom="2mm" 
			margin-left="2mm" 
			margin-right="2mm">
       		<fo:region-body
				width="70mm"
				height="97mm"/>
        </fo:simple-page-master>
      </fo:layout-master-set>
	  
      <fo:page-sequence master-reference="ticket">
        <fo:flow flow-name="xsl-region-body">	
		  <fo:block
		  	width="72mm">
			<fo:block>
				<xsl:call-template name="header"/>
			</fo:block>
		  	<fo:block>
				<xsl:call-template name="ticket"/>
			</fo:block>
			<fo:block>
				<xsl:call-template name="total"/>
			</fo:block>
			<fo:block>
				<xsl:call-template name="footer"/>
			</fo:block>
		</fo:block>
        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>
  <!-- ========================= -->
  <!-- child element: member     -->
  <!-- ========================= -->
  
  <xsl:template name="ticket">
  	<fo:block font-size="10pt" width="72mm">
		Productos:
		<fo:table table-layout="fixed"
			margin-top="4mm"
			margin-left="2mm"
			margin-right="2mm"
			width="69mm">
			<fo:table-column column-width="32mm"/>  
			<fo:table-column column-width="32mm"/>
			<fo:table-body>
				<xsl:for-each select="/ticket/products/item">
					<xsl:apply-templates select="."/>
				</xsl:for-each>
			</fo:table-body>
		</fo:table>
	</fo:block>
  </xsl:template>
  
  <xsl:template match="item">
    <fo:table-row>
      <fo:table-cell>
        <fo:block font-size="10pt" 
			padding-top="1mm"
			border="1pt"
			border-color="black">
          <xsl:value-of select="./@name"/>
        </fo:block>
      </fo:table-cell>
      <fo:table-cell>
        <fo:block font-size="10pt" text-align="right"
			padding-top="2mm">
          <xsl:value-of select="./@precio"/>
		  <xsl:text> x </xsl:text>
		  <xsl:value-of select="./@ud"/>
		  <xsl:text> = </xsl:text>
		  <xsl:value-of select="./@total"/>
        </fo:block>
      </fo:table-cell>
	</fo:table-row>
  </xsl:template>
 
  <xsl:template name="header">
  	<fo:table table-layout="fixed"
		margin-top="1mm"
		margin-right="1mm"
		margin-left="1mm"
		width="70mm">
		<fo:table-column column-width="20mm"/>
		<fo:table-column column-width="50mm"/>
		<fo:table-body>
			<fo:table-row>
				<fo:table-cell number-rows-spanned="5">
					<fo:block>
    					<fo:external-graphic  
							src="url(/home/pepone/forgenovell/trunk/xsl-fo/img/logo.gif)"/>
  					</fo:block>
				</fo:table-cell>
				<fo:table-cell>
					<fo:block font-size="10pt" font-weight="bold">
						On-ReZ
					</fo:block>
				</fo:table-cell>
			</fo:table-row>
			<fo:table-row>
				<fo:table-cell>
					<fo:block font-size="10pt">
						Cif: <xsl:value-of select="/ticket/@cif"/>
					</fo:block>
				</fo:table-cell>
			</fo:table-row>
			<fo:table-row>
				<fo:table-cell>
					<fo:block font-size="10pt">
						Num: <xsl:value-of select="/ticket/@number"/>
					</fo:block>
				</fo:table-cell>
			</fo:table-row>
			<fo:table-row>
				<fo:table-cell>
					<fo:block font-size="10pt">
						Fecha: <xsl:value-of select="/ticket/@date"/>
					</fo:block>
				</fo:table-cell>
			</fo:table-row>
			<fo:table-row>
				<fo:table-cell>
					<fo:block font-size="10pt">
						Hora: <xsl:value-of select="/ticket/@time"/>
					</fo:block>
				</fo:table-cell>
			</fo:table-row>
		</fo:table-body>
	</fo:table>
  </xsl:template>

  <xsl:template name="total">
  	<fo:block
		padding-top="1mm"
		padding-right="2mm"
		width="50mm"
		margin-top="5mm"
		margin-left="20mm">
		<fo:block font-size="10pt" text-align="right"
			padding-top="1mm"
			background-color="#cFcFcF">
				Total:	<xsl:value-of select="/ticket/@total"/>
		</fo:block>
		<fo:block font-size="10pt" text-align="right"
			padding-top="1mm">
				Entregado:	<xsl:value-of select="/ticket/@entregado"/>
		</fo:block>
		<fo:block font-size="10pt" text-align="right"
			padding-top="1mm"
			background-color="#cAcAcA">
				Cambio:	<xsl:value-of select="/ticket/@cambio"/>
		</fo:block>
	</fo:block>
  </xsl:template>
  
  <xsl:template name="footer">
		<fo:block 
			font-size="10pt" 
			text-align="center"
			padding-top="1mm">
				Le ha antendido: <xsl:value-of select="/ticket/@camarero"/>
		</fo:block>
		<fo:block 
			width="70mm"
			font-size="10pt" 
			text-align="center"
			padding-top="1mm">
				Gracias por su vista
		</fo:block>
	</xsl:template>
</xsl:stylesheet>


======XmlData==============

<?xml version="1.0" encoding="UTF-8"?>
<ticket
	date="01-Abril-2005"
	time="20:45:40"
	number="0001-a"
	total="120.55"
	entregado="200.00"
	cambio="79.45"
	camarero="Pepone"
	cif="23333434-c">
  <products>
    <item
		name="Tapa/Tortilla"
		ud="2"
		precio="1.75"
		total="3000.50"/>
		
	<item
		name="Tapa/Tortilla"
		ud="2"
		precio="1.75"
		total="3.50"/>
  </products>
</ticket>

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


Mime
View raw message