AAN
AAN

Reputation: 31

Unable to save pdf form data using PDFKit iOS 11

I have loaded a pdf form using PDFKit in iOS 11. I am trying to save the editable fields ( Checkbox, TextBox) values. How do I get back the editable PDFDocument object to save the PDF contents using

Upvotes: 1

Views: 331

Answers (1)

AAN
AAN

Reputation: 31

Thanks. I did something like this. I added and Observer and on receiving notification when the pdf changes write the contents to a filepath

PDFView *view = notification.object;
PDFDocument *myDocument = view.document;
NSData* content = myDocument.dataRepresentation; 
[content writeToFile:newPath atomically:YES];

That worked for me.

Upvotes: 1

Related Questions