私は常に「pdfgrep」を使用して、コマンドラインから複数のPDFファイル内を検索します。しかし、私は問題に遭遇しました:この合字文字「?」(https://www.compart.com/en/unicode/U+FB01を参照)。
「fi」は「fixed」という単語に含まれているため、pdfgrep -iR 'fixed point operator'
で「fixedpointoperator」という用語を検索できませんでした。 。ただし、Foxit ReaderやEvinceなどのPDFリーダーでファイルを開くと、「fi」は「f」と「i」に分割されるため、検索できます。 「pdfgrep」のより信頼できる代替手段はありますか?または、エンコーディングを拡張するためのオプションキーワードが「pdfgrep」にありますか?
PDFファイルはhttp://direct.mit.edu/books/chapter-pdf/238450/9780262321037_can.pdfです。
Ubuntu 20.04、amd64、カーネルバージョンLinux5.6.0-1018-oem。 pdfgrepにはオプション--unac
があります 。ただし、sudo apt-get install pdfgrep
を使用してpdfgrepをインストールすると 、コマンド--unac
「pdfgrep:コンパイル時にUNACサポートが無効になっています!」と報告されます
pdfgrep:
Installed: 2.1.2-1build1
Candidate: 2.1.2-1build1
Version table:
*** 2.1.2-1build1 500
500 http://mirrors.huaweicloud.com/ubuntu focal/universe amd64 Packages
100 /var/lib/dpkg/status
承認された回答:
この問題を解決するには、最初にpdftotext
を使用する必要があります あなたの結紮がUTF-8の形でどのように見えるかを知るために、例えば私はこれを実行します:
pdftotext -f 11 -l 13 ~/Mathematics/Analysis/MeasureTheory.pdf text && cat text
次のような結果が得られます
1.6. Infinite and σ-finite measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
それなら私はfi
を知っています 実際には、端末の呼び出し音☎ですが、fi
としてレンダリングされます ブラウザで。
だから私はpdfgrep
を続けます
pdfgrep --page-range=11-13 fi ~/Mathematics/Analysis/MeasureTheory.pdf
最後に、もちろん私は望ましい結果を得る:
1.6. Infinite and σ-finite measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.4. The general definition of the Lebesgue integral . . . . . . . . . . . . . . 118
2.6. Integration with respect to infinite measures . . . . . . . . . . . . . . . . 124
3.5. Infinite products of measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187