AttributeError: 'Document' object has no attribute 'set_oc_states' #1008
-
I am new to PyMuPDF and recently have been trying to alter OCGs with it. However, there are a handful of attributes that refuse to work when calling them. I cannot find a pattern between the attributes that do and do not work. For example, I have the basic code below:
But when I run the program, I get the error in the title: AttributeError: 'Document' object has no attribute 'set_oc_states'. I can run other attributes such as Has anyone else encountered this issue before or have any possible causes of this? I'm relatively new to Python as well as this particular library. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is a documentation issue. OC-Support is relatively new, so there was initial juggling with the method names. |
Beta Was this translation helpful? Give feedback.
This is a documentation issue. OC-Support is relatively new, so there was initial juggling with the method names.
Instead of
doc.set_oc_states
, please usedoc.set_layer
. It is the same thing.I will update the documentation accordingly.