1

By following this reference - https://developer.apple.com/documentation/pdfkit/pdfannotation/2869800-isreadonly

I am able to edit text of the annotation but i am unable to move the annotation over the pdf page.

Is there any other property by using which I will be able to move the annotations?

I added text annotation with following code:

func addText(x: Int, y: Int, width: Int, height: Int, text: String, fontSize: CGFloat, centerText: Bool){
        guard let document = pdfView.document else { return }
        let lastPage = document.page(at: document.pageCount - 1)
        let annotation = PDFAnnotation(bounds: CGRect(x: x , y: y, width: width, height: height), forType: .widget, withProperties: nil)
        annotation.widgetFieldType = .text
        annotation.widgetStringValue = text
        if (centerText){ annotation.alignment = .center }
        annotation.font = UIFont(name: "calibri", size: fontSize)
        annotation.fontColor = .black
        annotation.color = .clear
        annotation.backgroundColor = .clear
        annotation.isReadOnly = false
        lastPage?.addAnnotation(annotation)
    }

0 Answers0