Search in sources :

Example 1 with PdfContext

use of org.ebookdroid.droids.mupdf.codec.PdfContext in project LibreraReader by foobnix.

the class PdfExtract method getBookMetaInformation.

public static EbookMeta getBookMetaInformation(String unZipPath) {
    PdfContext codecContex = new PdfContext();
    CodecDocument openDocument = null;
    try {
        openDocument = codecContex.openDocument(unZipPath, "");
    } catch (RuntimeException e) {
        LOG.e(e);
        return EbookMeta.Empty();
    }
    EbookMeta meta = new EbookMeta(openDocument.getBookTitle(), openDocument.getBookAuthor());
    meta.setPagesCount(openDocument.getPageCount());
    if ("untitled".equals(meta.getTitle())) {
        meta.setTitle("");
    }
    LOG.d("PdfExtract", meta.getAuthor(), meta.getTitle(), unZipPath);
    openDocument.recycle();
    openDocument = null;
    return meta;
}
Also used : PdfContext(org.ebookdroid.droids.mupdf.codec.PdfContext) CodecDocument(org.ebookdroid.core.codec.CodecDocument)

Aggregations

CodecDocument (org.ebookdroid.core.codec.CodecDocument)1 PdfContext (org.ebookdroid.droids.mupdf.codec.PdfContext)1