How to print a full uicollectionview to an image or a pdf
<p>everyone!</p>

<p>I'm working in Swift 3, but if there is no solution in Swift 3 I would be willing to work in Swift 2.</p>

<p>I have a UICollectionView and a UIImageView that is contained in a UIView along with an image (and all this is contained in a UIScrollView, which means a lot of content is off-screen). The app I'm making will be useless if I can't figure out how to print out the contents of the UIView (or at the very least the UICollectionView) with the full content of the UICollectionView and the UIImageView. </p>

<p>I've been researching for a day and came up with the resources I will list below, but I still can't figure out how to accomplish my goal. Does anyone have any advice for me?</p>

<p>A possible alternative to printing out the Collection View would be to create a PDF or Image with the <em>information</em> contained within the collection view (one image and 3 labels per cell) without necessarily printing the collection view itself. If you can point out a way to do that, that would be equally helpful.</p>

<p>Thank you for your time!</p>

<p>My research results: (stack overflow wont let me post more than two links, so forgive the chopped up links)
Apple documentation: (I can't make sense of this yet, but I'm trying to figure it out.)
<a href="https://developer" rel="nofollow noreferrer">https://developer</a>. apple .com /library/ios/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GeneratingPDF/GeneratingPDF.html</p>

<p>Crazy repository of frameworks, including pdf generators:
github. com /vsouza/awesome-ios#pdf</p>

<p>How to convert a UIView to an image using swift: (I can't tell if this will take a screenshot of just what's on the page, or if it will take a screenshot of the whole view.)
<a href="https://stackoverflow.com/questions/30696307/how-to-convert-a-uiview-to-a-image">How to convert a UIview to a image</a></p>

<p>Apple function documentation: (This is a supplement to the above stackoverflow questions link.)
developer. apple. com/library/ios/documentation/UIKit/Reference/UIKitFunctionReference/#//apple_ref/c/func/UIGraphicsGetImageFromCurrentImageContext</p>

<p>PDFGenerator: (This has the most potential, but I can't figure out how to use it yet.)
<a href="https://github.com/sgr-ksmt/PDFGenerator" rel="nofollow noreferrer">https://github.com/sgr-ksmt/PDFGenerator</a></p>