在 Adobe 技术合作伙伴的帮助下,我找到了问题的答案。
我有一种工作方式来动态生成带有图片的 IDML。
IDML 是一个包含其他文件的 zip 文件。这是一个工作 IDML 文件(结构)的简单示例。
.idml(压缩)文件中的第一个文件名为:mimetype
它必须包含:application/vnd.adobe.indesign-idml-package
.idml(压缩)文件中的下一个文件名为:designmap.xml
下面是一个有效的 designmap.xml 文件示例:
<?xml version="1.0" encoding="utf-8"?><?aid style="50" type="document" readerVersion="6.0" featureSet="257"?>
<Document xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="6.0" Self="d">
<idPkg:Spread src="Spreads/Spread_2176.xml"/>
<idPkg:Story src="Stories/Story_2214.xml"/>
<idPkg:Story src="Stories/Story_2176.xml"/>
<idPkg:Story src="Stories/Story_asset_230.xml"/>
<idPkg:Story src="Stories/Story_asset_231.xml"/>
</Document>
接下来在本例中,.idml(压缩)是两个文件夹:Spreads Stories
在此示例中,Spreads 文件夹包含一个 Spread_2227.xml 文档。以下是 Spread_2227.xml 的内容:
<?xml version="1.0" encoding="utf-8"?>
<idPkg:Spread xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="6.0">
<Spread Self="spread_2214" PageCount="1" BindingLocation="0" >
<Page Self="Page_1" GeometricBounds="0 0 792 559" Name="headline for this story" >
<TextFrame Self="textframe_2214" ParentStory="story_2214" ContentType="TextType" >
<Properties>
<PathGeometry>
<GeometryPathType PathOpen="false">
<PathPointArray>
<PathPoint Anchor="41 41" LeftDirection="41 41" RightDirection="41 41"/>
<PathPoint Anchor="41 191" LeftDirection="41 191" RightDirection="41 191"/>
<PathPoint Anchor="559 191" LeftDirection="559 191" RightDirection="559 191"/>
<PathPoint Anchor="559 41" LeftDirection="559 41" RightDirection="559 41"/>
</PathPointArray>
</GeometryPathType>
</PathGeometry>
</Properties>
</TextFrame>
</Page>
</Spread>
<Spread Self="spread_2176" PageCount="1" BindingLocation="0" >
<Page Self="Page_2" GeometricBounds="0 0 792 559" Name="headline of story 2176" >
<TextFrame Self="textframe_2176" ParentStory="story_2176" ContentType="TextType" >
<Properties>
<PathGeometry>
<GeometryPathType PathOpen="false">
<PathPointArray>
<PathPoint Anchor="41 41" LeftDirection="41 41" RightDirection="41 41"/>
<PathPoint Anchor="41 191" LeftDirection="41 191" RightDirection="41 191"/>
<PathPoint Anchor="559 191" LeftDirection="559 191" RightDirection="559 191"/>
<PathPoint Anchor="559 41" LeftDirection="559 41" RightDirection="559 41"/>
</PathPointArray>
</GeometryPathType>
</PathGeometry>
</Properties>
</TextFrame>
</Page>
</Spread>
</idPkg:Spread>
在此示例中,Stories 文件夹包含 xml 文档。Story_2176.xml, Story_2214.xml,Story_asset_231.xml, Story_asset_230.xml 这里是 Stories 文件夹的内容: Headline: 故事 2176 的标题, rank: null, word count: 5, photos: 0
body content of this story.</Content>
</Story>
</idPkg:Story>
<?xml version="1.0" encoding="utf-8"?>
<idPkg:Story xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="6.0">
<Story Self="story_2176">
<Content>Headline: headline of story 2176, rank: null, word count: 5, photos: 0
body content of this story.</Content>
</Story>
</idPkg:Story>
<?xml version="1.0" encoding="utf-8"?>
<idPkg:Story xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="6.0">
<Story Self="cutline_231">
<Content>002</Content>
</Story>
</idPkg:Story>
<?xml version="1.0" encoding="utf-8"?>
<idPkg:Story xmlns:idPkg="http://ns.adobe.com/AdobeInDesign/idml/1.0/packaging" DOMVersion="6.0">
<Story Self="cutline_230">
<Content>013</Content>
</Story>
</idPkg:Story>