SkillsReviewed · instavm

PDF Text Replace

PDF Text Replace is an assistant skill for people updating fillable PDF forms, but it cannot change static page text or flattened PDFs. Its companion Python script uses pypdf to replace exact, case-sensitive text across matching form values.

Researched 15 Nov 2026

In short.

PDF Text Replace is an assistant skill for users and developers updating fillable PDF forms, with the main restriction that it only edits form values. Its Python script replaces matching substrings across fields and writes an output PDF when matches exist. It prints complete matched values to the console and can overwrite an existing output file. Successful output, viewer rendering and preservation of advanced document features are not assessed.

Researched and written by an AI model and checked by a second AI model. How it works

Covers SKILL.md and scripts/replace_text_in_pdf.py within skills/public/pdf-text-replace at commit 0f6f6214a1cc1fe34124220e6429e624d94d49e8, together with root LICENSE and THIRD_PARTY_NOTICES.md as related licensing context. Other Coderunner code, container requirements and dependency implementations are outside the supplied evidence. Nothing was executed; output correctness, rendering, compatibility and preservation of document features are not assessed.

The overview

Identity

PDF Text Replace consists of SKILL.md instructions and scripts/replace_text_in_pdf.py in the instavm/coderunner repository. The source folder is [https://github.com/instavm/coderunner/tree/main/skills/public/pdf-text-replace].

The skill describes a task an assistant can perform using the script. The script itself performs deterministic text replacement and contains no direct AI model calls. Compatibility with a particular assistant product is not established.

Assessment

This is a focused option for changing an exact name, address fragment, date or reference wherever it occurs in editable form values. The implementation is small enough to make its matching and output rules clear.

Its usefulness depends on the PDF containing suitable form fields. The documentation claims those fields remain editable, and the code clones the document without an explicit flattening step, but preservation and visible output have not been demonstrated.

Users

The documented uses include correcting names in filled tax forms, replacing addresses and updating dates or reference numbers. Users need an assistant capable of invoking Python or enough command-line experience to run the companion script.

Developers can use its command-line interface in document-processing automation. Each invocation handles one input PDF; processing a collection of files requires additional orchestration.

Capabilities

The script finds case-sensitive substrings in non-empty string field values and replaces every occurrence within each matching value. Surrounding text remains part of the new value. There is no command-line option for case-insensitive matching, regular expressions or selecting particular field names.

It reports matching field names and a field count. That count measures fields, not individual text occurrences, and it can increase even when the replacement string equals the search string. A no-match result returns without writing a new output PDF.

Using it

Requirements

The instructions declare Python 3.7+, pypdf and a PDF with fillable fields. No pypdf version is specified, so a compatible Python and pypdf combination is not established by these files.

The input path and output directory must already exist, and writing requires permission to the destination. The instructions say pypdf is included in container requirements, but those requirements and a complete container setup are not supplied.

Mechanism

PdfReader opens the input, and PdfWriter clones the document. The script retrieves form fields, collects their non-empty /V values and applies Python string replacement to matching string values.

It passes the resulting field-name/value mapping to update_page_form_field_values for every page, then writes the destination. Matching uses value type rather than a check that the PDF field is specifically a text field; behavior with other field types is not assessed.

Setup

Obtain both SKILL.md and scripts/replace_text_in_pdf.py, provide a Python environment containing pypdf, and choose an input PDF and a separate output path. SKILL.md alone does not contain the implementation.

The documented interface accepts four positional arguments: input PDF, search text, replacement text and output PDF. The /app/uploads paths in the examples assume the documented container layout; adapt them to the actual file locations. The script does not create missing output directories.

Example

An illustrative invocation from the skill folder is: python scripts/replace_text_in_pdf.py input.pdf "John Doe" "Jane Smith" output.pdf.

Under the source's replacement rule, a matching string value of "Applicant: John Doe" would become "Applicant: Jane Smith". Other matching fields would also be included. This illustrates the code's logic; no resulting example PDF or execution result is supplied.

Assessment & evidence

Limitations

The documented scope excludes static page text, scanned image content and flattened PDFs. Compatibility with encrypted PDFs, XFA forms, signatures, complex field structures and different PDF viewers is not assessed.

For each match, console output includes the field name and complete old and new values. Confidential form content can therefore appear in logs. The destination is opened in write-binary mode without checking whether it already exists or equals the input path.

There is no guard against an empty search string. The command exits with status 1 for no matches, missing fields and caught exceptions, so automation must inspect the accompanying message to distinguish those outcomes.

Fit rationale

The strongest fit is a correction that should apply to every occurrence of an exact substring across form values. The absence of a field selector matters when identical text appears in several fields but only one should change.

A positive reported match count establishes only that matching field values were found; updating fields or writing the output can still fail afterward. It does not independently verify the saved document's visible text, continued editability or preservation of unrelated features.

Alternatives

For an isolated correction, consider a PDF form editor that lets the user choose a specific field. Static page text or scanned content calls for a different editing approach, potentially involving page-content editing, image editing or OCR.

These are alternative approaches suggested by this skill's limits. No named competing products, comparative results or alternative prices are supplied, so relative quality and cost are unknown.

Evidence

The available material contains the skill instructions, its complete companion script, the root Apache license and repository-wide third-party notices. The instructions establish intended use; the implementation establishes matching rules, console output and file-writing behavior.

No input PDF, output PDF, test suite, benchmark or dependency lock file is supplied. Runtime success, visual rendering and document preservation remain unverified.

Access & freshness

Costs

No purchase price, hosted-service fee or measured operating cost is supplied. The root Apache-2.0 license grants covered code rights without a royalty, subject to its terms.

The script makes no direct model API calls, so no model usage charge is evidenced. Environment provisioning, hosting if used, support and maintenance costs are unknown.

Rights

The repository's root LICENSE supplies Apache-2.0 terms permitting use, modification and redistribution of covered material. Redistribution requires a license copy, applicable retained notices and prominent notices on modified files. The license disclaims warranties and does not grant general trademark rights.

THIRD_PARTY_NOTICES.md separately lists terms for components including FFmpeg, imageio, Pillow and fonts. Their use by this particular script is not shown. The script imports pypdf, whose license is not identified in the supplied notices; dependency licensing therefore remains incomplete in this evidence.

Freshness

The supplied snapshot identifies commit 0f6f6214a1cc1fe34124220e6429e624d94d49e8 and capture time 2026-11-15T21:54:43.132Z. Its fixed source location is [https://github.com/instavm/coderunner/tree/0f6f6214a1cc1fe34124220e6429e624d94d49e8/skills/public/pdf-text-replace].

The capture time is not a release or maintenance date. A skill version, dependency compatibility history, later changes and current maintenance status are unknown.

Next steps

Confirm that the target text lives in editable form values and that every matching field should change. Use a non-empty search string, preserve the input and choose a different, unused output path.

Before relying on the output, inspect a representative document in the intended viewer, confirm the intended values changed and check that fields remain editable. Protect console logs when forms contain confidential data. For redistribution, retain applicable notices and establish pypdf's license separately.

Evidence for this report

LICENSEnotice · checked 2026-11-15
THIRD_PARTY_NOTICES.mdnotice · checked 2026-11-15
skills/public/pdf-text-replace/SKILL.mdselected · checked 2026-11-15