PDFKit is vertically flipping PDFPage initialised with image

后端 未结 1 1654
刺人心
刺人心 2021-01-06 13:08

Not sure if this is a bug as PDFKit is in Beta on iOS, but when I create a PDFDocument based on an array of images (using PDFPage(image:), it flips the image vertically.

相关标签:
1条回答
  • 2021-01-06 13:35

    One (bad) solution to this bug (?) is to flip the image vertically in advance so it gets flipped back:

    let img = arrayOfImages[i]
    let image = UIImage(cgImage: img.cgImage!, scale: img.scale, orientation: .downMirrored)
    let pdfpage = PDFPage(image: image)
    
    0 讨论(0)
提交回复
热议问题