Briefkopf nur auf Seite 1 in FOP-PDF

lorenzm

Newbie
Registriert
Apr. 2014
Beiträge
7
Hi,
ich versuche derzeit an einem XSLT rumzuwerkeln: Die Vorarbeit hat ein Bekannter geleistet (wobei ich unsicher bin, wie sauber er hier gearbeitet hat).
Aktuell ist es leider so, dass das Barcode, Briefkopf und Absender/ Empfänger auf jeder Seite angezeigt werden; auch die Formatierung ist auf jeder Seite gleich und dies ist nicht wirklich gewünscht. Soll heißen: Ziele sind
  1. Logo, Briefkopf und Absender/ Empfänger sollen nur auf Seite 1 erscheinen
  2. Der Text soll auf Seite 1 erst nach 101.3mm anfangen, auf Folgeseiten aber bereits nach 36mm
  3. Die Seitenzahl soll auf jeder Seite ausgegeben werden

Ich hoffe, dass mir hier jemand fix helfen?

Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:date="http://exslt.org/dates-and-times" version="1.0">
	<xsl:output method="xml" indent="yes" />
	<xsl:variable name="now" select="date:date-time()" />
	<xsl:variable name="hauptschrift1">$settings.hauptschrift1</xsl:variable>
	<xsl:variable name="hauptschrift2">$settings.hauptschrift2</xsl:variable>
	<xsl:variable name="fontFamily">$settings.fontFamily</xsl:variable>
	<xsl:variable name="FontWeight">$settings.FontWeight</xsl:variable>
	<xsl:variable name="FontWeightBold">$settings.FontWeightBold</xsl:variable>
	<xsl:variable name="tableBorderStyle">$settings.tableBorderStyle</xsl:variable>
	<xsl:variable name="tableBorderWidthLinie">$settings.tableBorderWidthLinie</xsl:variable>

	#set($pfad="pfadzudensettings/settings/")
	<xsl:template match="publishDetail">
		<fo:root>
			<fo:layout-master-set>
				<fo:simple-page-master master-name="first-page" page-height="29.7cm" page-width="21.0cm" >
					<fo:region-body margin-left="25mm" margin-top="101.3mm" margin-bottom="11.3mm" margin-right="48.5mm"/>
					<fo:region-before region-name="regionBefore" extent="101.3mm" />
					<fo:region-after region-name="regionAfter" extent="11.3mm" />
				</fo:simple-page-master> 
			</fo:layout-master-set>

			<xsl:for-each select="Root">
				<xsl:choose>
					<xsl:when test="Antrag/status/k_request_status.uniquename != ''">
						<fo:page-sequence master-reference="first-page">
							<fo:static-content flow-name="regionBefore" font-family="{$fontFamily}">
								<!-- FUSSZEILE MIT SEITENZAHL UNTEN -->
								<fo:block-container height="10mm" width="32.5mm" left="169mm" top="285.7mm" position="absolute">
									<fo:block  font-size="{$hauptschrift2}">
										<fo:inline>Seite <fo:page-number />/<fo:page-number-citation ref-id="lastPage" /></fo:inline>
									</fo:block>
								</fo:block-container>
								
								<xsl:choose>
									<xsl:when test="eintest">
										<!-- BARCODE -->
										<fo:block-container height="10mm" width="20mm" left="25mm" top="13.4mm" position="absolute">
											<fo:block>
											</fo:block>
										</fo:block-container>
									</xsl:when>
									<xsl:otherwise>
										<!-- LOGO -->
										<fo:block-container height="35mm" width="45mm" left="161.5mm" top="13.4mm" position="absolute">
											<fo:block line-height="12pt" font-weight="{$FontWeightBold}" font-size="{$hauptschrift2}">
											</fo:block>
										</fo:block-container>
										<!-- BRIEFKOPF -->
										<fo:block-container height="70mm" width="32.4mm" left="169mm" top="51mm" position="absolute">
											<fo:block font-weight="{$FontWeightBold}" font-size="{$hauptschrift2}">
											</fo:block>
										</fo:block-container>
									</xsl:otherwise>
								</xsl:choose>

								<!-- ABSENDER -->
								<fo:block-container height="3cm" width="12cm" top="51mm" left="25mm" position="absolute">
									<fo:block font-size="{$hauptschrift2}" font-weight="$FontWeightBold">
									</fo:block>
								</fo:block-container>

								<!-- EMPFÄNGER -->
								<fo:block-container height="3cm" width="8.5cm" top="58.9mm" left="25.0mm" position="absolute">
								</fo:block-container>
							</fo:static-content>

							<!-- TEXT -->
							<fo:flow flow-name="xsl-region-body" font-family="{$fontFamily}">
								<fo:block>
								</fo:block>
								<fo:block id="lastPage" />
							</fo:flow>
						</fo:page-sequence>
					</xsl:when>
					<xsl:otherwise>
						<fo:page-sequence master-reference="first-page">
							<fo:static-content flow-name="regionBefore">
								<fo:block-container position="absolute" left="2.3cm" top="0.9cm" width="3.0cm">
									#parse("${pfad}letter.xsl")
								<fo:block />
								</fo:block-container>
								<fo:block />
							</fo:static-content>
							<fo:static-content flow-name="regionAfter">
								<fo:block />
							</fo:static-content>
							<fo:flow flow-name="xsl-region-body" font-family="{$fontFamily}">
								<fo:block color="black" text-align="center" font-weight="{$FontWeightBold}" font-size="10pt" line-height="25pt">alternativer text</fo:block>
							</fo:flow>
						</fo:page-sequence>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:for-each>
		</fo:root>
	</xsl:template>
</xsl:stylesheet>
 
Ich würde dir wirklich unglaublich gerne helfen, aber das du 100 Zeilen Code + einen kleinen einweisungs Text postest, des ist nicht sehr hilfreich Ich Empfehle dir das dann schon in ein Forum für nur Programmierer zu schreiben, ansonsten das hier etwas kürzer zu fassen, denn da steigt kaum einer durch denke ich Ich bin es zumindest net :p
 
Zurück
Oben