PE

    pdf editing

    by aadil khurshid

    1

    This skill provides the engineering patterns and validation logic required to build reliable PDF editing systems using Python and PyMuPDF.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    PE

    pdf editing

    Example session with this skill installed

    I need to redact a specific area on page 1 of 'invoice.pdf'. The coordinates are [100, 100, 240, 135]. Save it as 'redacted.pdf' and verify the text is gone.

    • Read your context and instructions
    • Compiled the pdf editing
    • Generated the document

    I have applied a secure redaction to the specified region on page 1 of invoice.pdf. The process included adding a redaction annotation, applying the removal, and saving the document with full garbage collection to ensure the data is not recoverable.

    Redaction Report

    PageRegion (x0, y0, x1, y1)ResultText Verification
    1[100.0, 100.0, 240.0, 135.0]Applied & Sanitized0 matches found in output
    import pymupdf
    
    # Implementation used for this operation
    doc = pymupdf.open("invoice.pdf")
    page = doc[0]
    region = pymupdf.Rect(100, 100, 240, 135)
    
    # 1. Add redaction annotation
    page.add_redact_annot(region, fill=(0, 0, 0))
    
    # 2. Apply and remove content
    page.apply_redactions(images=pymupdf.PDF_REDACT_IMAGE_NONE)
    
    # 3. Save with garbage collection to remove cross-references
    doc.save("redacted.pdf", garbage=4, deflate=True)
    doc.close()
    
    # 4. Post-save verification
    check_doc = pymupdf.open("redacted.pdf")
    extracted_text = check_doc[0].get_text("text", clip=region)
    print(f"Post-redaction text count: {len(extracted_text.strip())}")
    check_doc.close()
    

    Next steps

    • Open redacted.pdf in a standard viewer to visually confirm the blacked-out region.
    • Run test_redaction_security.py to check for any residual metadata or shared image resources.
    • If this document contains OCR layers, consider running an additional pass to verify the hidden text layer was also removed.

    invoice.pdf

    PDF · document

    Generated

    Example file from a real run - the skill writes it into your workspace.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Working with PDFs usually means fighting broken layouts, lost text, and incomplete redactions that leave sensitive data extractable. This skill provides the engineering patterns and validation logic required to build reliable PDF editing systems using Python and PyMuPDF. It helps you manage complex coordinate transforms, typography, and secure document sanitization without common library pitfalls.

    What it does

    • Coordinate management translates between PDF user space, rotated display space, and browser canvas pixels.
    • Content manipulation handles text insertion, replacement, and deletion with font alias mapping.
    • Secure redaction implements multi-layer removal of text, images, and graphics beyond simple visual overlays.
    • Page operations manages reordering, rotation, duplication, and merging with 1-indexed to 0-indexed conversion.
    • Fidelity validation verifies rendering output and structural integrity post-save to prevent regression.

    How it works

    1. Reconnaissance performs document inspection to identify rotation, page boxes, and selectable versus scanned content.
    2. Validation enforces schema constraints on operation payloads, including finite numeric geometry and page bounds.
    3. Execution applies ordered operations using PyMuPDF while preserving the source document as immutable.
    4. Sanitization applies redaction annotations followed by full garbage collection and rewrite.
    5. Verification reopens the output file to confirm structural and visual postconditions.

    Frameworks & tools

    Python, PyMuPDF (fitz), FastAPI, Next.js, and TypeScript. Includes a reference implementation based on the PaperForge workspace architecture.

    Why this beats prompting it yourself

    Generic AI prompts often ignore the difference between drawing a black box and actual content redaction, leading to data leaks. This skill enforces strict coordinate transformations and verification steps that generic code generation typically skips.

    Use cases

    • Building a web-based PDF editor with a React frontend and Python backend.
    • Automating the redaction of PII from large document batches.
    • Implementing digital signature overlays and form field updates.
    • Developing regression test suites for document processing pipelines.

    Known limitations

    Does not support cryptographic digital signatures or certificate-based identity. Performance is limited by PyMuPDF and OCR engine overhead for large image-heavy documents.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Frequently Asked Questions

    This skill addresses the 'black box' problem by implementing true redaction that removes underlying data layers and providing precise coordinate mapping to ensure edits align perfectly across different zoom levels and rotations.

    The skill includes a reference implementation for Python/PyMuPDF backends and TypeScript/React frontends, making it compatible with any AI agent or framework that supports a standard REST API architecture.

    You receive a complete engineering blueprint including the Python logic for coordinate transforms, validation schemas, secure redaction patterns, and a reference architecture based on the PaperForge workspace.

    Yes, the skill is designed to handle document-wide operations like batch PII redaction, page reordering, and merging across multiple files while maintaining structural integrity.

    The skill focuses on content manipulation and document sanitization; it does not currently support the creation or verification of cryptographic digital signatures or certificate-based identities.

    Setup requires a Python environment with PyMuPDF and a basic understanding of FastAPI; the included documentation guides you through configuring the coordinate validation logic for your specific canvas requirements.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.