我已经在Visual Studio 2022中成功编译了PoDoFo 0.10.3。现在我想使用这个库从PDF文档中提取文本,但我正在努力使用API。甚至我也找不到任何示例如何做到这一点。
void parseOneFile(const string_view& filename)
{
PdfMemDocument document;
document.Load(filename);
// iterate over all pages of the whole pdf document
for (int pn = 0; pn < document.GetPageCount(); ++pn)
{
PoDoFo::PdfPage* page = document.GetPage(pn);
// todo: ectract the text from the page
}
字符串
不幸的是,上面的代码示例不工作.(类PoDoFo::PdfMemDocument没有成员GetPageCount)
有人知道怎么做吗?我只想提取文本并保存到一个像std::vector<std::string>
这样的容器中,以便进一步处理。
谢谢你,谢谢
1条答案
按热度按时间z2acfund1#
在阅读了API之后,我能够编写以下代码行:
字符串
但我不确定我是否走对了路.我仍然没有数据/文本(类型为std::string)。