【问题标题】:Want to print uitableview to pdf想把uitableview打印成pdf
【发布时间】:2016-09-24 01:41:57
【问题描述】:

无法预览 pdf 文件。

 dispatch_async(dispatch_get_main_queue(), { () -> Void in
            let pdfURL = NSURL(fileURLWithPath: NSHomeDirectory().stringByAppendingString("/sample1.pdf"))
            let interactionController = UIDocumentInteractionController(URL: pdfURL)
            interactionController.delegate = self
            interactionController.presentPreviewAnimated(true)
        })

它打开 pdf 但没有可用的预览,它在模拟器上运行完美。

【问题讨论】:

    标签: ios swift pdf-generation


    【解决方案1】:

    如果文件是在线存储的,并且您有文件的 url,您可以使用 google 文档显示文件,请使用此链接

    http://docs.google.com/gview?embedded=true&url=URL_TO_THE_FILE

    并使用 WebView 来显示它。

    希望答案有所帮助。

    【讨论】:

      猜你喜欢
      • 2010-10-29
      • 2011-05-31
      • 2011-07-10
      • 1970-01-01
      • 1970-01-01
      • 2011-05-27
      • 1970-01-01
      • 1970-01-01
      • 2023-03-06
      相关资源
      最近更新 更多