pdfly
pdfly copied to clipboard
feat: Manipulate layers / optional content
Please explain your intent The ability to turn layers on/off, delete layers, and copy layers to a new file
Describe the solution you'd like
A new command layers, perhaps something like:
> pdfly layers doc.pdf --list
['layer1': {'visible': True}, 'layer2': {'visible': True}]
> pdfly layers doc.pdf --off layer1
layer1 turned off
> pdfly layers doc.pdf --list
['layer1': {'visible': False}, 'layer2': {'visible': True}]
> pdfly layers doc.pdf --del layer2
layer2 deleted
> pdfly layers doc.pdf --list
['layer1': {'visible': False}]
Additional context I'm interested in working on this!
After a little research I see this is a longstanding upstream issue in pypdf: https://github.com/py-pdf/pypdf/discussions/1181
I'll take this up over there for now.
This would be a nice addition to pdfly 👍