Commit c158de90 authored by Kristian Høgsberg's avatar Kristian Høgsberg
Browse files

2005-03-21 Kristian Høgsberg <krh@redhat.com>

        From Albert Astals Cid <tsdgeos@yahoo.es>:

        * poppler/Catalog.cc, poppler/Catalog.h: Parse PageMode setting
        from the Catalog dict and expose it through getPageMode() method.
parent 9887679c
2005-03-21 Kristian Høgsberg <krh@redhat.com>
* glib/poppler-document.cc:
From Albert Astals Cid <tsdgeos@yahoo.es>:
* glib/poppler-document.h: Expose the documenttitle as a GObject
* poppler/Catalog.cc, poppler/Catalog.h: Parse PageMode setting
from the Catalog dict and expose it through getPageMode() method.
2005-03-21 Kristian Høgsberg <krh@redhat.com>
* glib/poppler-document.cc:
* glib/poppler-document.h: Expose the document title as a GObject
property.
* glib/poppler-page.cc: Expose the page label as a GObject
......
......@@ -101,6 +101,22 @@ Catalog::Catalog(XRef *xrefA) {
pageLabelInfo = new PageLabelInfo(&obj, numPages);
obj.free();
// read page mode
pageMode = pageModeNone;
if (catDict.dictLookup("PageMode", &obj)->isName()) {
if (obj.isName("UseNone"))
pageMode = pageModeNone;
else if (obj.isName("UseOutlines"))
pageMode = pageModeOutlines;
else if (obj.isName("UseThumbs"))
pageMode = pageModeThumbs;
else if (obj.isName("FullScreen"))
pageMode = pageModeFullScreen;
else if (obj.isName("UseOC"))
pageMode = pageModeOC;
}
obj.free();
// read base URI
if (catDict.dictLookup("URI", &obj)->isDict()) {
if (obj.dictLookup("Base", &obj2)->isString()) {
......
......@@ -70,6 +70,17 @@ public:
Object *getOutline() { return &outline; }
enum PageMode {
pageModeNone,
pageModeOutlines,
pageModeThumbs,
pageModeFullScreen,
pageModeOC
};
// Returns the page mode.
PageMode getPageMode() { return pageMode; }
private:
XRef *xref; // the xref table for this PDF file
......@@ -85,6 +96,7 @@ private:
Object outline; // outline dictionary
GBool ok; // true if catalog is valid
PageLabelInfo *pageLabelInfo; // info about page labels
PageMode pageMode; // page mode
int readPageTree(Dict *pages, PageAttrs *attrs, int start);
Object *findDestInTree(Object *tree, GooString *name, Object *obj);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment