Product: iOS SDK
Product Version: 9.4
Please give a brief summary of your issue:
In our application we extract the filled out fields in a pdf and save the xdfdStrings to our backend. We then read those in and merge them onto our doc.
Please describe your issue and provide steps to reproduce it:
Current in our iOS app we use the formFieldDataModified
delegate to get each field that was updated. In this delegate we convert the annotation to a PTVectorAnnot
so that we can then do doc.fdfExtractAnnots(annot).saveAsXFDFToString()
. We are saving an array of these xfdfStrings so that when the user comes back into the app we add them to the doc.
We have noticed that with a few documents this process doesn’t work. When we use the pdf extract annots function to get the string version it gives us a generic string that doesn’t have the value, field, name or really anything. Is there another (maybe better way of doing this)? I’ll provide a code snippet to show you what we are doing. We aren’t really sure why some of the documents it doesn’t extract the string. We compared it to our android work and it works fine on android. Any direction would be appreciated.
override func toolManager(_ toolManager: PTToolManager, formFieldDataModified annotation: PTAnnot, onPageNumber pageNumber: UInt) {
guard annotation.isValid(), annotation.getType() == e_ptWidget else { return }
let annot = PTVectorAnnot()
annot?.add(annotation)
var xfdfString = ""
let xfdf = self.document?.fdfExtractAnnots(annot).saveAsXFDFToString() ?? ""
xfdfString = xfdf
let widget = PTWidget(ann: annotation)
guard let field = widget?.getField() else { return }
let name = field.getName() ?? ""
}