我正在尝试 OOTB PDF 重写器组件,并且能够为简单的用例生成 PDF,但是它在某些情况下不起作用。
场景1:当页面有数据存储在单个节点时能够生成PDF。场景2:分页引用多个节点时无法生成PDF。
<xsl:template match="jcr:content">
<xsl:if test="@articleTitle">
<fo:block font-size="30pt"
text-align="start" font-family="DinProLight">
<xsl:value-of select="@articleTitle" />
</fo:block>
</xsl:if>
<xsl:if test="@publishDate">
<fo:block font-size="18pt" color="#777777" text-align="start" font-family="georgia;"
font-style="italic" padding-bottom="9px">
<xsl:value-of select="concat(substring(@publishDate,9,2),'-',substring(@publishDate,7,2),substring(@publishDate,0,5))" />
</fo:block>
</xsl:if>
<xsl:if test="@authorPath">
<fo:block font-size="18pt" color="#777777" padding="3px" text-align="start">
<!--Below Code works fine -->
<fo:external-graphic src="url('sling://etc/designs/XXXX/images/logo.jpg')" content-type="content-type:image/jpeg"/>
<!--Below Code Fails -->
<xsl:value-of select="sling://content/XXXX/en/perspectives/tst_artcl/jcr:content@fullName"/>
</fo:block>
</xsl:if>
<xsl:if test="@noOfViews">
<fo:block font-size="11pt" color="#777777" text-align="right" font-family="arial" padding-bottom="9px" border-bottom="1px solid #777777">
<xsl:value-of select="concat(@noOfViews,' Views')" />
</fo:block>
</xsl:if>
<xsl:apply-templates />
</xsl:template>