我想将签名的pdf发送到其他人的电子邮件。我能怎么做?

我的代码:

@objc func handleUploadPDF() {
    let fileURL = Bundle.main.bundleURL.appendingPathComponent("Exhibit-A-SAMPLE-CONTRACT.pdf")
    let writableURL = copyFileURLToDocumentFolder(fileURL)
    let document = PSPDFDocument(url: fileURL)
    let configuration = PSPDFConfiguration { builder in
        builder.thumbnailBarMode = .scrollable
    }

    let pdfController = PDFViewController(document: document, configuration: configuration)
    present(UINavigationController(rootViewController: pdfController), animated: true, completion:nil)

}

最佳答案

确保在emailButtonItem的导航项的右栏按钮项数组中包括pdfViewController,如下所示:

@objc func handleUploadPDF() {
    let fileURL = Bundle.main.bundleURL.appendingPathComponent("Exhibit-A-SAMPLE-CONTRACT.pdf")
    let writableURL = copyFileURLToDocumentFolder(fileURL)
    let document = PSPDFDocument(url: fileURL)
    let configuration = PSPDFConfiguration { builder in
        builder.thumbnailBarMode = .scrollable
    }

    let pdfController = PDFViewController(document: document, configuration: configuration)
    pdfController.navigationItem.setRightBarButtonItems([pdfController.emailButtonItem], animated: false)
    present(UINavigationController(rootViewController: pdfController), animated: true, completion:nil)

}

ios - 如何使用pspdfkit将pdf文件共享到电子邮件?-LMLPHP

有关如何自定义工具栏的更多详细信息,请查看https://pspdfkit.com/guides/ios/current/customizing-the-interface/customizing-the-toolbar/

将来,请访问我们的支持门户,网址为pspdfkit.com/support/request/-我们很乐意在此为我们的商业SDK提供支持。

关于ios - 如何使用pspdfkit将pdf文件共享到电子邮件?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/57177302/

10-13 03:56