Select Page & Extract Text 🎯📄
Grab one page — as both a PDF and as text
- pdf_pages
- selected_page_as_pdf_pages
- extracted_text
Select Page & Extract Text 🎯📄 is the pack's sniper rifle: it pulls exactly one page out of a PDF_PAGES list and hands it back to you twice - once as a single-page PDF list, once as extracted text. If you've ever wanted page 7 of a contract as its own PDF and as copy-pasteable text, this node does both in one shot.
The input that matters
pdf_pages(PDF_PAGES) - your loaded or merged page list.page_index(INT, default 0) - which page, and here's the trap: it's 0-indexed. Page 1 of the real-world document is index 0, page 7 is index 6. The node's own docs are explicit about this, and it's the number-one way people get "the wrong page" out. If your doc has 10 pages, valid indices are 0–9.
The two outputs
selected_page_as_pdf_pages(PDF_PAGES) - a list containing just that one page. Wire this into Save PDF to write a single-page PDF, or into Rotate/Merge to do something to just this page. This is what makes the node more than a text extractor - you get the page as a manipulable object, not just a string.extracted_text(STRING) - the text on that page, pulled via pypdf'sextract_text(). Feed it to a text display node, a prompt template, an LLM node, or anything that eats a string.
Both outputs come from the same selection, so you can save page 6 as a PDF and simultaneously drop its text into a summary workflow. Two useful things, one node.
Mechanism and its limits
The mechanism is: index into the page list, copy that one PageObject into a fresh single-element list, and run extract_text() on it. That last part is where expectations need adjusting. pypdf extracts the embedded text layer of the PDF. It does not do OCR. A scanned document - a photo of a page saved as a PDF - has no text layer, and this node returns an empty string for it, cheerfully. If your PDFs are scans, you need OCR elsewhere; this node will not resurrect the words from pixels.
Out-of-range indices are handled gracefully: it logs a warning to the console and returns an empty list plus an empty string. So a typo'd index gives you silence, not an error. And per usual with this pack, if text comes back empty, the console is your first diagnostic stop.
Install
Same pack, same routine. ComfyUI Manager → search "ComfyUI PDF Nodes", or:
cd ComfyUI/custom_nodes/
git clone https://github.com/orion4d/ComfyUI_pdf_nodes.git
cd ComfyUI_pdf_nodes && pip install -r requirements.txt
Restart and it's under PDF. Text extraction needs only pypdf; no PyMuPDF or Pillow required for this node. It's the one I'd call the pack's sleeper - most people discover the multi-page text extractor first, but when you need one page in two forms, this node is exactly what you reach for.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| pdf_pages | PDF_PAGES | — | |
| page_index | INT | 0 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| selected_page_as_pdf_pages | PDF_PAGES | — |
| extracted_text | STRING | — |