Contents

saveToPDF(_:)

Exports a PDF representation of the document’s current contents.

Declaration

@IBAction func saveToPDF(_ sender: Any?)

Parameters

  • sender:

    The control sending the message.

Discussion

This action method handles the File menu’s “Export As PDF…” item in a document-based application.

The default implementation of this method calls the print(withSettings:showPrintPanel:delegate:didPrint:contextInfo:) method, passing a print settings object that contains only the disposition (save), with user interaction disabled and NULL or nil for all other parameters.

If your document subclass supports creating PDF representations, you can override this method, if needed.

See Also

Printing the Document