Kevin Sylvestre
Kevin Sylvestre

Reputation: 38012

PDFKit / PDFView Disable Interaction with Form Annotation

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

Upvotes: 4

Views: 1784

Answers (1)

Aris
Aris

Reputation: 1559

You can try this (for first page):

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

Upvotes: 3

Related Questions