Hi all,
I'm trying to convert a wordml document into pdf with FOP1.0
I usually use the <fo:basic-link> element to get links working on the
resulting pdf and it works pretty well as long as the link is not included
within the WordML header/footer. In that case I get a Nullpointer Exception
like this:
[FOP message]
21-jul-2011 8:37:29 org.apache.fop.events.LoggingEventListener processEvent
FATAL: Error while rendering page 1. Reason: java.lang.NullPointerException
(Unknown source) org.xml.sax.SAXException
[Java stacktrace error]
java.lang.NullPointerException
at org.apache.pdfbox.pdmodel.PDPageNode.getAllKids(PDPageNode.java:187)
at org.apache.pdfbox.pdmodel.PDPageNode.getKids(PDPageNode.java:164)
at org.apache.pdfbox.pdmodel.PDPageNode.updateCount(PDPageNode.java:83)
at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:906)
at org.apache.pdfbox.pdmodel.PDDocument.save(PDDocument.java:892)
...
Following is the template in the XSL stylesheet I use to transform wordml
links into fo:basic-link:
<xsl:template match="w:hlink">
<xsl:choose>
<xsl:when test="@w:dest">
<fo:basic-link>
<xsl:attribute name="external-destination"><xsl:value-of
select="concat('url("', @w:dest,'")')" /></xsl:attribute>
</fo:basic-link>
</xsl:when>
</xsl:choose>
</xsl:template>
Any clue of what may be going on wrong?
Thanks.