<!--
{
  "documentType" : "article",
  "framework" : "PDFKit",
  "identifier" : "/documentation/PDFKit/write-operations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Write Operations"
}
-->

# Write Operations

Operations that let you write document data to different locations.

## Topics

### Writing Out the PDF Data

[`-  writeToFile:`](/documentation/PDFKit/PDFDocument/write(toFile:))

Writes the document to a file at the specified path.

[`-  writeToFile:withOptions:`](/documentation/PDFKit/PDFDocument/write(toFile:withOptions:))

Writes the document to a file at the specified path with the specified options.

[`-  writeToURL:`](/documentation/PDFKit/PDFDocument/write(to:))

Writes the document to a location specified by the passed-in URL.

[`-  writeToURL:withOptions:`](/documentation/PDFKit/PDFDocument/write(to:withOptions:))

Writes the document to the specified URL with the specified options.

[Data Representations](/documentation/PDFKit/data-representations)

Operations to represent PDF documents as data objects.

### Printing Documents for macOS

[`-  printOperationForPrintInfo:scalingMode:autoRotate:`](/documentation/PDFKit/PDFDocument/printOperation(for:scalingMode:autoRotate:))

Returns a print operation suitable for printing the PDF document.

[`PDFPrintScalingMode`](/documentation/PDFKit/PDFPrintScalingMode)

The type of scaling to be used when printing a page (see [`PDFDocument`](/documentation/PDFKit/PDFDocument)).



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)