You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

metadata.xml 9.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!--
  3. Licensed to the Apache Software Foundation (ASF) under one or more
  4. contributor license agreements. See the NOTICE file distributed with
  5. this work for additional information regarding copyright ownership.
  6. The ASF licenses this file to You under the Apache License, Version 2.0
  7. (the "License"); you may not use this file except in compliance with
  8. the License. You may obtain a copy of the License at
  9. http://www.apache.org/licenses/LICENSE-2.0
  10. Unless required by applicable law or agreed to in writing, software
  11. distributed under the License is distributed on an "AS IS" BASIS,
  12. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. See the License for the specific language governing permissions and
  14. limitations under the License.
  15. -->
  16. <!-- $Id$ -->
  17. <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "document-v20.dtd">
  18. <document>
  19. <header>
  20. <title>Apache™ FOP: Metadata</title>
  21. </header>
  22. <body>
  23. <section id="overview">
  24. <title>Overview</title>
  25. <p>
  26. Document metadata is an important tool for categorizing and finding documents.
  27. Various formats support different kinds of metadata representation and to
  28. different levels. One of the more popular and flexible means of representing
  29. document or object metadata is
  30. <a href="http://www.adobe.com/products/xmp/">XMP (eXtensible Metadata Platform, specified by Adobe)</a>.
  31. PDF 1.4 introduced the use of XMP. The XMP specification lists recommendation for
  32. embedding XMP metdata in other document and image formats. Given its flexibility it makes
  33. sense to make use this approach in the XSL-FO context. Unfortunately, unlike SVG which
  34. also refers to XMP, XSL-FO doesn't recommend a preferred way of specifying document and
  35. object metadata. Therefore, there's no portable way to represent metadata in XSL-FO
  36. documents. Each implementation does it differently.
  37. </p>
  38. </section>
  39. <section id="xmp-in-fo">
  40. <title>Embedding XMP in an XSL-FO document</title>
  41. <p>
  42. As noted above, there's no officially recommended way to embed metadata in XSL-FO.
  43. Apache™ FOP supports embedding XMP in XSL-FO. Currently, only support for document-level
  44. metadata is implemented. Object-level metadata will be implemented when there's
  45. interest.
  46. </p>
  47. <p>
  48. Document-level metadata can be specified in the <code>fo:declarations</code> element.
  49. XMP specification recommends to use <code>x:xmpmeta</code>, <code>rdf:RDF</code>, and
  50. <code>rdf:Description</code> elements as shown in example below. Both
  51. <code>x:xmpmeta</code> and <code>rdf:RDF</code> elements are recognized as the top-level
  52. element introducing an XMP fragment (as per the XMP specification).
  53. </p>
  54. <section id="xmp-example">
  55. <title>Example</title>
  56. <source><![CDATA[[..]
  57. </fo:layout-master-set>
  58. <fo:declarations>
  59. <x:xmpmeta xmlns:x="adobe:ns:meta/">
  60. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
  61. <rdf:Description rdf:about=""
  62. xmlns:dc="http://purl.org/dc/elements/1.1/">
  63. <!-- Dublin Core properties go here -->
  64. <dc:title>Document title</dc:title>
  65. <dc:creator>Document author</dc:creator>
  66. <dc:description>Document subject</dc:description>
  67. </rdf:Description>
  68. <rdf:Description rdf:about=""
  69. xmlns:xmp="http://ns.adobe.com/xap/1.0/">
  70. <!-- XMP properties go here -->
  71. <xmp:CreatorTool>Tool used to make the PDF</xmp:CreatorTool>
  72. </rdf:Description>
  73. </rdf:RDF>
  74. </x:xmpmeta>
  75. </fo:declarations>
  76. <fo:page-sequence ...
  77. [..]]]></source>
  78. <note>
  79. <code>fo:declarations</code> <strong>must</strong> be declared after
  80. <code>fo:layout-master-set</code> and before the first <code>page-sequence</code>.
  81. </note>
  82. </section>
  83. </section>
  84. <section id="xmp-impl-in-fop">
  85. <title>Implementation in Apache FOP</title>
  86. <p>
  87. Currently, XMP support is only available for PDF output.
  88. </p>
  89. <p>
  90. Originally, you could set some metadata information through FOP's FOUserAgent by
  91. using its set*() methods (like setTitle(String) or setAuthor(String). These values are
  92. directly used to set value in the PDF Info object. Since PDF 1.4, adding metadata as an
  93. XMP document to a PDF is possible. That means that there are now two mechanisms in PDF
  94. that hold metadata.
  95. </p>
  96. <p>
  97. Apache FOP now synchronizes the Info and the Metadata object in PDF, i.e. when you
  98. set the title and the author through the FOUserAgent, the two values will end up in
  99. the (old) Info object and in the new Metadata object as XMP content. If instead of
  100. FOUserAgent, you embed XMP metadata in the XSL-FO document (as shown above), the
  101. XMP metadata will be used as-is in the PDF Metadata object and some values from the
  102. XMP metadata will be copied to the Info object to maintain backwards-compatibility
  103. for PDF readers that don't support XMP metadata.
  104. </p>
  105. <p>
  106. The mapping between the Info and the Metadata object used by Apache FOP comes from
  107. the <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=38920">PDF/A-1 specification</a>.
  108. For convenience, here's the mapping table:
  109. </p>
  110. <table>
  111. <tr>
  112. <th colspan="2">Document information dictionary</th>
  113. <th colspan="3">XMP</th>
  114. </tr>
  115. <tr>
  116. <th>Entry</th>
  117. <th>PDF type</th>
  118. <th>Property</th>
  119. <th>XMP type</th>
  120. <th>Category</th>
  121. </tr>
  122. <tr>
  123. <td>Title</td>
  124. <td>text string</td>
  125. <td>dc:title</td>
  126. <td>Text</td>
  127. <td>External</td>
  128. </tr>
  129. <tr>
  130. <td>Author</td>
  131. <td>text string</td>
  132. <td>dc:creator</td>
  133. <td>seq Text</td>
  134. <td>External</td>
  135. </tr>
  136. <tr>
  137. <td>Subject</td>
  138. <td>text string</td>
  139. <td>dc:description["x-default"]</td>
  140. <td>Text</td>
  141. <td>External</td>
  142. </tr>
  143. <tr>
  144. <td>Keywords</td>
  145. <td>text string</td>
  146. <td>pdf:Keywords</td>
  147. <td>Text</td>
  148. <td>External</td>
  149. </tr>
  150. <tr>
  151. <td>Creator</td>
  152. <td>text string</td>
  153. <td>xmp:CreatorTool</td>
  154. <td>Text</td>
  155. <td>External</td>
  156. </tr>
  157. <tr>
  158. <td>Producer</td>
  159. <td>text string</td>
  160. <td>pdf:Producer</td>
  161. <td>Text</td>
  162. <td>Internal</td>
  163. </tr>
  164. <tr>
  165. <td>CreationDate</td>
  166. <td>date</td>
  167. <td>xmp:CreationDate</td>
  168. <td>Date</td>
  169. <td>Internal</td>
  170. </tr>
  171. <tr>
  172. <td>ModDate</td>
  173. <td>date</td>
  174. <td>xmp:ModifyDate</td>
  175. <td>Date</td>
  176. <td>Internal</td>
  177. </tr>
  178. </table>
  179. <note>
  180. "Internal" in the Category column means that the user should not set this value.
  181. It is set by the application.
  182. </note>
  183. <note>
  184. The "Subject" used to be mapped to <code>dc:subject</code> in the initial publication of
  185. PDF/A-1 (ISO 19005-1). In the
  186. <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=45613">Technical Corrigendum 1</a>
  187. this was changed to map to <code>dc:description["x-default"]</code>.
  188. </note>
  189. <section id="namespaces">
  190. <title>Namespaces</title>
  191. <p>
  192. Metadata is made of property sets where each property set uses a different namespace URI.
  193. </p>
  194. <p>
  195. The following is a listing of namespaces that Apache FOP recognizes and acts upon,
  196. mostly to synchronize the XMP metadata with the PDF Info dictionary:
  197. </p>
  198. <table>
  199. <tr>
  200. <th>Set/Schema</th>
  201. <th>Namespace Prefix</th>
  202. <th>Namespace URI</th>
  203. </tr>
  204. <tr>
  205. <td>Dublin Core</td>
  206. <td>dc</td>
  207. <td>http://purl.org/dc/elements/1.1/</td>
  208. </tr>
  209. <tr>
  210. <td>XMP Basic</td>
  211. <td>xmp</td>
  212. <td>http://ns.adobe.com/xap/1.0/</td>
  213. </tr>
  214. <tr>
  215. <td>Adobe PDF Schema</td>
  216. <td>pdf</td>
  217. <td>http://ns.adobe.com/pdf/1.3/</td>
  218. </tr>
  219. </table>
  220. <p>
  221. Please refer to the <a href="http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf">XMP Specification</a>
  222. for information on other metadata namespaces.
  223. </p>
  224. <p>
  225. Property sets (Namespaces) not listed here are simply passed through to the final
  226. document (if supported). That is useful if you want to specify a custom metadata
  227. schema.
  228. </p>
  229. </section>
  230. </section>
  231. <section id="links">
  232. <title>Links</title>
  233. <ul>
  234. <li><a href="http://www.adobe.com/products/xmp/">Adobe's Extensible Metadata Platform (XMP) website</a></li>
  235. <li><a href="http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf">Adobe XMP Specification</a></li>
  236. <li><a href="http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf">Adobe XMP Specification</a></li>
  237. <li><a href="http://dublincore.org/">http://dublincore.org/</a></li>
  238. </ul>
  239. </section>
  240. </body>
  241. </document>