title: iOS create pdf from UIWebview content
body: <p>In my app for iOS i need to create a pdf document from my webview content. I watched these posts: <a href="https://stackoverflow.com/questions/15813005/creating-pdf-file-from-uiwebview">Creating PDF file from UIWebView</a> and <a href="https://coderchrismills.wordpress.com/2011/06/25/making-a-pdf-from-a-uiwebview/" rel="nofollow noreferrer">https://coderchrismills.wordpress.com/2011/06/25/making-a-pdf-from-a-uiwebview/</a></p>
  
  <p>I wonder if there is a simpler way to do it. For example for my project for Mac i use this:</p>
  
  <pre><code>NSData *pdf = [[[[webView mainFrame] frameView] documentView] dataWithPDFInsideRect:[[[webView mainFrame] frameView] documentView].frame];
  PDFDocument *doc = [[PDFDocument alloc] initWithData:pdf];
  </code></pre>
  
  <p>Is there any simple way to do this in iOS? </p>
  
  <p>Which is the best option to obtain best quality pdf document from a webview content?</p>