| name | pdf-reader |
| description | Reads text content from PDF files. Use when you need to extract text, analyze content, or summarize information from a PDF document. Supports limiting the number of pages read. |
PDF Reader Skill
Description
This skill allows you to extract and read text content from PDF files using pypdf.
Usage
To read a PDF file, execute the following command using uv:
XDG_CACHE_HOME=/tmp/.cache UV_CACHE_DIR=/tmp/.uv-cache \
uv run --with pypdf python3 ~/deploy/configs/llm/skills/pdf-reader/scripts/read_pdf.py <path_to_pdf> [--pages <number_of_pages>]
Examples
Read an entire PDF:
XDG_CACHE_HOME=/tmp/.cache UV_CACHE_DIR=/tmp/.uv-cache \
uv run --with pypdf python3 ~/deploy/configs/llm/skills/pdf-reader/scripts/read_pdf.py /path/to/document.pdf
Read only the first 5 pages:
XDG_CACHE_HOME=/tmp/.cache UV_CACHE_DIR=/tmp/.uv-cache \
uv run --with pypdf python3 ~/deploy/configs/llm/skills/pdf-reader/scripts/read_pdf.py /path/to/document.pdf --pages 5
Troubleshooting
If uv fails because it cannot write to ~/.cache/uv (common in sandboxed sessions), re-run with temporary cache directories:
XDG_CACHE_HOME=/tmp/.cache UV_CACHE_DIR=/tmp/.uv-cache \
uv run --with pypdf python3 ~/deploy/configs/llm/skills/pdf-reader/scripts/read_pdf.py <path_to_pdf> [--pages <number_of_pages>]
If uv is not available, ensure pypdf is installed via pip:
pip install pypdf
python3 ~/deploy/configs/llm/skills/pdf-reader/scripts/read_pdf.py <path_to_pdf> --pages <number_of_pages>