In my app, I print some images to a pdf using PDFKit. My pdf's are very big because of the size of the images. I looked up how to compress the images to a smaller size so that the PDF wouldn't be so large. The problem is that this compression returns as NSData. NSData has no .draw method though.
Currently I have a UIImage (for example: imageVar)... I simply write: imageVar.draw(in: photoRect) and it prints to the PDF with the dimensions I previously declared.
When I compress the image and then try to print it out: resizedImage.draw(in: photoRect)
it doesn't work. "Value of type 'NSData' has no member 'draw'"
How do I "draw" this compressed image to the PDF???