#9 Get title from Title style


odt2daisy currently uses the Title from ODF's document properties to fill in the Title field in the export dialogue. If the title in the document properties is empty, the Title field is also empty - this is what happens with most documents. Ideally, odt2daisy should check the (first) Title style in the document if the title in document properties is empty.
If the user fills in a title in the export dialogue, odt2daisy could save this value as metadata in the ODF file.
(I hope I can write a patch for this.)


  • Christophe Strobbe

    The following version of the method getODTTitleMeta() in com.versusoft.packages.ooo.odt2daisy.Odt2Daisy uses the Title style of Title in the Document Properties is empty:

    * Gets the document title from the document properties (dc:title).
    * If the title property is empty, the first Title style is used as a fallback.
    * @return Document title, as String
    * @throws MalformedURLException
    * @throws IOException
    private String getODTTitleMeta() throws MalformedURLException, IOException {
    String title = "";
    title = XPathUtils.evaluateString(tmpFlatFile.toURL().openStream(),
    if (title.length() == 0) {
    title = XPathUtils.evaluateString(tmpFlatFile.toURL().openStream(),
    logger.fine("DocumentTitle=\'" + title + "\'");
    return title;

    What I don't have yet is a way to get the value from the Title field in the odt2daisy dialog into the document metadata.

  • Christophe Strobbe

    • status: open --> closed

Log in to post a comment.