如何使用PowerShell在PDF中搜索字符串并返回字符串所在的页码?

问题描述 投票:-1回答:1

标题基本概括了所有内容。我想在pdf中搜索某些关键字,然后确定这些关键字所在的页面。

powershell pdf search
1个回答
2
投票

鸽子在iTextSharp位上拖尾。你的问题听起来与这篇文章相似。

如何使用带有Pdfreader类的itextsharp读取PDF内容。我的PDF可能包含纯文本或Reading PDF content with itextsharp dll in VB.NET or C#文本的图像

因此在PoSH中,正如trebleCode所述,你可以做类似......

Add-Type -Path .\itextsharp.dll
$reader = New-Object iTextSharp.text.pdf.pdfreader -ArgumentList "$pwd\test.pdf"

# the rest of your code starts here
© www.soinside.com 2019 - 2024. All rights reserved.