I tried to get a PDFDocument from a WebView but I only got a part of the Page 🙁
The code I used is this:
//Generate a PDF document from the HTML.
NSData *pdfData = [webView dataWithPDFInsideRect:[webView frame]];
PDFDocument *document = [[PDFDocument alloc] initWithData:pdfData];
[document writeToURL:[NSURL URLWithString:@"file:///Users/tmp/test.pdf"]];
Any idea how to make it better?
1 Answer