Saved PDFView with PDFKit IOS not showed properly in Adobe reader

偶尔善良 提交于 2020-02-25 04:33:11

问题


I am creating an app where I open a PDF with form elements, add some data and export it again to a new PDF file. The code to export this file looks like this:

@IBAction func exportPDF(_ sender: Any) {
    guard let url = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first,
          let data = pdfView.document?.dataRepresentation() else {return}

    let fileURL = url.appendingPathComponent("test.pdf")
    do {
        try data.write(to: fileURL, options: .atomicWrite)
        print(fileURL)

    } catch {
        print(error.localizedDescription)
    }
}

Everything is working fine and opening the file in PDF readers looks good as well, but when I am opening the file in Adobe Acrobat (on PC or Mac) the file somehow seems to be corrupted. All formfields are behind the text and I can't edit the form anymore. This is only happening since I updated my Mac to OS Catalina running Xcode 11.2. Is anyone having the same issue?

来源:https://stackoverflow.com/questions/58860015/saved-pdfview-with-pdfkit-ios-not-showed-properly-in-adobe-reader

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!