本文整理汇总了C++中poppler::Document::linkDestination方法的典型用法代码示例。如果您正苦于以下问题:C++ Document::linkDestination方法的具体用法?C++ Document::linkDestination怎么用?C++ Document::linkDestination使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类poppler::Document
的用法示例。
在下文中一共展示了Document::linkDestination方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QVERIFY
void TestLinks::checkDests_xr02()
{
Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/unittestcases/xr02.pdf");
QVERIFY( doc );
std::auto_ptr< Poppler::LinkDestination > dest;
dest.reset( doc->linkDestination("section.1") );
QVERIFY( isDestinationValid_pageNumber( dest.get(), doc ) );
QVERIFY( !isDestinationValid_name( dest.get() ) );
dest.reset( doc->linkDestination("section.2") );
QVERIFY( isDestinationValid_pageNumber( dest.get(), doc ) );
QVERIFY( !isDestinationValid_name( dest.get() ) );
dest.reset( doc->linkDestination("section.3") );
QVERIFY( !isDestinationValid_pageNumber( dest.get(), doc ) );
QVERIFY( isDestinationValid_name( dest.get() ) );
delete doc;
}
示例2: checkDocumentWithNoDests
void TestLinks::checkDocumentWithNoDests()
{
Poppler::Document *doc;
doc = Poppler::Document::load(TESTDATADIR "/unittestcases/WithAttachments.pdf");
QVERIFY( doc );
std::auto_ptr< Poppler::LinkDestination > dest;
dest.reset( doc->linkDestination("no.dests.in.this.document") );
QVERIFY( !isDestinationValid_pageNumber( dest.get(), doc ) );
QVERIFY( isDestinationValid_name( dest.get() ) );
delete doc;
}
示例3: addSynopsisChildren
void addSynopsisChildren(QDomNode *parent, int level)
{
if (!parent || parent->isNull())
return;
// keep track of the current listViewItem
QDomNode n = parent->firstChild();
while (!n.isNull()) {
PDFTocEntry *tocEntry = new PDFTocEntry;
tocEntry->level = level;
// convert the node to an element (sure it is)
QDomElement e = n.toElement();
tocEntry->title = e.tagName();
// Apparently we can have external links in the ToC.
// Not doing this for now, but leave it in here as a note to self
// if (!e.attribute("ExternalFileName").isNull()) item.setAttribute("ExternalFileName", e.attribute("ExternalFileName"));
if (!e.attribute("DestinationName").isNull()) {
Poppler::LinkDestination *dest = document->linkDestination(e.attribute("DestinationName"));
if (dest) {
tocEntry->pageNumber = dest->pageNumber();
delete dest;
}
//item.setAttribute("ViewportName", e.attribute("DestinationName"));
}
if (!e.attribute("Destination").isNull()) {
//fillViewportFromLinkDestination( vp, Poppler::LinkDestination(e.attribute("Destination")) );
//item.setAttribute( "Viewport", vp.toString() );
Poppler::LinkDestination dest(e.attribute("Destination"));
tocEntry->pageNumber = dest.pageNumber();
}
// if (!e.attribute("Open").isNull()) item.setAttribute("Open", e.attribute("Open"));
// if (!e.attribute("DestinationURI").isNull()) item.setAttribute("URL", e.attribute("DestinationURI"));
// Add the entry to the list of ToC entries
entries.append(tocEntry);
// descend recursively and advance to the next node
++level;
if (e.hasChildNodes())
addSynopsisChildren(&n, level);
--level;
n = n.nextSibling();
}
}