> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# pdftotext

> Set up the credential-free pdftotext CLI for PDF files.

![](https://mintcdn.com/struktoai/F9Lv_nTaj6By6crk/images/python-logo.svg?fit=max\&auto=format\&n=F9Lv_nTaj6By6crk\&q=85\&s=cf5b268d330f7db46ea5cf6083f309a1)

Node.js

Browser

![](https://mintcdn.com/struktoai/CsxMCKUyfoQQJYHB/images/cloudflare-logo.svg?fit=max\&auto=format\&n=CsxMCKUyfoQQJYHB\&q=85\&s=23668457afa14abb3b0db0f5b9c0541a)

Mirage implements [poppler](https://poppler.freedesktop.org)'s `pdftotext`:
the text of a PDF in reading order, with `-layout`, `-raw`, page ranges and
poppler's messages and exit codes. It reads text layers; scanned pages give
empty text.

`pdftotext` needs no account config and reads PDF files through existing mounts.
Register it on `ws`.

> [tab] YAML
>
> ```yaml workspace.yaml theme={null}
> clis:
>   pdftotext:
>     cli: pdftotext
>     machine: in_process
> ```

> [tab] Python
>
> ```python theme={null}
> from mirage.commands.cli.builtin.pdf import PDFTOTEXT
>
> ws.register_cli("pdftotext", PDFTOTEXT)
> ```

> [tab] TypeScript
>
> ```typescript theme={null}
> import { PDFTOTEXT } from '@struktoai/mirage-node'
>
> ws.registerCli('pdftotext', PDFTOTEXT)
> ```

## SDK guides

> [card] [Python](https://docs.mirage.strukto.ai/python/cli/pdftotext.md)
>
> Every command, its flags and behavior.

> [card] [TypeScript](https://docs.mirage.strukto.ai/typescript/cli/pdftotext.md)
>
> Every command, its flags and behavior.

## License

| Project | Role in Mirage | License |
| - | - | - |
| [poppler](https://poppler.freedesktop.org) | Command-line behavior reference; Mirage copies none of its code | GPL |
| [pdf\_oxide](https://github.com/yfedoseev/pdf_oxide) | PDF reader dependency | MIT or Apache-2.0 |
| [Mirage](https://github.com/strukto-ai/mirage) | Command implementation | [Apache-2.0](https://github.com/strukto-ai/mirage/blob/main/LICENSE) |

See [compatibility and licenses](https://docs.mirage.strukto.ai/home/setup/clis.md#compatibility-and-licenses).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.