pdf - 如何使用 poppler 提取 pdf 索引/目录?

标签 pdf indexing poppler

我看到像 okular 和 evince 这样的 pdf 查看器能够很好地显示 pdf 文档(书籍)的索引,并带有指向每个段落的链接。 他们怎么能这样做?他们使用 poppler 库,我怎么能用 poppler 或一般情况下提取该索引?

最佳答案

它只是停留在第一层(递归需要更深入)

toc=document->toc();

QDomElement docElem = toc->documentElement();

 QDomNode n = docElem.firstChild();
 while(!n.isNull()) {
     QDomElement e = n.toElement(); // try to convert the node to an element.
     if(!e.isNull()) {
         qDebug("elem %s\n",qPrintable(e.tagName())); // the node really is an element.

     }
     n = n.nextSibling();
 }

关于pdf - 如何使用 poppler 提取 pdf 索引/目录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7131906/

相关文章:

c++ - std::vector size()-1 是否总是给出最后一个元素的索引?

static - Visual C++下dllimport/dllexport及静态库编译

python - 如何用python-poppler-qt4显示PDF?

php - 如何使用 php 发送带有 pdf 附件的电子邮件?

Angular js中的HTML到Pdf转换

.net - 使用 GhostScript 将 PDF 转换为图像。无需创建图像文件

c++ - Mupdf加密解密问题

mysql - 加载前请求超时,有什么办法可以加快MySql查询的这个过程吗?

mysql - 我应该在 mysql 表中的 tinyint 字段类型上创建索引吗?

c++ - 使用 poppler 在 Qt5 中链接时出错