|
|
@ -153,7 +153,11 @@ TQString Document::getInfo( const TQString & type ) const
|
|
|
|
if ( data->locked )
|
|
|
|
if ( data->locked )
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if defined(HAVE_POPPLER_060)
|
|
|
|
|
|
|
|
info = data->doc.getDocInfo();
|
|
|
|
|
|
|
|
# else
|
|
|
|
data->doc.getDocInfo( &info );
|
|
|
|
data->doc.getDocInfo( &info );
|
|
|
|
|
|
|
|
# endif
|
|
|
|
if ( !info.isDict() )
|
|
|
|
if ( !info.isDict() )
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
|
|
|
@ -165,7 +169,13 @@ TQString Document::getInfo( const TQString & type ) const
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
Dict *infoDict = info.getDict();
|
|
|
|
Dict *infoDict = info.getDict();
|
|
|
|
|
|
|
|
|
|
|
|
if ( infoDict->lookup( (char*)type.latin1(), &obj )->isString() )
|
|
|
|
if (
|
|
|
|
|
|
|
|
# if defined(HAVE_POPPLER_060)
|
|
|
|
|
|
|
|
infoDict->lookup( (char*)type.latin1() ).isString()
|
|
|
|
|
|
|
|
# else
|
|
|
|
|
|
|
|
infoDict->lookup( (char*)type.latin1(), &obj )->isString()
|
|
|
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
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 )
|
|
|
@ -192,12 +202,16 @@ TQString Document::getInfo( const TQString & type ) const
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result += unicodeToTQString( &u, 1 );
|
|
|
|
result += unicodeToTQString( &u, 1 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# if !defined(HAVE_POPPLER_060)
|
|
|
|
obj.free();
|
|
|
|
obj.free();
|
|
|
|
info.free();
|
|
|
|
info.free();
|
|
|
|
|
|
|
|
# endif
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# if !defined(HAVE_POPPLER_060)
|
|
|
|
obj.free();
|
|
|
|
obj.free();
|
|
|
|
info.free();
|
|
|
|
info.free();
|
|
|
|
|
|
|
|
# endif
|
|
|
|
return NULL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -209,9 +223,15 @@ TQDateTime Document::getDate( const TQString & type ) const
|
|
|
|
return TQDateTime();
|
|
|
|
return TQDateTime();
|
|
|
|
|
|
|
|
|
|
|
|
Object info;
|
|
|
|
Object info;
|
|
|
|
|
|
|
|
# if defined(HAVE_POPPLER_060)
|
|
|
|
|
|
|
|
info = data->doc.getDocInfo();
|
|
|
|
|
|
|
|
# else
|
|
|
|
data->doc.getDocInfo( &info );
|
|
|
|
data->doc.getDocInfo( &info );
|
|
|
|
|
|
|
|
# endif
|
|
|
|
if ( !info.isDict() ) {
|
|
|
|
if ( !info.isDict() ) {
|
|
|
|
|
|
|
|
# if !defined(HAVE_POPPLER_060)
|
|
|
|
info.free();
|
|
|
|
info.free();
|
|
|
|
|
|
|
|
# endif
|
|
|
|
return TQDateTime();
|
|
|
|
return TQDateTime();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -221,7 +241,13 @@ TQDateTime Document::getDate( const TQString & type ) const
|
|
|
|
Dict *infoDict = info.getDict();
|
|
|
|
Dict *infoDict = info.getDict();
|
|
|
|
TQString result;
|
|
|
|
TQString result;
|
|
|
|
|
|
|
|
|
|
|
|
if ( infoDict->lookup( (char*)type.latin1(), &obj )->isString() )
|
|
|
|
if (
|
|
|
|
|
|
|
|
# if defined(HAVE_POPPLER_060)
|
|
|
|
|
|
|
|
infoDict->lookup( (char*)type.latin1() ).isString()
|
|
|
|
|
|
|
|
# else
|
|
|
|
|
|
|
|
infoDict->lookup( (char*)type.latin1(), &obj )->isString()
|
|
|
|
|
|
|
|
# endif
|
|
|
|
|
|
|
|
)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQString s = UnicodeParsedString(obj.getString());
|
|
|
|
TQString s = UnicodeParsedString(obj.getString());
|
|
|
|
// TODO do something with the timezone information
|
|
|
|
// TODO do something with the timezone information
|
|
|
@ -230,14 +256,18 @@ TQDateTime Document::getDate( const TQString & type ) const
|
|
|
|
TQDate d( year, mon, day ); //CHECK: it was mon-1, Jan->0 (??)
|
|
|
|
TQDate d( year, mon, day ); //CHECK: it was mon-1, Jan->0 (??)
|
|
|
|
TQTime t( hour, min, sec );
|
|
|
|
TQTime t( hour, min, sec );
|
|
|
|
if ( d.isValid() && t.isValid() ) {
|
|
|
|
if ( d.isValid() && t.isValid() ) {
|
|
|
|
|
|
|
|
# if !defined(HAVE_POPPLER_060)
|
|
|
|
obj.free();
|
|
|
|
obj.free();
|
|
|
|
info.free();
|
|
|
|
info.free();
|
|
|
|
|
|
|
|
# endif
|
|
|
|
return TQDateTime( d, t );
|
|
|
|
return TQDateTime( d, t );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# if !defined(HAVE_POPPLER_060)
|
|
|
|
obj.free();
|
|
|
|
obj.free();
|
|
|
|
info.free();
|
|
|
|
info.free();
|
|
|
|
|
|
|
|
# endif
|
|
|
|
return TQDateTime();
|
|
|
|
return TQDateTime();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -317,7 +347,7 @@ bool Document::print(const TQString &fileName, TQValueList<int> pageList, double
|
|
|
|
|
|
|
|
|
|
|
|
bool Document::print(const TQString &file, TQValueList<int> pageList, double hDPI, double vDPI, int rotate, int paperWidth, int paperHeight)
|
|
|
|
bool Document::print(const TQString &file, TQValueList<int> pageList, double hDPI, double vDPI, int rotate, int paperWidth, int paperHeight)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if defined(HAVE_POPPLER_030)
|
|
|
|
#if defined(HAVE_POPPLER_060) || defined(HAVE_POPPLER_030)
|
|
|
|
std::vector<int> pages;
|
|
|
|
std::vector<int> pages;
|
|
|
|
TQValueList<int>::iterator it;
|
|
|
|
TQValueList<int>::iterator it;
|
|
|
|
for (it = pageList.begin(); it != pageList.end(); ++it ) {
|
|
|
|
for (it = pageList.begin(); it != pageList.end(); ++it ) {
|
|
|
|