Updated Sep 21, 2026

Utilities

Extract plain text from one PDF file

Plain text from one PDF. Distribute the node to convert many.

Agent

overview

What pdftotext does

You have a PDF, and the next node needs the words as text. Connect the file to input. The wrapper checks the %PDF- magic, calls Poppler pdftotext, and writes the text to the output path. Non-PDF files become an empty output and a skip line on stderr so a distributed folder does not fail the whole batch.

-f and -l bound the first and last page. -layout is a boolean that keeps physical columns; leave it disconnected unless you want that flag. Hive file output is the text file itself, not a folder of pages.

pdftotext reads text objects already in the PDF. It does not OCR a scan. Use tesseract when the page is an image. Distribute the node over a folder of PDFs when you have many files.

source gitlab.freedesktop.org/poppler/poppler

use cases

Where pdftotext fits

Extract one PDF

Connect the PDF to input. The output file is the extracted text.

Limit to a page range

Set -f and -l. Useful when only the first pages matter.

Keep column layout

Connect -layout only when you want physical positions preserved.

Convert many PDFs

Distribute the node. Non-PDF shards write an empty file and skip.

reference

pdftotext inputs and flags

4 inputs
NameTypeFlagDescription
inputFILE·Input PDF file.
first-pageSTRING-fFirst page to convert.
last-pageSTRING-lLast page to convert.
layoutBOOLEAN-layoutPreserve the physical layout of the text.

Showing key inputs. pdftotext exposes 4 inputs in total.

example

Run pdftotext

pdftotext · command
pdftotext hello.pdf /hive/out/hello.txt
sample output
Hello smoke

guidance

Choosing pdftotext

Use pdftotext when the PDF already has a text layer. Use tesseract when the page is a scan or an image.

tesseract

OCR for images and scanned pages. Use it when pdftotext writes almost nothing.

trafilatura

Extracts article text from HTML, not PDF.

wget

Downloads a PDF. It does not extract text.

faq

pdftotext questions

Connect the file to input. The output is a text file.

Run pdftotext yourself

A fixture PDF feeds pdftotext. The text below is from a completed run.

Facts on this page come from the live Trickest tool library.