Title: Apache(tm) FOP: Metadata
#Apache™ FOP: Metadata
## Overview { #overview}
Document metadata is an important tool for categorizing and finding documents. Various formats support different kinds of metadata representation and to different levels. One of the more popular and flexible means of representing document or object metadata is [XMP (eXtensible Metadata Platform, specified by Adobe)](http://www.adobe.com/products/xmp/). PDF 1.4 introduced the use of XMP. The XMP specification lists recommendation for embedding XMP metdata in other document and image formats. Given its flexibility it makes sense to make use this approach in the XSL-FO context. Unfortunately, unlike SVG which also refers to XMP, XSL-FO doesn't recommend a preferred way of specifying document and object metadata. Therefore, there's no portable way to represent metadata in XSL-FO documents. Each implementation does it differently.
## Embedding XMP in an XSL-FO document { #xmp-in-fo}
As noted above, there's no officially recommended way to embed metadata in XSL-FO. Apache™ FOP supports embedding XMP in XSL-FO. Currently, only support for document-level metadata is implemented. Object-level metadata will be implemented when there's interest.
Document-level metadata can be specified in the `fo:declarations` element. XMP specification recommends to use `x:xmpmeta`, `rdf:RDF`, and `rdf:Description` elements as shown in example below. Both `x:xmpmeta` and `rdf:RDF` elements are recognized as the top-level element introducing an XMP fragment (as per the XMP specification).
### Example { #xmp-example}
:::xml
[..]
Document title
Document author
Document subject
Tool used to make the PDF
Entry | PDF type | XMP Property | XMP type | XMP Category |
|-------|----------|----------|----------|----------|
| Title | text string | dc:title | Text | External |
| Author | text string | dc:creator | seq Text | External |
| Subject | text string | dc:description["x-default"] | Text | External |
| Keywords | text string | pdf:Keywords | Text | External |
| Creator | text string | xmp:CreatorTool | Text | External |
| Producer | text string | pdf:Producer | Text | Internal |
| CreationDate | date | xmp:CreationDate | Date | Internal |
| ModDate | date | xmp:ModifyDate | Date | Internal |
"Internal" in the Category column means that the user should not set this value. It is set by the application.The "Subject" used to be mapped to `dc:subject` in the initial publication of PDF/A-1 (ISO 19005-1). In the [Technical Corrigendum 1](http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=45613) this was changed to map to `dc:description["x-default"]`.
### Namespaces { #namespaces}
Metadata is made of property sets where each property set uses a different namespace URI.
The following is a listing of namespaces that Apache FOP recognizes and acts upon, mostly to synchronize the XMP metadata with the PDF Info dictionary:
| Set/Schema | Namespace Prefix | Namespace URI |
|------------|------------------|---------------|
| Dublin Core | dc | http://purl.org/dc/elements/1.1/ |
| XMP Basic | xmp | http://ns.adobe.com/xap/1.0/ |
| Adobe PDF Schema | pdf | http://ns.adobe.com/pdf/1.3/ |
Please refer to the [XMP Specification](http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf) for information on other metadata namespaces.
Property sets (Namespaces) not listed here are simply passed through to the final document (if supported). That is useful if you want to specify a custom metadata schema.
## Links { #links}
- [Adobe's Extensible Metadata Platform (XMP) website](http://www.adobe.com/products/xmp/)
- [Adobe XMP Specification](http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf)
- [Adobe XMP Specification](http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf)
- [http://dublincore.org/](http://dublincore.org/)