---
title: "exported(as:)"
framework: webkit
role: symbol
role_heading: Instance Method
path: "webkit/webpage/exported(as:)"
---

# exported(as:)

Using the type’s Transferable conformance implementation, exports a value as binary data, optionally with a specified configuration for that type of data.

## Declaration

```swift
nonisolated final func exported(as representation: WebPage.ExportedContentConfiguration) async throws -> Data
```

## Parameters

- `representation`: A configuration for a representation for a specific type of data with optional customizable properties.

## Return Value

Return Value The data with the specified representation type.

## Discussion

Discussion For example, you can export a 100 pt by 100 pt region of a webpage as a PDF, and allow it to have a transparent background: let page = WebPage() // Load web content and wait for navigation to complete.

let square = CGRect(x: 0, y: 0, width: 100, height: 100) let pdf = try await page.exported(as: .pdf(region: .rect(square), allowTransparentBackground: true)) If no configuration is needed, use the Transferable conformance of WebPage directly: let page = WebPage() // Load web content and wait for navigation to complete.

let pdf = try await page.exported(as: .pdf) note: An error if the specified representation cannot be created from the page.

## See Also

### Exporting webpage content

- [WebPage.ExportedContentConfiguration](webkit/webpage/exportedcontentconfiguration.md)
