I have been trying to edit an existing pdf file and saving it to device. I have tried saving the edited file to the same location as the unedited one. But the file could not be saved. Instead I got errors like
- Attempting to save dictionary with key: . Dictionary keys must be of type string.
- Could not create dictionary value for key: /DR. Invalid value.
- Cannot save value for annotation key: /DR. Invalid type.
- Attempting to save dictionary with key: . Dictionary keys must be of type string.
And here is my code:
pdfView.document?.write(to: pdfView.document!.documentURL!)
How to save edited changes in pdf files with PDFKit
?