Metadata I write in ODT and export to PDF isn't recognized in e-readers

I normally have my own basic contact information in the User Data for a document (Tools > Options > LibreOffice > User Data), and that’s good enough for most of whatever basic work I do on my own. However, I’m also editing articles for a student-run publication at my university, and I’d like to instead populate the metadata with information about the article’s author, the date of publication, the name of the publisher, the creative commons license, etc.

I wrote the metadata I want into the document Properties dialog (File > Properties), under the Description and Custom Properties tabs. But when I look at the document in Calibre, or the e-reader on my tablet, the ODT still shows my name under “Author” and the exported PDF shows “Unkown” under author. And in both formats, the date and publisher metadata appear empty.

The only piece of metadata that seems to work right is the Title.

I’m using LibreOffice 4.0.3.3 on Linux Mint DE (the “semi-rolling release” based on Debian Testing).

I wrote the metadata I want into the document Properties dialog (File > Properties), under the Description and Custom Properties tabs. But when I look at the document in Calibre, or the e-reader on my tablet, the ODT still shows my name under “Author”

There is no Author field available under the Custom Properties tab. Since you are exporting to PDF it is significantly easier to adjust metadata via a third-party tool such as pdftk that can be scripted e.g.,

#!/bin/bash
echo "Extracting and cleaning metadata ...";
pdftk file_to_fix.pdf dump_data output metadata.txt;
sed -i 's/&#0//g' metadata.txt;
sed -i "s/;//g" metdata.txt;
sed -i "s/myname/requiredname/g" metdata.txt;
echo "Updating metdata ...";
pdftk file_to_fix.pdf update_info metadata.txt output file_fixed.pdf;

You’re right, I’d forgotten that I had to create the “author” metadata property-value pair, so I guess it makes sense that it wouldn’t export properly… “Publisher” is a property available by default, though, and that doesn’t work either for some reason.

But I guess pdftk or something like it will take care of all the metadata, if LibreOffice can’t. (Yet?) I’m more concerned about the PDF than the ODT, I guess, so close enough.

Thanks.

The metadata you enter in Custom fields is just what it says: custom. Although LibreOffice supplies a list of property names to use, it is not defined how these should be interpreted other than as property names in LO or by other programs (you can use these Document properties as variables in the document). The properties on the Description tab do have a defined meaning, so the PDF exporter knows how to encode them in a PDF.

As suggested, you can use external tools to add or update metadata to/in the PDF. Custom metadata properties, however, are not exported to the PDF at all. Hence, you can’t replace those later using pdftk or any other tool.

There is no easy solution for your problem, but you could try the following:

  • find or create a tool that extracts metadata from the ODT file and (selectively) adds it to the exported PDF, or
  • request an enhancement that puts custom metadata in XMP in the PDF using an uncontrolled RDF schema, or
  • request an enhancement that selects certain ‘custom’ properties with names that are on an agreed-upon list (so that they are not really custom anymore) and converts those fields into more widely understood fields. For example, a publisher name could go into a field named dc:publisher (DC stands for Dublin Core), which fits nicely with the title field and could be exported to PDF.
  • create an extension that takes care of the translation of special custom properties.

Putting special meaning in certain metadata fields isn’t as trivial as I think it could be; may break the document format specification.

(Edit: small textual correction, ‘other tab’ → ‘Description tab’)

PDF doesn’t use XML to define its metadata and, now that it’s an ISO standard, a change of that magnitude will not take place.

If you format your custom properties correctly, at least Calibre will pick up the correct metadata. Presumably it will also convert to PDF with the correct metadata though I have not tried this.

The series is:

opf.metadata = true (boolean)

opf.authors = text

opf.publisher = text

etc.

The full information can be found at http://manual.calibre-ebook.com/conversion.html#convert-odt-documents