PD

pdf-text-replace

Automated tool for updating text fields within fillable PDF forms.

Install

mkdir -p .claude/skills/pdf-text-replace && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8888" && unzip -o skill.zip -d .claude/skills/pdf-text-replace && rm skill.zip

Installs to .claude/skills/pdf-text-replace

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Replace text in fillable PDF forms by updating form field values. This skill should be used when users need to update names, addresses, dates, or other text in PDF form fields.
176 chars✓ has a “when” trigger
Beginner

Key capabilities

  • Batch modify PDF form field values
  • Preserve fillable form attributes
  • Automated field-by-field string replacement
  • Maintain PDF document structure
  • Generate new output files with updated metadata

How it works

Uses the pypdf library to parse the document's form dictionary and update field values directly without re-rendering the visual layer.

Inputs & outputs

You give it
Path to PDF, search string, replace string
You get back
Modified PDF file

When to use pdf-text-replace

  • Batch update names in tax forms
  • Replace addresses in standard PDF templates
  • Update dates on dynamically generated documents

About this skill

PDF Text Replace Skill

Replace text in fillable PDF forms by updating form field values.

Description

This skill allows you to search and replace text in PDF files that have fillable form fields. It scans all form fields in the PDF, finds fields containing the search text, and replaces it with the replacement text.

Use Cases

  • Update names in filled tax forms
  • Replace addresses in PDF documents
  • Update dates or reference numbers
  • Batch update form field values

Requirements

  • PDF must have fillable form fields (not flattened)
  • Python 3.7+
  • pypdf library

Usage

Basic Usage

python /app/uploads/skills/public/pdf-text-replace/scripts/replace_text_in_pdf.py \
    /app/uploads/input.pdf \
    "OLD TEXT" \
    "NEW TEXT" \
    /app/uploads/output.pdf

Example: Replace Name in Tax Form

python /app/uploads/skills/public/pdf-text-replace/scripts/replace_text_in_pdf.py \
    /app/uploads/f5472.pdf \
    "MANISH KUMAR" \
    "MANNU KUMAR" \
    /app/uploads/f5472_updated.pdf

Script Details

Script: scripts/replace_text_in_pdf.py

Arguments:

  1. input_pdf - Path to input PDF file
  2. search_text - Text to search for in form fields
  3. replace_text - Text to replace with
  4. output_pdf - Path to save the updated PDF

Output:

  • Creates a new PDF with updated field values
  • Preserves all form fields (not flattened)
  • Reports number of fields modified

Limitations

  • Only works with fillable PDF forms (not scanned/image PDFs)
  • Replaces text in form field values, not static text
  • Case-sensitive search by default
  • Cannot modify flattened PDFs

Dependencies

The script requires the pypdf library, which is included in the container requirements.

Error Handling

The script will report errors if:

  • Input PDF doesn't exist
  • PDF doesn't have fillable form fields
  • Search text is not found
  • Output path is not writable

When not to use it

  • Scanned PDF documents (images)
  • Flattened PDF forms
  • Documents requiring visual text overlays

Prerequisites

Python 3.7+Pypdf library

Limitations

  • Cannot update static text not tied to a field
  • Sensitive to exact field name matches
  • Limited to non-flattened forms

How it compares

Updates data fields programmatically instead of using OCR or manual text injection.

Compared to similar skills

pdf-text-replace side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
pdf-text-replace (this skill)09moReviewBeginner
pdf646moReviewBeginner
zlibrary-to-notebooklm66moReviewBeginner
pdf-processing-pro179moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry