我使用的是pdftron的sdk,它一次只能读取一个页面。我的代码是:
PDFDoc doc = new PDFDoc(input_path);
doc.InitSecurityHandler();
PageIterator itr = doc.GetPage(1);
for (line = txt.GetFirstLine(); line.IsValid(); line = line.GetNextLine()){
for (word = line.GetFirstWord(); word.IsValid(); word = word.GetNextWord()){
Console.WriteLine(word.GetString());
}
}
我想要阅读每一页,我在PDFTRON上发布了同样的问题,forums.But无法获得解决方案。每一页都可以读吗?
发布于 2011-08-03 09:38:24
是的,你可以在time.You上阅读每一页pdf,只需做一些细微的改动初始化页面迭代器即可。我已经修改了代码,它工作得很好。
PDFDoc doc = new PDFDoc(input_path);
doc.InitSecurityHandler();
PageIterator itr = doc.GetPageIterator();
for (; itr.HasNext(); itr.Next()) // Read every page
{
for (line = txt.GetFirstLine(); line.IsValid(); line = line.GetNextLine())
{
for (word = line.GetFirstWord(); word.IsValid(); word = word.GetNextWord())
{
Console.WriteLine(word.GetString());
}
}
}
希望这能对你有所帮助。
https://stackoverflow.com/questions/6920730
复制相似问题