Skip to main content

Getting Started

Get up and running with PDFDancer in just 3 minutes. This guide covers installation and a simple working example.

Installation

Choose your preferred method:

Option 1: AI-Assisted Development – Let your AI coding assistant handle everything (recommended for fastest setup)

Option 2: Manual Install – Traditional package manager installation

Requirements: Python 3.10+, Node.js 20+ or Java 11+.

No API token needed to get started—the SDK uses anonymous access automatically.

Install from PyPI:

pip install pdfdancer-client-python

Your First PDF Edit

Here's a simple example that opens a PDF, finds and replaces text, adds a new paragraph, and saves it:

from pathlib import Path
from pdfdancer import Color, PDFDancer

# No token needed! SDK automatically gets an anonymous token
with PDFDancer.open(pdf_data=Path("input.pdf")) as pdf:
# Locate existing content
heading = pdf.page(1).select_paragraphs_starting_with("Executive Summary")[0]
heading.edit().replace("Overview").apply()

# Add a new paragraph using the fluent builder
pdf.new_paragraph() \
.text("Generated with PDFDancer") \
.font("Helvetica", 12) \
.color(Color(70, 70, 70)) \
.line_spacing(1.4) \
.at(page_number=1, x=72, y=520) \
.add()

# Persist the modified document
pdf.save("output.pdf")

What's Next?