本文整理汇总了C++中poppler::Document::hasEmbeddedFiles方法的典型用法代码示例。如果您正苦于以下问题:C++ Document::hasEmbeddedFiles方法的具体用法?C++ Document::hasEmbeddedFiles怎么用?C++ Document::hasEmbeddedFiles使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类poppler::Document
的用法示例。
在下文中一共展示了Document::hasEmbeddedFiles方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QVERIFY
void TestAttachments::checkAttach2()
{
Poppler::Document *doc;
doc = Poppler::Document::load("../../../test/unittestcases/A6EmbeddedFiles.pdf");
QVERIFY( doc );
QVERIFY( doc->hasEmbeddedFiles() );
QList<Poppler::EmbeddedFile*> fileList;
fileList = doc->embeddedFiles();
QCOMPARE( fileList.size(), 3 );
Poppler::EmbeddedFile *embfile1 = fileList.at(0);
QCOMPARE( embfile1->name(), QString("Acro7 thoughts") );
QCOMPARE( embfile1->description(), QString("Acro7 Thoughts") );
QCOMPARE( embfile1->createDate(), QDateTime( QDate( 2003, 8, 4 ), QTime( 13, 54, 54), Qt::UTC ) );
QCOMPARE( embfile1->modDate(), QDateTime( QDate( 2003, 8, 4 ), QTime( 14, 15, 27), Qt::UTC ) );
Poppler::EmbeddedFile *embfile2 = fileList.at(1);
QCOMPARE( embfile2->name(), QString("acro transitions 1.xls") );
QCOMPARE( embfile2->description(), QString("AcroTransitions") );
QCOMPARE( embfile2->createDate(), QDateTime( QDate( 2003, 7, 18 ), QTime( 21, 7, 16), Qt::UTC ) );
QCOMPARE( embfile2->modDate(), QDateTime( QDate( 2003, 7, 22 ), QTime( 13, 4, 40), Qt::UTC ) );
Poppler::EmbeddedFile *embfile3 = fileList.at(2);
QCOMPARE( embfile3->name(), QString("apago_pdfe_wide.gif") );
QCOMPARE( embfile3->description(), QString("PDFE Animation") );
QCOMPARE( embfile3->createDate(), QDateTime( QDate( 2003, 1, 31 ), QTime( 15, 54, 29), Qt::UTC ) );
QCOMPARE( embfile3->modDate(), QDateTime( QDate( 2003, 1, 31 ), QTime( 15, 52, 58), Qt::UTC ) );
delete doc;
}
示例2: checkNoAttachments
void TestAttachments::checkNoAttachments()
{
Poppler::Document *doc;
doc = Poppler::Document::load("../../../test/unittestcases/truetype.pdf");
QVERIFY( doc );
QCOMPARE( doc->hasEmbeddedFiles(), false );
delete doc;
}
示例3: file
void TestAttachments::checkAttach1()
{
Poppler::Document *doc;
doc = Poppler::Document::load("../../../test/unittestcases/WithAttachments.pdf");
QVERIFY( doc );
QVERIFY( doc->hasEmbeddedFiles() );
QList<Poppler::EmbeddedFile*> fileList = doc->embeddedFiles();
QCOMPARE( fileList.size(), 2 );
Poppler::EmbeddedFile *embfile = fileList.at(0);
QCOMPARE( embfile->name(), QString( "kroller.png" ) );
QCOMPARE( embfile->description(), QString("/home/bradh/coding/svn-vers/KDE/kdeartwork/wallpapers/kroller.png") );
QCOMPARE( embfile->createDate(), QDateTime( QDate(), QTime() ) );
QCOMPARE( embfile->modDate(), QDateTime( QDate(), QTime() ) );
QFile file( "../../../test/unittestcases/kroller.png" );
QVERIFY( file.open( QIODevice::ReadOnly ) );
QByteArray krollerData = file.readAll();
QByteArray embdata = embfile->data();
QCOMPARE( krollerData, embdata );
Poppler::EmbeddedFile *embfile2 = fileList.at(1);
QCOMPARE( embfile2->name(), QString("gnome-64.gif") );
QCOMPARE( embfile2->description(), QString("/usr/share/gnome-about/gnome-64.gif") );
QCOMPARE( embfile2->modDate(), QDateTime( QDate(), QTime() ) );
QCOMPARE( embfile2->createDate(), QDateTime( QDate(), QTime() ) );
QFile file2( "../../../test/unittestcases/gnome-64.gif" );
QVERIFY( file2.open( QIODevice::ReadOnly ) );
QByteArray g64Data = file2.readAll();
QByteArray emb2data = embfile2->data();
QCOMPARE( g64Data, emb2data );
delete doc;
}