pdfly icon indicating copy to clipboard operation
pdfly copied to clipboard

feat: Manipulate layers / optional content

Open p-vdp opened this issue 1 month ago • 2 comments

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!

p-vdp avatar Oct 20 '25 01:10 p-vdp

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.

p-vdp avatar Oct 20 '25 05:10 p-vdp

This would be a nice addition to pdfly 👍

Lucas-C avatar Oct 20 '25 06:10 Lucas-C