如何检查文件是否为PDF OCR
过程
- 选择PDF文件
- 检查PDF文件是否为PDF OCR
- 消息(对或错)
使用itextsharp找到了答案(我使用的是5.5.10.0)
Public Sub CHeck(ByVal Filename As String,ByRef sOut As String)
Dim oReader As New iTextSharp.text.pdf.PdfReader(FileName)
For i = 1 To oReader.NumberOfPages
Dim its As New iTextSharp.text.pdf.parser.SimpleTextExtractionStrategy
sOut &= iTextSharp.text.pdf.parser.PdfTextExtractor.GetTextFromPage(oReader,i,its)
Next
然后只要条件是字符串是否为空 也可以为每个文件名循环使用。