---
title: "write(toFile:)"
framework: pdfkit
role: symbol
role_heading: Instance Method
path: "pdfkit/pdfdocument/write(tofile:)"
---

# write(toFile:)

Writes the document to a file at the specified path.

## Declaration

```swift
func write(toFile path: String) -> Bool
```

## See Also

### Related Documentation

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

### Writing Out the PDF Data

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