Instance Method

saveDocumentToPDF:

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

Declaration

- (IBAction)saveDocumentToPDF:(id)sender;

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 printDocumentWithSettings:showPrintPanel:delegate:didPrintSelector:contextInfo: method, passing a print settings object that contains only the disposition (NSPrintSaveJob), 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 Documents

printInfo

The printing information associated with the document.

- preparePageLayout:

Invoked by runModalPageLayoutWithPrintInfo: and runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo: to do any customization of the Page Layout panel pageLayout, such as adding an accessory view.

- runModalPageLayoutWithPrintInfo:delegate:didRunSelector:contextInfo:

Runs the modal page layout panel with the receiver’s printing information object

- runModalPrintOperation:delegate:didRunSelector:contextInfo:

Runs the specified print operation modally.

- shouldChangePrintInfo:

Returns a Boolean value indicating whether the receiver should allow changes to the default NSPrintInfo object used in printing the document.

- printOperationWithSettings:error:

Creates a print operation and returns it if successful.

PDFPrintOperation

A print operation that you can use to create a PDF representation of the document’s current contents.