在InDesign中使用XMP进行开发

时间:2012-08-17 20:04:39

标签: adobe adobe-indesign xmp

我正在尝试与Adobe InDesign,HP SmartStream和XMP元数据格式集成。下面我有一个我正在处理IDML metadata.xml文件的xml片段。 XML中的实例和文档ID是随机生成的,还是特定类型的哈希,还是完全不同的东西?我需要生成这样的文件。此外,有没有人知道这个元文件的更好的信息来源?我一直在挖掘Adobes文档,但每个文档似乎都引导我到另一个文档。

<xmpMM:DerivedFrom rdf:parseType="Resource">
    <stRef:instanceID>xmp.iid:679F6CA9302668118C14A18AA97898A6</stRef:instanceID>
    <stRef:documentID>xmp.did:F7416EEA182068118083BC84E35D00D0</stRef:documentID>
    <stRef:originalDocumentID>xmp.did:F7416EEA182068118083BC84E35D00D0</stRef:originalDocumentID>
    <stRef:renditionClass>default</stRef:renditionClass>
</xmpMM:DerivedFrom>
<xmpMM:Manifest>
    <rdf:Bag>
        <rdf:li rdf:parseType="Resource">
            <stMfs:linkForm>ReferenceStream</stMfs:linkForm>
            <stMfs:reference rdf:parseType="Resource">
                <stRef:instanceID>uuid:90f0c8a7-2814-ed43-8557-672122f6924d</stRef:instanceID>
                <stRef:documentID>uuid:f99b8252-e392-45bd-a8f3-c845a8f14e15</stRef:documentID>
                <stRef:lastURL>file:///Path/To/PDF.pdf</stRef:lastURL>
            </stMfs:reference>
            <xmpMM:placedXResolution>72.00</xmpMM:placedXResolution>
            <xmpMM:placedYResolution>72.00</xmpMM:placedYResolution>
            <xmpMM:placedResolutionUnit>Inches</xmpMM:placedResolutionUnit>
        </rdf:li>
        .
        .
        .
        <rdf:li rdf:parseType="Resource">
             <stMfs:linkForm>ReferenceStream</stMfs:linkForm>
             <stMfs:reference rdf:parseType="Resource">
                 <stRef:instanceID>uuid:5245EF7C528E11DA951BB478EA16A7D6</stRef:instanceID>
                 <stRef:documentID>uuid:5245EF7B528E11DA951BB478EA16A7D6</stRef:documentID>
                 <stRef:lastURL>file:///Path/To/EPS.eps</stRef:lastURL>
             </stMfs:reference>
             <xmpMM:placedXResolution>72.00</xmpMM:placedXResolution>
             <xmpMM:placedYResolution>72.00</xmpMM:placedYResolution>
             <xmpMM:placedResolutionUnit>Inches</xmpMM:placedResolutionUnit>
        </rdf:li>
        <rdf:li rdf:parseType="Resource">
             <stMfs:linkForm>DirectStream</stMfs:linkForm>
             <stMfs:reference rdf:parseType="Resource">
                <stRef:instanceID>xmp.iid:60B74D5C85A5E0118B24913025BE159A</stRef:instanceID>
                <stRef:documentID>adobe:docid:photoshop:14ee6e6c-eb90-11dd-a5fb-e51dc86f9044</stRef:documentID>
                <stRef:originalDocumentID>adobe:docid:photoshop:14ee6e6c-eb90-11dd-a5fb-e51dc86f9044</stRef:originalDocumentID>
                <stRef:lastURL>file:///Applications/Adobe%20InDesign%20CS6/Plug-Ins/SmartStream/Designer/Resources/SmartStreamDefault.tif</stRef:lastURL>
             </stMfs:reference>
             <xmpMM:placedXResolution>300.00</xmpMM:placedXResolution>
             <xmpMM:placedYResolution>300.00</xmpMM:placedYResolution>
             <xmpMM:placedResolutionUnit>Inches</xmpMM:placedResolutionUnit>
        </rdf:li>
    </rdf:Bag>
</xmpMM:Manifest>

1 个答案:

答案 0 :(得分:1)

在InDesign中选择一张图片并运行脚本

var c = app.documents[0].selection[0].graphics;
var myfilePath = c[0].itemLink.filePath;
var k = c[0].itemLink.linkXmp.properties;

alert(k.toSource().replace( new RegExp(",",'g'),"\r" ))

var myFile = File(myfilePath);
    xmpFile = new XMPFile(myFile.fsName, XMPConst.UNKNOWN, XMPConst.OPEN_FOR_UPDATE);
    xmp = xmpFile.getXMP();
    var myXmp = xmp.serialize();

    alert (myXmp.toSource())