Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the bug where
button_states()
returns None when /AP
points …
…to an indirect object. Description: Some PDF widget objects may not have their `/AP`(Appearance Dictionary) directly pointing to a dictionary, which is enclosed with '<< >>', but rather pointing to an indirect object, expressed by an xref number in the format 'NNN 0 R'. Therefore, the current button_states() only can correctly handle cases where `/AP` points to a dictionary and cannot handle cases where it points to an indirect object. Consequently, I have introduced additional logic to handle the latter scenario, ensuring that `button_states()` can accurately return the on/off state names for button widgets even when `/AP` points to an indirect object. Test: I have tested the modified `button_states()` function on the mentioned type of PDF, and it now correctly returns the states instead of None. I have copied the method's code to the same-named method in `src/__init__.py`.
- Loading branch information