How to save web page as PDF?
<p>There is a webview in the app and a "Save" button on top of the webview.</p>

<p>After clicking the "Save" button currenturl will be saved to a TableView on another ViewController. Everything works fine. </p>

<p>Now I would like to also save the web page as PDF to the same TableView and can open it after clicking. How can I do that? </p>

<p>The following is codes for saving currenturl. savedURLs is the array to save all urls on another ViewController.</p>

<pre><code>import UIKit

class BrowserViewController: UIViewController {

    @IBOutlet weak var browser: UIWebView!

    @IBAction func saveButtonPressed(sender: AnyObject) {
        if let currentURL = browser.request?.URL?.absoluteString  {
            savedURLs.append(currentURL)
            NSUserDefaults.standardUserDefaults().setObject(currentURL, forKey: "currenturl")
            NSUserDefaults.standardUserDefaults().setObject(savedURLs, forKey: "savedURLs")
            self.performSegueWithIdentifier("toSavingVC", sender: self)
        }
    }
</code></pre>