PDFKit / PDFView Disable Interaction with Form Annotation

1.6k Views Asked by At

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)?

1

There are 1 best solutions below

3
On BEST ANSWER

You can try this (for first page):

        pdfView.document?.page(at: 0)?.annotations.filter {
            $0.widgetFieldType == PDFAnnotationWidgetSubtype.button
            }.forEach {
                $0.shouldDisplay = false
            }
        }