Example usage for com.itextpdf.text.pdf SimpleBookmark exportToXML

List of usage examples for com.itextpdf.text.pdf SimpleBookmark exportToXML

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf SimpleBookmark exportToXML.

Prototype

public static void exportToXML(List<HashMap<String, Object>> list, Writer wrt, String encoding,
        boolean onlyASCII) throws IOException 

Source Link

Document

Exports the bookmarks to XML.

Usage

From source file:com.github.naofum.epubconverter.ReadPdf.java

License:Open Source License

public static String getBookmarks() {
    List<HashMap<String, Object>> list;
    try {/* w ww. j  a va 2s  . c  o m*/
        list = SimpleBookmark.getBookmark(reader);
    } catch (ClassCastException e) {
        return "";
    }
    if (list == null) {
        return "";
    }

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    try {
        SimpleBookmark.exportToXML(list, baos, "UTF-8", false);
    } catch (IOException e) {
        e.printStackTrace();
    }
    return baos.toString();
}