PDFから文字が取り出せないときの原因(スキャンPDFとは)
- 紙をスキャンしたPDFは、中身が画像で、文字データがない
- 文字を選択できるかで見分けられる
- 必要なら、文字認識(OCR)を使う
PDFから、文字を取り出そうとしたのに、何も出てこない。そんなときは、そのPDFが、「画像のPDF」である可能性が、高いです。PDFから文字を抜き出す は、文字として入っているPDFから、文字を取り出します。紙をスキャンしただけのPDFでは、取り出せません。
2種類のPDF
- 文字のPDF:文章が、文字として、保存されています。選択、コピー、検索が、できます。Wordなどから書き出したPDFや、ウェブページを保存したPDFは、たいてい、こちらです。
- 画像のPDF:ページ全体が、1枚の画像です。見た目は、文字でも、実際は、ただの絵です。紙を、スキャンしたPDFや、写真から作ったPDFが、これです。
見分け方
- PDFを、別のアプリや、ブラウザで開きます。
- 文章の上で、ドラッグして、選択できるか試します。
- 選択できれば、文字のPDFです。選べなければ、画像のPDFです。
- 検索(Ctrl+F または、Command+F)で、文章中の言葉を、探せるかも、目安になります。
画像のPDFから、文字を取り出すには
文字認識(OCR)という方法を使います。画像の中の文字を、読み取って、文字データにする技術です。このサイトにも、「文字認識(OCR)」のツールがあります。
手順(OCRを使う場合)
- 画像のPDFを、「PDFを画像に変換」で、画像にします。
- 「文字認識(OCR)」のツールで、画像から、文字を読み取ります。
- 読み取った文字を、確認して、必要な部分を、コピーします。
画像のPDFに、なりやすい場面
- 紙の書類を、スキャナーで、読み取った
- スマホで、書類を撮って、PDFにした
- 「圧縮」ツールで、PDFを、軽くした(ページが、画像になるため)
つまずきやすい点
- 一部のページだけ、取り出せない:そのページだけ、画像のことがあります。
- 文字が、少ししか出ない:文章の一部が、画像になっている可能性があります。
- 圧縮した後は、取り出せない:圧縮すると、ページが画像になります。圧縮前の、PDFを使います。
よくある質問
OCRなら、100%取り出せますか?
読み取りの精度は、画像の鮮明さに左右されます。手書きや、小さな文字は、誤りが、増えます。
画像のPDFでも、見た目は、変わりませんか?
見た目は、ほとんど同じです。違うのは、文字として扱えるか、です。
まとめ
何も出ないときは、画像のPDFです。OCRで、画像の文字を読み取ることで、解決できます。
PDFから文字を抜き出すを使う(無料)あわせて使えるツール
- PDFを画像に変換:PDFの各ページを、JPEGまたはPNGの画像として保存します。
- PDFのページを抜き出し・削除:PDFから、必要なページだけを残す、または不要なページを消します。
- PDFを圧縮:PDFを、指定したサイズ以下に小さくします。提出先の容量制限に合わせたいときに。
同じツールの、ほかの解説
Why Text Can't Be Extracted from a PDF (Scanned PDFs)
- Scanned PDFs are images with no text data
- Whether you can select text tells you which it is
- Use OCR (text recognition) if needed
You tried to extract text from a PDF but nothing came out. In that case the PDF is very likely an "image PDF". Extract Text from PDF extracts text from PDFs that hold text as text. It cannot extract from a PDF made by simply scanning paper.
Two kinds of PDF
- Text PDF: the writing is stored as text. You can select, copy and search it. PDFs exported from Word and saved web pages are usually this kind.
- Image PDF: each whole page is a single image. It looks like text but is actually just a picture. PDFs scanned from paper and PDFs made from photos are this kind.
How to tell
- Open the PDF in another app or a browser.
- Try dragging over the writing to select it.
- If you can select it, it is a text PDF. If not, it is an image PDF.
- Whether a search (Ctrl+F or Command+F) finds words in the text is also a guide.
To get text out of an image PDF
Use text recognition (OCR), a technology that reads text in images and turns it into text data. This site also has a text recognition (OCR) tool.
Steps (using OCR)
- Turn the image PDF into images with "PDF to Image".
- Use the "Text Recognition (OCR)" tool to read the text from the images.
- Check the text it read and copy the parts you need.
Where image PDFs commonly arise
- Paper documents read with a scanner
- Documents photographed with a phone and made into a PDF
- A PDF lightened with the "Compress" tool (pages become images)
Common stumbling blocks
- Only some pages cannot be extracted: only those pages may be images.
- Only a little text comes out: part of the writing may be an image.
- It cannot be extracted after compression: compression turns pages into images. Use the PDF from before compression.
Frequently asked questions
Can OCR extract everything?
Accuracy depends on how clear the image is. Handwriting and small text produce more errors.
Does an image PDF look different?
It looks almost the same. The difference is whether it can be handled as text.
Summary
When nothing comes out, it is an image PDF. Reading the text in the images with OCR solves it.
Use "Extract Text from PDF" (free)Tools that go well with this
- PDF to Images: Save each page of a PDF as a JPEG or PNG image.
- Extract or Delete PDF Pages: Keep only the pages you need, or remove the pages you don't.
- Compress PDF: Shrink a PDF to fit under a size you choose, for upload limits.