PDFを検索可能なPDFに一括変換

PDFを検索可能なPDFに一括変換

何千ものPDFを検索可能なPDFに変換する方法を探しています。Nuanceの「PDF Create Assistant」というプログラムを使用しました。電子コピーソフトウェア。ただし、フォルダーを選択することはできません。各サブフォルダーに移動して、変換するファイルを選択し、次のフォルダーに移動する必要があります。

大量の PDF を検索可能な PDF に変換する別の方法は何ですか?

提案はありません。PDF を一括変換する方法が必ずあるはずです。

答え1

BIN フォルダ内の CPYCONVERTER.EXE ファイルをコマンド ラインとして使用します (eCopy Ver.9-Paperworks ではワイルドカードがサポートされています)。これは 8.5 eCopy Desktop 用です。

Command Line Cpy Converter Version 8.5 (Build 0.116)
 Copyright c 1992 - 2004. All rights reserved.

 Converts CPY to CPY, CPY to TIF or TIF to CPY

Usage:
 cpyconverter.exe [-?] -S=<source path> -D=<dest path> [-P] [-E] [-Q] [-B] [-O]
[-T3/T4/TC/C/U]

Note:
 Wildcards are not supported.  Full paths must be used for source and destinatio
n

Switches:
--------------------
-?                      : This menu
-Q                      : Turn off logging.
-P                      : Converter pauses after conversion.
-E                      : Converter pauses if there is an error.
-B                      : Converter burns-in Blackout/Whiteout markups (if appli
cable).
-O                      : Converter OCRs document and creates searchable text (i
f applicable).
-S="<SOURCE PATH>"      : The path of the file to convert.
-D="<DESTINATION PATH>" : The path of the newly converted file.
-P=<PASSWORD>           : Password for encrypting and decrypting documents.
--------------------
 * If the source document is encrypted CPY converter will attempt to decrypt it
to the destination document with the supplied password.
 * If the source document is not encrypted CPY converter will attempt to encrypt
 the destination document using the supplied password.
 * Please note you cannot encrypt/decrypt tif documents.

-<Conversion Type>      : The type of conversion to be done(T3, T4, TC, C, U)
--------------------
* T4 - Convert CPY to TIF Group4
* T3 - Convert CPY to TIF Group3
* C  - Convert TIF(Any group) to CPY
* U  - Convert CPY to CPY

Ex.1 cpyconverter.exe -S="C:\My Dir\test.tif" -D="C:\My Dir\test.cpy" -C
Convert Tiff to cpy

Ex.2 cpyconverter.exe -S="C:\My Dir\test.cpy" -D="C:\My Dir\test.tif" -T3
Convert Cpy to Tif Group 3

Ex.3 cpyconverter.exe -S="C:\My Dir\test.cpy" -D="C:\My Dir\test.tif" -T4
Convert Cpy to Tif Group 4

答え2

Linuxの場合

まず、まだ OCR されていないファイルを OCR する必要があります。OCR できないすべての PDF を検索して OCR するPDF非常に簡単な方法を書きました。grep

pdfファイルにフォントが含まれていない場合、通常は検索できないことに気付きました。このことを知っていれば、 を使用できますpdffonts

最初の 2 行はpdffontsテーブル ヘッダーなので、ファイルが検索可能で 2 行を超える出力がある場合は、これを考慮して次を作成できます。

gedit check_pdf_searchable.sh

これを貼り付けます

#!/bin/bash 
#set -vx
if ((`pdffonts "$1" | wc -l` < 3 )); then
echo $1
pypdfocr "$1"
fi

それを実行可能にする

chmod +x check_pdf_searchable.sh

次に、ディレクトリ内のすべての検索不可能な PDF を一覧表示します。

ls -1 ./*.pdf | xargs -L1 -I {} ./check_pdf_searchable.sh {}

またはディレクトリとそのサブディレクトリ内:

tree -fai . | grep -P ".pdf$" | xargs -L1 -I {} ./check_pdf_searchable.sh {}

答え3

最も簡単な方法は、オンライン OCR APIocr.space APIには、検索可能なPDFこのサービスには、1 か月あたり 25,000 件のコンバージョンの無料枠があります。

その後、Powershell、バッチ、またはその他のスクリプト言語を使用してこれを自動化できます。たとえば、cURL を使用してバッチから変換をトリガーします。

curl -H "apikey:helloworld" --form "[email protected]" --form "language=eng" -form "isOverlayRequired=true" https://api.ocr.space/Parse/Image

関連情報