Reputation: 155
I am generating a PDF File using XSL-FO, and I have a scenario where I need to merge a PDF file with the one I'm generating using XSL-FO. Is it possible to achieve this using XSL-FO?
This is what I have tried now in my XSL file
<xsl:template match="body">
<xsl:for-each select="paragraph">
<fo:block space-after="1.4em">
<xsl:apply-templates select="d:htmlparse(., '', true())/node()"/>
</fo:block>
</xsl:for-each>
<fox:external-document xmlns:fox="http://xmlgraphics.apache.org/fop/1.0/extensions" content-type="pdf" src='./tobedssssconv.pdf'/>
</xsl:template>
Upvotes: 0
Views: 1685
Reputation: 3788
First of all, the extension element fox:external-document
is meant to be at the same level of fo:page-sequence
elements, not inside an fo:flow
with other block-level objects (you are probably getting some validation error while processing your file).
<fo:page-sequence>
<!-- .... -->
</fo:page-sequence>
<fox:external-document .... />
<fo:page-sequence>
<!-- .... -->
</fo:page-sequence>
This way, you will have the pages generated for the first fo:page-sequence
, then the pages from the "included" PDF, then the pages for the second fo:page-sequence
.
Otherwise, if you want to insert something between fo:block
elements, you can use fo:external-graphic
(inside an fo:block
or another block-level element).
Either way, you need the PDF Images Plugin to reference PDF files as the source for fo:external-graphic
or fox:external-document
.
Upvotes: 1