|
|
#include "poppler/UnicodeMap.h" | #include "poppler/UnicodeMap.h" |
#include "poppler/Outline.h" | #include "poppler/Outline.h" |
#include "poppler/goo/GooString.h" | #include "poppler/goo/GooString.h" |
|
#include "poppler/UGooString.h" |
#include "poppler/goo/GooList.h" | #include "poppler/goo/GooList.h" |
//#include "poppler/poppler-qt.h" | //#include "poppler/poppler-qt.h" |
| |
|
|
{ | { |
if (annots->getAnnot(i)->getAppearance(&obj1)->isStream()) | if (annots->getAnnot(i)->getAppearance(&obj1)->isStream()) |
{ | { |
obj1.streamGetDict()->lookup("Resources", &obj2); |
obj1.streamGetDict()->lookup((UGooString&) "Resources", &obj2); |
if (obj2.isDict()) | if (obj2.isDict()) |
{ | { |
scanFonts(obj2.getDict(), list, &fonts, fontsLen, fontsSize); | scanFonts(obj2.getDict(), list, &fonts, fontsLen, fontsSize); |
|
|
DocumentViewport viewport; | DocumentViewport viewport; |
GooString * namedDest = QStringToUGString( option ); | GooString * namedDest = QStringToUGString( option ); |
docLock.lock(); | docLock.lock(); |
LinkDest * destination = pdfdoc->findDest( namedDest ); |
LinkDest * destination = pdfdoc->findDest((UGooString*) namedDest ); |
if ( destination ) | if ( destination ) |
{ | { |
fillViewportFromLink( viewport, destination ); | fillViewportFromLink( viewport, destination ); |
|
|
| |
// scan the fonts in this resource dictionary | // scan the fonts in this resource dictionary |
gfxFontDict = NULL; | gfxFontDict = NULL; |
resDict->lookupNF("Font", &obj1); |
resDict->lookupNF((UGooString&) "Font", &obj1); |
if (obj1.isRef()) | if (obj1.isRef()) |
{ | { |
obj1.fetch(pdfdoc->getXRef(), &obj2); | obj1.fetch(pdfdoc->getXRef(), &obj2); |
|
|
| |
// recursively scan any resource dictionaries in objects in this | // recursively scan any resource dictionaries in objects in this |
// resource dictionary | // resource dictionary |
resDict->lookup("XObject", &xObjDict); |
resDict->lookup((UGooString&) "XObject", &xObjDict); |
if (xObjDict.isDict()) | if (xObjDict.isDict()) |
{ | { |
for (i = 0; i < xObjDict.dictGetLength(); ++i) | for (i = 0; i < xObjDict.dictGetLength(); ++i) |
|
|
xObjDict.dictGetVal(i, &xObj); | xObjDict.dictGetVal(i, &xObj); |
if (xObj.isStream()) | if (xObj.isStream()) |
{ | { |
xObj.streamGetDict()->lookup("Resources", &resObj); |
xObj.streamGetDict()->lookup((UGooString&) "Resources", &resObj); |
if (resObj.isDict()) scanFonts(resObj.getDict(), list, fonts, fontsLen, fontsSize); | if (resObj.isDict()) scanFonts(resObj.getDict(), list, fonts, fontsLen, fontsSize); |
resObj.free(); | resObj.free(); |
} | } |
|
|
int i; | int i; |
Dict *infoDict = info.getDict(); | Dict *infoDict = info.getDict(); |
| |
if ( infoDict->lookup( (char*) data.latin1(), &obj )->isString() ) |
if ( infoDict->lookup(UGooString(data.latin1()), &obj )->isString() ) |
{ | { |
s1 = obj.getString(); | s1 = obj.getString(); |
if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getChar(1) & 0xff ) == 0xff ) | if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getChar(1) & 0xff ) == 0xff ) |
|
|
if ( !uMap ) | if ( !uMap ) |
return i18n( "Unknown Date" ); | return i18n( "Unknown Date" ); |
| |
if ( infoDict->lookup( (char*) data.latin1(), &obj )->isString() ) |
if ( infoDict->lookup(UGooString(data.latin1()), &obj )->isString() ) |
{ | { |
s = obj.getString()->getCString(); | s = obj.getString()->getCString(); |
if ( s[0] == 'D' && s[1] == ':' ) | if ( s[0] == 'D' && s[1] == ':' ) |
|
|
// get the destination for the page now, but it's VERY time consuming, | // get the destination for the page now, but it's VERY time consuming, |
// so better storing the reference and provide the viewport as metadata | // so better storing the reference and provide the viewport as metadata |
// on demand | // on demand |
GooString *s = g->getNamedDest(); |
GooString *s = (GooString*) g->getNamedDest(); |
QString aux = QString(s->getCString()); | QString aux = QString(s->getCString()); |
item.setAttribute( "ViewportName", aux ); | item.setAttribute( "ViewportName", aux ); |
} | } |