首页 > 解决方案 > 从另一个 RML 文件中引用 RML 部分

问题描述

我想从另一个文件中引用 RML 部分来创建分隔符。

我将以下静态模板部分存储在文件中(foo.rml / foo.xml)。

<template title="foo" author="geof" allowSplitting="20">
    <pageTemplate id="main">
        <frame id="first" x1="2cm" y1="3cm" width="17cm" height="23cm"/>
    </pageTemplate>
</template>

我想在 RML 文档文件中包含或引用

<document filename="foo.pdf">
    <!-- Here I want to reference/include the template stored in another file (foo.rml/foo.xml)-->        
    <!-- Something like import or include or paste. -->

    </stylesheet><!-- Stylesheet tags here --></stylesheet>
    <story><!-- Story tags and content here --></story>
</document>

有没有办法做到这一点?我正在使用 reportlab 库并使用 rml2pdf 将 rml 文档转换为 pdf 文档。

标签: xmlreportlabrml

解决方案


推荐阅读