<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PaperKit",
  "identifier" : "/documentation/PaperKit/PaperMarkup",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "PaperKit"
    ],
    "preciseIdentifier" : "s:8PaperKit0A6MarkupV"
  },
  "title" : "PaperMarkup"
}
-->

# PaperMarkup

The data model object for storing markup data created from a `PaperViewController`.

```
struct PaperMarkup
```

## Topics

### Creating markup

[`init(bounds: CGRect)`](/documentation/PaperKit/PaperMarkup/init(bounds:))

Initializes and returns a new paper model with the specified bounds.

[`init(dataRepresentation: Data) throws`](/documentation/PaperKit/PaperMarkup/init(dataRepresentation:))

Initializes and returns a new paper model from the specified data.

### Serializing markup

[`func dataRepresentation() async throws -> Data`](/documentation/PaperKit/PaperMarkup/dataRepresentation())

Generate a serialized data representation of the data model.

### Accessing elements

[`var subelements: MarkupOrderedSet`](/documentation/PaperKit/PaperMarkup/subelements)

The subelements of the paper markup.

[`var id: MarkupID<PaperMarkup>`](/documentation/PaperKit/PaperMarkup/id)

The unique identifier of the markup.

[`var bounds: CGRect`](/documentation/PaperKit/PaperMarkup/bounds)

The bounds of the paper.

[`var contentsRenderFrame: CGRect`](/documentation/PaperKit/PaperMarkup/contentsRenderFrame)

The frame that tightly fits the rendered contents on the paper.

[`var featureSet: FeatureSet`](/documentation/PaperKit/PaperMarkup/featureSet)

The set of features used by this data model.

[`var indexableContent: String?`](/documentation/PaperKit/PaperMarkup/indexableContent)

[`var backgroundColor: CGColor?`](/documentation/PaperKit/PaperMarkup/backgroundColor)

The background color of the paper.

### Rendering markup

[`func draw(in: CGContext, frame: CGRect, options: RenderingOptions) async`](/documentation/PaperKit/PaperMarkup/draw(in:frame:options:))

Draws the entire paper contents in the specified rectangle.

### Appending content

[`func append(contentsOf: PaperMarkup)`](/documentation/PaperKit/PaperMarkup/append(contentsOf:)-5668)

Adds the contents of a data model on top of this paper.

[`func append(contentsOf: PKDrawing)`](/documentation/PaperKit/PaperMarkup/append(contentsOf:)-5tgti)

Adds the contents of a PencilKit drawing on top of this paper.

### Transforming content

[`func transformContent(CGAffineTransform)`](/documentation/PaperKit/PaperMarkup/transformContent(_:))

Transforms the contents of this paper with the specified transform.

### Inserting elements

[`func insertNewShape(configuration: ShapeConfiguration, frame: CGRect, rotation: CGFloat)`](/documentation/PaperKit/PaperMarkup/insertNewShape(configuration:frame:rotation:))

Add a new element on top of the paper.

[`func insertNewImage(CGImage, frame: CGRect, rotation: CGFloat)`](/documentation/PaperKit/PaperMarkup/insertNewImage(_:frame:rotation:))

Add a new image on top of the paper.

[`func insertNewLine(configuration: ShapeConfiguration, from: CGPoint, to: CGPoint, startMarker: Bool, endMarker: Bool)`](/documentation/PaperKit/PaperMarkup/insertNewLine(configuration:from:to:startMarker:endMarker:))

Add a line element on top of the paper.

[`func insertNewTextbox(attributedText: AttributedString, frame: CGRect, rotation: CGFloat)`](/documentation/PaperKit/PaperMarkup/insertNewTextbox(attributedText:frame:rotation:)-53rs)

Add a new text box on top of the paper.

[`func insertNewTextbox(attributedText: NSAttributedString, frame: CGRect, rotation: CGFloat)`](/documentation/PaperKit/PaperMarkup/insertNewTextbox(attributedText:frame:rotation:)-67igk)

Add a new text box on top of the paper.

### Removing content

[`func removeContentUnsupported(by: FeatureSet)`](/documentation/PaperKit/PaperMarkup/removeContentUnsupported(by:))

Remove all contents that is not supported by the provided feature set.

### Default Implementations

[Identifiable Implementations](/documentation/PaperKit/PaperMarkup/Identifiable-Implementations)

## Relationships

### Conforms To

[`Copyable`](/documentation/Swift/Copyable)

[`Equatable`](/documentation/Swift/Equatable)

[`Identifiable`](/documentation/Swift/Identifiable)

[`Escapable`](/documentation/Swift/Escapable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

---

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)