<!--
{
  "availability" : [
    "iOS: 13.4.0 -",
    "iPadOS: 13.4.0 -",
    "macCatalyst: 13.4.0 -",
    "macOS: 10.15.4 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "WebKit",
  "identifier" : "/documentation/WebKit/WKPDFConfiguration",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "WebKit"
    ],
    "preciseIdentifier" : "c:objc(cs)WKPDFConfiguration"
  },
  "title" : "WKPDFConfiguration"
}
-->

# WKPDFConfiguration

The configuration data to use when generating a PDF representation of a web view’s contents.

```
@MainActor class WKPDFConfiguration
```

## Overview

Create a [`WKPDFConfiguration`](/documentation/WebKit/WKPDFConfiguration) object when you want to generate a PDF version of your web view’s content. Use this object to specify the portion of the web view to capture. To generate the PDF content, pass the configuration object to the [`createPDF(configuration:completionHandler:)`](/documentation/WebKit/WKWebView/createPDF(configuration:completionHandler:)) method of [`WKWebView`](/documentation/WebKit/WKWebView), which returns the PDF data for you to use.

## Topics

### Specifying the snapshot dimensions

[`rect`](/documentation/WebKit/WKPDFConfiguration/rect-2a0vp)

The portion of your web view to capture, specified as a rectangle in the view’s coordinate system.

[`rect`](/documentation/WebKit/WKPDFConfiguration/rect-3xww9)

The portion of your web view to capture, specified as a rectangle in the view’s coordinate system.

### Specifying snapshot properties

[`allowTransparentBackground`](/documentation/WebKit/WKPDFConfiguration/allowTransparentBackground)

A Boolean value that indicates whether the PDF may have a transparent background.



---

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)