Hi John,
The block-container with the zero-length fo:leader is generated by the
<?dbfo-need height="0.00in" ?> processing instruction. I would suggest you
just remove that. The dbfo-need mechanism does not work in FOP, and a
zero-height value should have no effect anyway. The page break should come
automatically because the image is too big to fit in the space remaining on
the first page and will be forced to the next page. Or from the
break-before attribute you add.
Regarding the attributes, I'm not sure which customization layer I provided.
8^)
One approach might be to add a template like this (untested):
<xsl:template match="mediaobject[ancestor::[EMAIL PROTECTED] =
'external-doc']]">
<fo:block font-size="0" line-height="0" break-before="page"
break-after="page" start-indent="0" end-indent="0">
<xsl:apply-imports/>
</fo:block>
</xsl:template>
This will match only on a mediaobject contained in your special appendix.
It outputs a block wrapper with the necessary values, and then generates the
normal mediaobject output in it by using xsl:apply-imports.
Bob Stayton
Sagehill Enterprises
[EMAIL PROTECTED]
----- Original Message -----
From: "John Brown" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Thursday, April 17, 2008 11:41 PM
Subject: [docbook-apps] Re: Including external documents
Bob Stayton <bobs <at> sagehill.net> writes:
Well, not quite what I had in mind. There could be one appendix element
with title and mediaobject, and it has the role attribute to select the
custom page-master.
I created a customisation layer as you described and it almost works.
My test input file looks like this:
<book xmlns="http://docbook.org/ns/docbook" version="5.0">
<title></title>
<appendix role="external-doc">
<title></title>
<!-- I want "Appendix A" on a page by itself, followed by the
external document, so I force page break -->
<?dbfo-need height="0.00in" ?>
<mediaobject>
<imageobject>
<imagedata fileref="doc1-page1.pdf" align="center" valign="middle"
width="8.5in" depth="11in" contentwidth="8.5in" contentdepth="11in"
scale="100%"/>
</imageobject>
</mediaobject>
</appendix>
</book>
The relevant FO looks like this:
<fo:flow flow-name="xsl-region-body" start-indent="4pc" end-indent="0pt">
<fo:block id="id2489062">
<fo:block>
<fo:block>
<fo:block margin-left="0pt" font-size="24.8832pt"
font-weight="bold" font-family="sans-serif,Symbol,ZapfDingbats">
<fo:block keep-with-next.within-column="always"
space-before.optimum="10pt" space-before.minimum="10pt * 0.8"
space-before.maximum="10pt * 1.2" hyphenate="false" text-align="left"
start-indent="0pt" hyphenation-character="-"
hyphenation-push-character-count="2"
hyphenation-remain-character-count="2">Appendix A. </fo:block>
</fo:block>
</fo:block>
</fo:block>
</fo:block>
<fo:block space-after="0pt" space-before="0em">
<fo:block-container width="100%" height="0.00in">
<fo:block>
<-- ****************** 1 ********************* -->
<!-- ***** need to eliminate this leader ***** -->
<fo:leader leader-length="0pt"/>
<-- ****************************************** -->
</fo:block>
</fo:block-container>
</fo:block>
<fo:block space-before.precedence="force" space-before="-0.00in"
space-after="0pt" space-after.precedence="force"/>
<-- ****************** 2 ********************* -->
<!-- ***** need some more attributes ***** -->
<fo:block id="id2489196" text-align="center">
<-- ****************************************** -->
<fo:external-graphic src="url(doc1-page1.pdf)" width="8.5in"
height="11in" content-width="8.5in" content-height="11in"
text-align="center"
display-align="center"/>
</fo:block>
</fo:flow>
To fix my problems (cropping of image), I need the following changes in
the
FO:
1) I need to delete the fo:leader element marked above
2) On the fo:block containing the fo:external-graphic, I need to add the
following attributes:
font-size="0" line-height="0" break-before="page" break-after="page"
start-indent="0" end-indent="0"
Actually, (1) is probably not essential. That is, it generates a warning,
but the PDF looks OK. Without (2), the external-graphic is cropped.
Is it possible to modify the customisation layer that you provided so that
it will produce the required FO?
---------------------------------------------------------------------
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]