After I remove/add the annotations I save the file to disk (is this even necessary to properly save the annotations?). I then have the document in a UIActivityViewController
inside a UIActivityItemProvider
.
The annotations are viewable in the print preview, PDF Expert, Firefox, Gmail browser, Preview, etc. - just not Acrobat (and exporting to .doc)
Using Acrobat Reader Build 19.21.20061.361316; using Xcode 11.3
Example annotation:
// Open PDF etc
if annotation.fieldName == "form1[0].Page1[0].WE_FACTR[0]" {
annotation.setValue("30.0", forAnnotationKey: .widgetValue)
page.removeAnnotation(annotation)
page.addAnnotation(annotation)
}
// save PDF to file
// PDF File is in the UIACtivityViewController
I was wondering if anyone had a workaround for missing annotations in PDFKit for Adobe Reader.
When I asked @steipete from PSPDFKit he told me that this is why people use his framework. There is a drop-in replacement call PDFXKit that he suggested.
It didn't work with PSPDFKit either! XFA forms don't seem to be supported.