PDF to TXT
Copy the text layer from a PDF into a .txt download. A scanned page with no text comes out empty. For a scan, use PDF OCR and keep this PDF.
How to use this tool
- Add one PDF.
- Choose Download TXT. The button says Extracting… while the pages are read.
- The download is the PDF name with .txt instead of .pdf. Each page in the file starts with a line --- Page N ---.
- The box on the page shows the first 4000 characters of that text, with an ellipsis when the preview is cut. The download is the full text, not the preview.
- Success says Text extracted. A failure says PDF to text failed.
Text layer only
Each page calls getTextContent and joins the string items with spaces. There is no OCR step on this page. A photographed contract will download a file of page headings and little else. Use the OCR page when you need guessed letters from a picture.
The preview slice is full.slice(0, 4000). If you see an ellipsis, the .txt is longer than the box. Open the download. Do not copy the preview and assume it is the whole document.
PDF to text failed means the document could not be opened. There is no password field. Text extracted means the file was written. Check a page boundary in the .txt. The marker is --- Page N --- so you can see where one page ended.
The preview is a slice
The box shows 4000 characters. The .txt continues past that slice. Page markers look like --- Page N ---. Empty sections mean that page had no text layer. Open the downloaded file, not only the box.
The words, without the layout
Download the text file and search for a sentence from the first page and one from the last. If both are there, the text layer was readable. Columns may come out in a strange order because a text file has no columns. A scanned page contributes nothing until you run OCR. This export does not keep fonts, images, or the page breaks as you saw them.