From: <no...@so...> - 2001-09-22 20:03:48
|
Feature Requests item #450559, was opened at 2001-08-13 11:15 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=373750&aid=450559&group_id=21935 Category: None Group: None >Status: Deleted Priority: 5 Submitted By: David Cramer (dcramer) Assigned to: Nobody/Anonymous (nobody) >Summary: Include "covers" for pdfs in xsl fo Initial Comment: We use full-page gifs for "covers" on our pdfs. I've hacked at the xsl/fo stylesheets to add one in. In this version if you set include.cover to 1, it will include a page at the beginning of the document with the image: images/cover.gif. I'm sure there's a more graceful way to do this, so I'm including it as a feature request: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version='1.0'> <xsl:param name="include.cover"/> <xsl:template name="user.pagemasters"> <fo:simple-page-master margin-right="0in" margin-left="0in" margin-bottom="0in" margin-top="0in" page-height="11in" page-width="8.5in" master-name="cover"> <fo:region-body margin-top="0pt" margin-bottom="0pt"/> <fo:region-before extent="0pt" region-name="xsl-region-before-first"/> <fo:region-after extent="0pt" region-name="xsl-region-after-first"/> </fo:simple-page-master> <fo:page-sequence-master master-name="cover1"> <fo:repeatable-page-master-alternatives> <fo:conditional-page-master-reference master-name="cover"/> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> </xsl:template> <xsl:template match="/"> <xsl:message> <xsl:text>Making </xsl:text> <xsl:value-of select="$page.orientation"/> <xsl:text> pages on </xsl:text> <xsl:value-of select="$paper.type"/> <xsl:text> paper (</xsl:text> <xsl:value-of select="$page.width"/> <xsl:text>x</xsl:text> <xsl:value-of select="$page.height"/> <xsl:text>)</xsl:text> </xsl:message> <xsl:variable name="document.element" select="*[1]"/> <xsl:variable name="title"> <xsl:choose> <xsl:when test="$document.element/title[1]"> <xsl:value-of select="$document.element/title [1]"/> </xsl:when> <xsl:otherwise>[could not find document title] </xsl:otherwise> </xsl:choose> </xsl:variable> <fo:root font-family="{$body.font.family}" font-size="{$body.font.size}" text-align="{$alignment}"> <xsl:if test="$xep.extensions != 0"> <xsl:call-template name="xep-document- information"/> </xsl:if> <xsl:call-template name="setup.pagemasters"/> <xsl:choose> <xsl:when test="$rootid != ''"> <xsl:choose> <xsl:when test="count(id($rootid)) = 0"> <xsl:message terminate="yes"> <xsl:text>ID '</xsl:text> <xsl:value-of select="$rootid"/> <xsl:text>' not found in document.</xsl:text> </xsl:message> </xsl:when> <xsl:otherwise> <xsl:if test="$fop.extensions != 0"> <xsl:apply-templates select="id ($rootid)" mode="outline"/> </xsl:if> <xsl:if test="$xep.extensions != 0"> <rx:outline xmlns:rx="http://www.renderx.com/XSL/Extensions"> <xsl:apply-templates select="id ($rootid)" mode="xep.outline"/> </rx:outline> <!--This is a hack --> <xsl:if test="$include.cover = 1"> <fo:page-sequence master- name="cover1"> <fo:flow flow-name="xsl-region- body"> <fo:block> <fo:external-graphic content-height="scale-to- fit" height="auto" width="auto" src="images/cover.gif" content-width="7in"/> </fo:block> </fo:flow> </fo:page-sequence> </xsl:if> </xsl:if> <xsl:apply-templates select="id($rootid)"/> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:if test="$fop.extensions != 0"> <xsl:apply-templates mode="outline"/> </xsl:if> <xsl:if test="$xep.extensions != 0"> <rx:outline xmlns:rx="http://www.renderx.com/XSL/Extensions"> <xsl:apply-templates mode="xep.outline"/> </rx:outline> </xsl:if> <!--This is a hack --> <xsl:if test="$include.cover = 1"> <fo:page-sequence master-name="cover1"> <fo:flow flow-name="xsl-region-body"> <fo:block> <fo:external-graphic content-height="scale-to-fit" height="auto" width="auto" src="images/cover.gif" content-width="7in"/> </fo:block> </fo:flow> </fo:page-sequence> </xsl:if> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </fo:root> </xsl:template> </xsl:stylesheet> ---------------------------------------------------------------------- >Comment By: David Cramer (dcramer) Date: 2001-09-22 13:03 Message: Logged In: YES user_id=281721 I'm deleting this because I'm pretty sure it's supposed to be possible with titlepage.xsl, though I've never gotten a mediaobject in the bookinfo to show up on a title page using the titlepage template system. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=373750&aid=450559&group_id=21935 |