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;
}
Aggregations