Make a pdf document by image using pdfkit in iOS 16

While we make a pdf using an image file at that we add an image into PDFPage. at that time PDFDocument did not show the original image content in PDFView in iOS 16. I checked the same code which worked properly in iOS 15. For both test cases, I used New Xcode 14, and as well as previously uploaded TestFlight build also worked properly with iOS 15 or below but did not work with iOS 16. So I request to the apple developer who worked on PDFkit please check this case. I may be sure that there is an issue with iOS 16 and I hope apple provides a new iOS 16 sub-version release as soon as possible with includes this bug fix. here is the sample code that I used:-

//Get Array of UIImages

let pdfDocument = PDFDocument() 
for (index,image) in images.enumerated() { 

   // Create a PDF page instance from your image 

   let pdfPage = PDFPage(image: image)

   // Insert the PDF page into your document

   pdfDocument.insert(pdfPage!, at: index) 

}

Original Image:

After convert to PDF

Post not yet marked as solved Up vote post of htibook Down vote post of htibook
2.5k views
  • Having the same problem

  • I have exactly the same issue. Everything works fine until iOS 16. I also use the PDFKit and use PDFDocument to export image. It looks like it may relate to the image format parameters because I found not all the images have the issue. But not sure and not know which parameter. Hope any guy from PDFKit team can check it.

Add a Comment

Replies

Getting the same error