Skip to content

PPF-1164: Feature Request: Enhanced flattening options with configurable text selectability #1164

@LorenzDreyer

Description

@LorenzDreyer

Hi,
first of all - thank you for creating such a great package! It's been a game-changer for me and made life with PDFs so much easier.

Feature Request

I'd like to propose enhanced flattening options that give more control over text selectability.

Current Behavior

When using flatten=True, form fields become non-editable but also lose text selectability/copyability.

Proposed Enhancement

Add different flattening modes:

# Current behavior
pdf.fill(data, flatten=True)  # Non-editable, non-selectable

# Proposed new options
pdf.fill(data, flatten="selectable")    # Non-editable but selectable/copyable
pdf.fill(data, flatten="readonly")      # Non-editable and not selectable/copyable (current)

Use Case

When you send a flattened PDF to someone else, they often need to copy information from it (names, addresses, reference numbers) without being able to edit the form, so the data you entered stays intact.
Currently, my experience is that the implemented flattening method makes this impossible since the text becomes non-selectable. I tried it with various workarounds and other packages, but it's not that easy.

If this is already possible, I would love for you to tell me how this is done easily. Otherwise, I think this feature could be of great value for a lot of people.

Version

PyPDFForm=3.5.1
Python=3.13.2
OS=macOS 26.0

Would love to hear your thoughts - thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions