Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/MuhammadSalmanAhmad/rag-pdf-highlighter/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through running RAG PDF Highlighter, sending a highlight request, and receiving a highlighted PDF back. Choose the path that fits your use case: start the FastAPI microservice and call it over HTTP, or import the core function directly into your Python code.
1

Install

Install the package from PyPI:
pip install rag-pdf-highlighter
2

Start the server

Start the Uvicorn server, binding to all interfaces on port 8000:
uvicorn rag_pdf_highlighter.main:app --host 0.0.0.0 --port 8000
The server is ready when you see Uvicorn reporting Application startup complete. You can verify it is running by visiting http://localhost:8000/ — it returns {"status": "ok the app is running"}.
3

Send a highlight request

Send a POST /highlight request with a PDF URL and the text chunks you want highlighted. The response body is the annotated PDF file.
curl -X POST http://localhost:8000/highlight \
  -H "Content-Type: application/json" \
  -d '{
    "pdf_url": "https://example.com/report.pdf",
    "documents": [
      {
        "page_content": "Text to highlight in the PDF",
        "metadata": {"page": 0}
      }
    ]
  }' \
  --output highlighted.pdf
The file highlighted.pdf in your current directory is the annotated copy of the original PDF.
The metadata.page field is zero-indexed. Page 1 of the PDF is {"page": 0}, page 2 is {"page": 1}, and so on. Passing an out-of-range page number causes that chunk to be silently skipped.

Next steps

API reference

Full documentation for the POST /highlight endpoint, request fields, and error responses.

Guides

Deploy with Docker, integrate with LangChain retrieval chains, and handle large PDFs.

Build docs developers (and LLMs) love