本文整理汇总了C++中poppler::Document::pdfVersion方法的典型用法代码示例。如果您正苦于以下问题:C++ Document::pdfVersion方法的具体用法?C++ Document::pdfVersion怎么用?C++ Document::pdfVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类poppler::Document
的用法示例。
在下文中一共展示了Document::pdfVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main( int argc, char **argv )
{
QApplication a( argc, argv ); // QApplication required!
QTime t;
t.start();
QDir directory( argv[1] );
foreach ( const QString &fileName, directory.entryList() ) {
if (fileName.endsWith("pdf") ) {
qDebug() << "Doing" << fileName.toLatin1().data() << ":";
Poppler::Document *doc = Poppler::Document::load( directory.canonicalPath()+"/"+fileName );
if (!doc) {
qWarning() << "doc not loaded";
} else if ( doc->isLocked() ) {
if (! doc->unlock( "", "password" ) ) {
qWarning() << "couldn't unlock document";
delete doc;
}
} else {
doc->pdfVersion();
doc->info("Title");
doc->info("Subject");
doc->info("Author");
doc->info("Keywords");
doc->info("Creator");
doc->info("Producer");
doc->date("CreationDate").toString();
doc->date("ModDate").toString();
doc->numPages();
doc->isLinearized();
doc->isEncrypted();
doc->okToPrint();
doc->okToCopy();
doc->okToChange();
doc->okToAddNotes();
doc->pageMode();
for( int index = 0; index < doc->numPages(); ++index ) {
Poppler::Page *page = doc->page( index );
QImage image = page->renderToImage();
page->pageSize();
page->orientation();
delete page;
std::cout << ".";
std::cout.flush();
}
std::cout << std::endl;
delete doc;
}
}
}
std::cout << "Elapsed time: " << (t.elapsed()/1000) << "seconds" << std::endl;
}
示例2: checkVersion
void TestMetaData::checkVersion()
{
Poppler::Document *doc;
doc = Poppler::Document::load("../../../test/unittestcases/doublepage.pdf");
QVERIFY( doc );
QCOMPARE( doc->pdfVersion(), 1.6 );
delete doc;
}