Skip to content
Back to skills

Pdf Text Replace

ASecurity

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

  • 891 stars
  • 0 votes
  • 0 copies
  • 56 views
  • Added December 19, 2025
toolspythonbash

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add instavm/coderunner --skill pdf-text-replace --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pdf Text Replace?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pdf Text Replace
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/instavm-pdf-text-replace/badge)](https://www.skillsdirectory.com/skills/instavm-pdf-text-replace)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pdf-text-replace
description: 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.
---

# 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

```bash
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

```bash
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

Files in this skill

  • SKILL.md2.1 KB
  • scripts/replace_text_in_pdf.py3.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…