PDFファイルのスキャン[重複]

PDFファイルのスキャン[重複]

Linuxシェルコマンドを使用してPDF形式の研究論文をスキャンしたいと思います。著者名と論文のタイトルのみを印刷/表示したい場合は、これを行う特別な方法はありますか?

ベストアンサー1

少なくともdebianとfedoraのパッケージのユーティリティpdfinfoに興味があるかもしれません。poppler-utilsヘルプから:

Pdfinfo PDF(Portable Document Format)ファイルから「Info」辞書の内容(およびその他の有用な情報)を印刷します。 「Info」辞書には、次の値が含まれます。

件名 トピック キーワード 作成者 作成者 作成者作成日 変更日


以下は、AIX コマンド文書の出力例です。

$ pdfinfo aixcmds2.pdf
Title:          AIX Version 6.1 Commands Reference, Volume 2
Subject:        
Keywords:       
Author:         IBM
Creator:        XPP
Producer:       Acrobat Distiller 7.0 (Windows)
CreationDate:   Mon Jul  9 15:38:26 2007
ModDate:        Mon Jul  9 15:38:26 2007
Tagged:         yes
UserProperties: no
Suspects:       no
Form:           none
JavaScript:     no
Pages:          746
Encrypted:      no
Page size:      612 x 792 pts (letter)
Page rot:       0
File size:      8588481 bytes
Optimized:      yes
PDF version:    1.3

作成者(この場合は「IBM」)のみが必要な場合は、次のことができます。

pdfinfo aixcmds2.pdf | sed -n 's/^Author: *//p'

またはタイトルと著者が必要な場合は、次のタイトルを使用してください。

$ pdfinfo aixcmds2.pdf | sed -n '/^\(Author\|Title\):/p'
Title:          AIX Version 6.1 Commands Reference, Volume 2
Author:         IBM

おすすめ記事