For a PDFDocument
that contains annotations with a widgetFieldType
of PDFAnnotationWidgetSubtype.text
and PDFAnnotationWidgetSubtype.button
is it possible to disable user interaction for those annotations (i.e. clicking on a checkbox does not cause it to toggle)?
Asked
Active
Viewed 1,494 times
4

Kevin Sylvestre
- 37,288
- 33
- 152
- 232
-
can you share a sample pdf? – Aris Aug 08 '18 at 11:39
1 Answers
3
You can try this (for first page):
pdfView.document?.page(at: 0)?.annotations.filter {
$0.widgetFieldType == PDFAnnotationWidgetSubtype.button
}.forEach {
$0.shouldDisplay = false
}
}

Aris
- 1,529
- 9
- 17
-
-
I tried it with a file with radio buttons and they were only disabled. Ymmv though depending on the file, that’s why I asked for a sample if you had one. – Aris Aug 09 '18 at 20:25
-
if annotation type is ".ink" then b setting "shouldDisplay = false" it hides it instead disabling user interaction. – Waseem Sarwar Aug 04 '19 at 09:50