[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] adding a cover image to the PDF
That didn't work with a strange fo message. net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: "fo:flow" is missing child elements. Required content model: marker* (%block;)+ (See position 1:-1) Looking at the example on 13.12, I'm guessing that you are assuming that I have already created a titlepage template and added it to my customization file. I have not done this (although I plan to). http://www.sagehill.net/docbookxsl/PageDesign.html#CustomPageSequences If that is not the case, I'm afraid I really have no idea what the following line means: <xsl:with-param name="master-reference">titlepage</xsl:with-param> Rather than ask you (or someone else) to explain, let me offer my (probably wrong) guess about what the code you provided does, and you can tell me how wrong I am. Are you ready to laugh?! ********************************PROBABLY WRONG! Docbook lets you add a statement to your customization layer file to invoke a blank template called front.cover. In this front.cover template, you can add extra information which will alter the titlepage template and in this case, specifically a component of titlepage called page.sequence. This page.sequence subtemplate will alter the xsl-fo output from the entire docbook project so that any raw docbook xml appearing inside the <xsl:with-param name="content"> will slip neatly inside the titlepage template. ********************************END OF PROBABLY WRONG! Have I told you I am good at writing fiction? :) Robertr On Wed, Aug 25, 2010 at 11:39 AM, Bob Stayton <bobs@sagehill.net> wrote: > Hi Robert, > The existing template that matches on book in fo/division.xsl already calls > the template named "front.cover", so you don't need that bit. For the other > template, I think all you need to add is putting the content into a > page-sequence, which can be done with the utility template named > "page.sequence" created for that purpose. An example of its usage is here: > > http://www.sagehill.net/docbookxsl/PageDesign.html#CustomPageSequences > > In your case, it might look like this: > > <xsl:template name="front.cover"> > <xsl:call-template name="page.sequence"> > <xsl:with-param name="master-reference">titlepage</xsl:with-param> > <xsl:with-param name="content"> > <mediaobject ... > </xsl:with-param> > </xsl:call-template> > </xsl:template> > > Bob Stayton > Sagehill Enterprises > bobs@sagehill.net > > > ----- Original Message ----- From: "Robert Nagle" > <idiotprogrammer@gmail.com> > To: <docbook-apps@lists.oasis-open.org> > Sent: Wednesday, August 25, 2010 8:13 AM > Subject: [docbook-apps] adding a cover image to the PDF > > >> Hi, there I need to produce a pre-release of my print book as a PDF. >> It's due tomorrow. It won't be "totally ready" (and I have not added >> a title page), but I just wanted to include a jpg for the page that >> will be the front cover. >> >> I'm using Apache FOP, although eventually I'll be using XEP. >> >> This seems hard. >> >> Reading through the docs and the mailing list, I tried to do this in >> my xslt file: >> >> ***************************************** >> <xsl:template name="front.cover"> >> <mediaobject> >> >> <imageobject role="fo"> >> <imagedata fileref="fo-images/criteria-tag312.jpg" >> contentwidth="7cm"/> >> </imageobject> >> </mediaobject> >> >> </xsl:template> >> >> <xsl:template match="book"> >> <xsl:call-template name="front.cover"/> >> <xsl:apply-imports/> >> </xsl:template> >> >> ***************************************************************************** >> I'm sure I'm missing some subtlety here, but shouldn't be easy as this? >> >> One other thought is that perhaps front.cover needs to be in fo, but >> frankly I have no idea how to go about that. >> >> This is stuff I need to learn pretty soon anyway, but for tomorrow is >> there a simple and dirty solution to this? >> >> in my index.xml I have this at the top: >> >> <info> >> <title>My Book Title </title> >> <author> >> <personname> >> <firstname>Robert </firstname> >> <surname>Nagle </surname> >> </personname> >> </author> >> <!--<cover> >> <mediaobject> >> >> <imageobject role="fo"> >> <imagedata fileref="fo-images/criteria-tag312.jpg" >> contentwidth="7cm"/> >> </imageobject> >> </mediaobject> >> </cover>--> >> ***************************** I tried referencing it here also without >> success >> </info> >> >> >> >> -- >> Robert Nagle >> 12777 Ashford Point Dr #1417 >> Houston, Texas 77082 >> 713 893 3424 >> htpt://www.robertnagle.info >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org >> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org >> >> >> > > -- Robert Nagle 12777 Ashford Point Dr #1417 Houston, Texas 77082 713 893 3424 htpt://www.robertnagle.info
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]