---
title: "write(to:withOptions:)"
framework: pdfkit
role: symbol
role_heading: Instance Method
path: "pdfkit/pdfdocument/write(to:withoptions:)"
---

# write(to:withOptions:)

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

## Declaration

```swift
func write(to url: URL, withOptions options: [PDFDocumentWriteOption : Any]? = nil) -> Bool
```

## See Also

### Related Documentation

- [dataRepresentation()](pdfkit/pdfdocument/datarepresentation().md)

### Writing Out the PDF Data

- [write(toFile:)](pdfkit/pdfdocument/write(tofile:).md)
- [write(toFile:withOptions:)](pdfkit/pdfdocument/write(tofile:withoptions:).md)
- [write(to:)](pdfkit/pdfdocument/write(to:).md)
- [Data Representations](pdfkit/data-representations.md)
