Actually it will only work if the images are in gif or jpg format and if the image url is an absolute link like http:// .......
I will submit soon a patch to allow the use of relative path in the images url. arnaud -----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Envoy� : mardi 27 janvier 2004 12:18 � : [EMAIL PROTECTED] Objet : cvs commit: maven-plugins/pdf/src/plugin-resources fo-cover.xslt fo-layouts.xslt evenisse 2004/01/27 03:18:03 Modified: pdf plugin.jelly plugin.properties project.properties project.xml pdf/src/plugin-resources fo-cover.xslt fo-layouts.xslt Log: From Arnaud Heritier : update the pdf cover with company and project logo Revision Changes Path 1.12 +10 -7 maven-plugins/pdf/plugin.jelly Index: plugin.jelly =================================================================== RCS file: /home/cvs/maven-plugins/pdf/plugin.jelly,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- plugin.jelly 26 Jan 2004 09:15:35 -0000 1.11 +++ plugin.jelly 27 Jan 2004 11:17:52 -0000 1.12 @@ -16,15 +16,18 @@ <j:set var="coverType" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.type')}"/> <j:set var="coverVersion" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.version')}"/> <j:set var="coverDate" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.cover.date')}"/> - <j:set var="projectLogo" value="${docsPdf}/images/${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.projectLogo')}"/> - <j:set var="companyLogo" value="${docsPdf}/images/${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.companyLogo')}"/> + <tstamp> + <format property="coverDate" pattern="${maven.xdoc.date.format}" locale="${maven.xdoc.date.locale}"/> + </tstamp> + <j:set var="projectLogo" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.projectLogo')}"/> + <j:set var="companyLogo" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.companyLogo')}"/> <j:set var="imageDpi" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.imageDpi')}"/> <j:set var="debug" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.debug')}"/> <j:set var="pdfName" value="${pom.getPluginContext('maven-pdf-plugin').getVariable('maven.pdf.pdfName')}"/> <mkdir dir="${docsPdf}"/> </goal> - <goal name="fo" prereqs="fo:fo" description="Generate XSL:FO project documentation"/> - <goal name="fo:fo" prereqs="pdf:prepare" description="Generate XSL:FO project documentation"> + <goal name="fo" prereqs="fo:fo" description="This simply pre-requisites the fo:fo goal. "/> + <goal name="fo:fo" prereqs="pdf:prepare" description="Generates an fo xml document from the ${maven.pdf.navigationFile} file supplied as part of the documentation. Please note that as yet, no sanity check is done to make sure this file exists."> <echo>Generating ${docsDest}/project.fo ...</echo> <available file="${docsToc}" property="maven.fo.navigation.available"/> <fail message="PDF generation cannot complete as ${docsToc} is missing" unless="maven.fo.navigation.available"/> @@ -49,7 +52,7 @@ <param name="debug" expression="${debug}"/> </style> </goal> - <goal name="pdf" prereqs="fo:fo,pdf:prepare,pdf:pdf" description="Generate PDF project documentation"/> + <goal name="pdf" prereqs="fo:fo,pdf:prepare,pdf:pdf" description="This is the default goal of the plugin and simply pre-requisites the pdf:pdf goal. "/> <goal name="pdf:prepare" prereqs="pdf:init" description="Stages all files needed to generate the PDF"> <!-- First, copy all of the generated xdocs --> <copy todir="${docsPdf}"> @@ -79,7 +82,7 @@ </fileset> </copy> </goal> - <goal name="pdf:pdf" description="Generate PDF project documentation" prereqs="pdf:prepare"> + <goal name="pdf:pdf" description="Generates a PDF document containing all project documentation. The PDF is generated from the .fo file generated in the fo:fo goal." prereqs="pdf:prepare"> <echo>Generating ${docsPdf}/${pdfName} ...</echo> <echo>Config file: ${docsPdf}/userconfig.xml</echo> <java classname="org.apache.fop.apps.Fop" fork="yes" failonerror="true" maxmemory="500m"> @@ -101,6 +104,6 @@ <arg value="${docsPdf}/${pdfName}"/> <sysproperty key="javax.xml.transform.TransformerFactory" value="org.apache.xalan.processor.TransformerFactoryImpl"/> </java> - <copy todir="${docsDest}" file="${docsPdf}/${pdfName}"/> + <copy todir="${docsDest}" file="${docsPdf}/${pdfName}"/> </goal> </project> 1.7 +2 -3 maven-plugins/pdf/plugin.properties Index: plugin.properties =================================================================== RCS file: /home/cvs/maven-plugins/pdf/plugin.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- plugin.properties 26 Jan 2004 09:15:35 -0000 1.6 +++ plugin.properties 27 Jan 2004 11:17:52 -0000 1.7 @@ -12,11 +12,10 @@ maven.pdf.debug=false maven.pdf.navigationFile=navigation.xml maven.pdf.pdfName=${pom.artifactId}.pdf -# Reserved for future use... maven.pdf.cover.projectCompany=${pom.organization.name} maven.pdf.cover.projectName=${pom.name} maven.pdf.cover.type=Project Documentation maven.pdf.cover.version=${pom.currentVersion} maven.pdf.cover.date=June 2, 2003 -maven.pdf.projectLogo=${pom.url}${pom.logo} -maven.pdf.companyLogo=${pom.organization.url}${pom.organization.logo} +maven.pdf.projectLogo=${pom.logo} +maven.pdf.companyLogo=${pom.organization.logo} 1.6 +2 -0 maven-plugins/pdf/project.properties Index: project.properties =================================================================== RCS file: /home/cvs/maven-plugins/pdf/project.properties,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- project.properties 15 Jan 2004 13:56:34 -0000 1.5 +++ project.properties 27 Jan 2004 11:17:52 -0000 1.6 @@ -5,3 +5,5 @@ maven.xdoc.version=${pom.currentVersion} maven.license.licenseFile=${basedir}/../../../LICENSE.txt +maven.pdf.projectLogo=http://maven.apache.org/images/maven.gif +maven.pdf.companyLogo=http://maven.apache.org/images/asf_logo_wide_clear.gif 1.26 +2 -2 maven-plugins/pdf/project.xml Index: project.xml =================================================================== RCS file: /home/cvs/maven-plugins/pdf/project.xml,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- project.xml 26 Jan 2004 08:27:03 -0000 1.25 +++ project.xml 27 Jan 2004 11:17:52 -0000 1.26 @@ -7,8 +7,8 @@ <id>maven-pdf-plugin</id> <name>Maven PDF Plug-in</name> <currentVersion>2.0-SNAPSHOT</currentVersion> - <description/> - <shortDescription>Java Project Management Tools</shortDescription> + <description>PDF Documentation generator</description> + <shortDescription>Generator of project documentation in PDF Format.</shortDescription> <url>http://maven.apache.org/reference/plugins/pdf/</url> <siteDirectory>/www/maven.apache.org/reference/plugins/pdf/</siteDirectory> <issueTrackingUrl>http://jira.codehaus.org/secure/BrowseProject.jspa?id=10356</issueTrackingUrl> 1.3 +79 -8 maven-plugins/pdf/src/plugin-resources/fo-cover.xslt Index: fo-cover.xslt =================================================================== RCS file: /home/cvs/maven-plugins/pdf/src/plugin-resources/fo-cover.xslt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- fo-cover.xslt 26 Jan 2004 05:55:44 -0000 1.2 +++ fo-cover.xslt 27 Jan 2004 11:18:03 -0000 1.3 @@ -1,16 +1,87 @@ <?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" version="1.0"> + <xsl:variable name="colWidth" select="$maxBodyWidth div 3"/> + <xsl:attribute-set name="cover.title"> + <xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute> + <xsl:attribute name="color">#000000</xsl:attribute> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + <xsl:attribute name="font-size">16pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set> + <xsl:attribute-set name="cover.subtitle"> + <xsl:attribute name="font-family">Helvetica,sans-serif</xsl:attribute> + <xsl:attribute name="color">#000000</xsl:attribute> + <xsl:attribute name="keep-with-next">always</xsl:attribute> + <xsl:attribute name="font-size">12pt</xsl:attribute> + <xsl:attribute name="font-weight">bold</xsl:attribute> + </xsl:attribute-set> + <xsl:attribute-set name="table.heading.rule"> + <xsl:attribute name="leader-length.optimum">100%</xsl:attribute> + <xsl:attribute name="leader-pattern">rule</xsl:attribute> + <xsl:attribute name="rule-thickness">0.5pt</xsl:attribute> + <xsl:attribute name="color">black</xsl:attribute> + </xsl:attribute-set> <xsl:template name="fo-cover"> <fo:page-sequence master-reference="cover-page"> <fo:flow flow-name="xsl-region-body"> - <fo:block xsl:use-attribute-sets="body.title" text-align="end"> - <xsl:value-of select="$coverProjectName"/> v.<xsl:value-of select="$coverVersion"/> - </fo:block> - <fo:block xsl:use-attribute-sets="body.h1" text-align="end" space-before="24pt" space-after="36pt"> - <xsl:value-of select="$coverProjectCompany"/> - </fo:block> - <fo:block xsl:use-attribute-sets="body.h1" text-align="end"> - <xsl:value-of select="$coverType"/> + <fo:block text-align="center"> + <fo:table table-layout="fixed"> + <fo:table-column column-width="{$colWidth}in"/> + <fo:table-column column-width="{$colWidth}in"/> + <fo:table-column column-width="{$colWidth}in"/> + <fo:table-body> + <fo:table-row> + <fo:table-cell> + <fo:block text-align="left" vertical-align="bottom"> + <fo:external-graphic src="{normalize-space($companyLogo)}" height="0.5in" width="auto" content-height="0.5in" content-width="auto"/> + </fo:block> + </fo:table-cell> + <fo:table-cell> + <fo:block/> + </fo:table-cell> + <fo:table-cell> + <fo:block text-align="right" vertical-align="bottom"> + <fo:external-graphic src="{normalize-space($projectLogo)}" height="0.5in" width="auto" content-height="0.5in" content-width="auto"/> + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row keep-with-previous="always"> + <fo:table-cell padding-after="4.75pt" number-columns-spanned="3"> + <fo:block line-height="1pt"> + <fo:leader xsl:use-attribute-sets="table.heading.rule"/> + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell number-columns-spanned="3"> + <fo:block xsl:use-attribute-sets="cover.subtitle" text-align="end" space-before="256pt" display-align="center"> + <xsl:value-of select="$coverProjectCompany"/> + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell number-columns-spanned="3"> + <fo:block xsl:use-attribute-sets="cover.title" text-align="end" space-before="24pt" display-align="center"> + <xsl:value-of select="$coverProjectName"/> v.<xsl:value-of select="$coverVersion"/> + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell number-columns-spanned="3"> + <fo:block xsl:use-attribute-sets="cover.subtitle" text-align="end" space-before="24pt" display-align="center"> + <xsl:value-of select="$coverType"/> + </fo:block> + </fo:table-cell> + </fo:table-row> + <fo:table-row> + <fo:table-cell number-columns-spanned="3"> + <fo:block xsl:use-attribute-sets="cover.subtitle" text-align="end" space-before="24pt" space-after="36pt" display-align="center"> + <xsl:value-of select="$coverDate"/> + </fo:block> + </fo:table-cell> + </fo:table-row> + </fo:table-body> + </fo:table> </fo:block> </fo:flow> </fo:page-sequence> 1.4 +2 -2 maven-plugins/pdf/src/plugin-resources/fo-layouts.xslt Index: fo-layouts.xslt =================================================================== RCS file: /home/cvs/maven-plugins/pdf/src/plugin-resources/fo-layouts.xslt,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- fo-layouts.xslt 26 Jan 2004 05:55:44 -0000 1.3 +++ fo-layouts.xslt 27 Jan 2004 11:18:03 -0000 1.4 @@ -17,8 +17,8 @@ <xsl:template name="fo-layouts"> <!-- Defines the layout set --> <fo:layout-master-set> - <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0.2in" margin-bottom="0.2in" margin-left="0.4in" margin-right="0.2in"> - <fo:region-body margin-top="4.72in"/> + <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0.2in" margin-bottom="0.2in" margin-left="{$bodySideMargins}in" margin-right="{$bodySideMargins}in"> + <fo:region-body margin-top="0.7in"/> </fo:simple-page-master> <fo:simple-page-master master-name="cover-inside" page-width="{$pageWidth}in" page-height="{$pageHeight}in" margin-top="0in" margin-bottom="0in" margin-left="0in" margin-right="0in"> <fo:region-body margin-top="0in"/> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
