關(guān)于“ 微信小程序關(guān)于文件下載問題:PDF如何保存到本地而不是’wx.saveFile’保存到本地緩存,求解決本問題解答,謝謝
”
的推薦:
-
無法使用PDFKit添加圖像并保存到pdf文件
我還必須在
PDFPage
上繪制該圖像,使它們出現(xiàn)在保存的pdf文件中final private class ImagePDFPage: PDFPage { /// A flag indicates whether to draw image on a page /// /// - Note: Set this to `true` before write pdf to file otherwise the image will not be appeared in pdf file var saveImageToPDF: Bool = false private var imageAnnotation: EkoPDFImageAnnotation? = nil func addImageAnnotation(_ annotation: EkoPDFImageAnnotation) { imageAnnotation = annotation addAnnotation(annotation) } func removeImageAnnotation() { guard let imageAnnotation = imageAnnotation else { return } self.imageAnnotation = nil removeAnnotation(imageAnnotation) } override func draw(with box: PDFDisplayBox, to context: CGContext) { super.draw(with: box, to: context) guard saveImageToPDF, let annotation = imageAnnotation, let cgImage = annotation.image?.cgImage else { return } context.draw(cgImage, in: annotation.bounds) } }
并更新
PDFDocument.delegate
,告知使用ImagePDFPage
作為pdf頁面的類extension PDFEditorViewController: PDFDocumentDelegate { func classForPage() -> AnyClass { return ImagePDFPage.self } }
The result
這里已經(jīng)是底線啦~
1
在vue中,如何獲取在組件A通過類似this.$refs中獲取組件B的引用?
2
同時存在lb(nginx)、網(wǎng)關(guān)、后端報務(wù)時,跨域配置在哪一層?
3
兩個矩陣之間的距離
4
Python判斷數(shù)字字符
5
安卓信息轉(zhuǎn)到安卓手機
6
mongoDB 配置好環(huán)境變量后,使用 mongo 命令不能連接是什么原因?
7
json.decoder.JSONDecodeError
8
應(yīng)用程序出現(xiàn)無法處理的線程異常,是否退出
9
前端寫登錄界面時,如何兼容不同瀏覽器的記住賬號與密碼的問題?
10