Copy the text from a PDF that will not let you copy it
Published · Updated 2 min read
You want to take the text from a PDF and selecting with the mouse does not work, or gives letters in disorder. Everything depends on what the document really contains: text, or only images of text. The extraction does not give the same thing in both cases.
Real text or image of text
Open the PDF and try to select a word. If selection works, the document contains real text. If not, its pages are images, like those of a scan: for the computer, it is a photo, not letters.
What the tool does
PDF to text reads the real text directly, and applies character recognition to pages that have none, meaning it "reads" the image to find the letters. The result is a text file with a marker before each page: "--- Page 1 [native] ---" for real text, "--- Page 1 [ocr] ---" for a recognized page. For a ten-page report, the file is about 5 KB.
A two-column page
The tool reads the lines across the whole width of the page. The lines of two columns therefore get mixed: left and right follow one another line after line. A word split at the end of a line stays split, for example "com" then "menced", and the hyphen disappears. The cells of a table arrive on a single line, separated by spaces.
A scanned page
A page turned into an image no longer has real text. Recognition takes a few seconds per page and finds the text, the split word and the lines of a table, with the same mixed columns. The engine is set for French: another language may be recognized less well, and the sharpness of the scan matters a lot for the result.
Reread before using
- Check proper names, numbers and accents.
- Spot the column changes.
- To keep the layout, convert the PDF to images instead.
- Keep the original PDF.
For which documents
A scanned contract, an invoice received as an image, an article where selection does not work, or a report from which you want to take a few paragraphs: the extraction gives a text file to copy elsewhere.
Frequently asked questions
- How do you know whether my PDF contains real text?
- Try to select a word. If selection works, the text is real. If not, the pages are images, like those of a scan.
- Can the tool read a scanned PDF?
- Yes, it applies character recognition to pages that have no text. The engine is set for French, and the sharpness of the scan matters a lot.
- Why are the two columns mixed?
- The tool reads the lines across the whole width of the page, so the columns get mixed. To keep the layout, convert the PDF to images instead.
- What do "[native]" and "[ocr]" mean in the result?
- "[native]" indicates real text, "[ocr]" a page recognized from an image. The second needs a more careful reread.
