My application has a table view with custom cells (including a text box, shortcut and button), I want to generate a PDF file from a table.
Below is the code (now suppose the contents of the table are viewed):
UIGraphicsBeginImageContext(self._tableView.bounds.size);
UIGraphicsBeginPDFPageWithInfo(CGRectMake(0, 0, self._tableView.bounds.size.width, self._tableView.bounds.size.height), nil);
UIGraphicsEndPDFContext();
I always create an empty PDF file. I am currently creating a tableview view as an image, then drawing the image in the current context, and then getting the pdf file. but any good idea?
source
share