<!--
{
  "availability" : [
    "iOS: 4.2.0 -",
    "iPadOS: 4.2.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPrintInteractionController/canPrint(_:)-4e0bs",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIPrintInteractionController(cm)canPrintData:"
  },
  "title" : "canPrint(_:)"
}
-->

# canPrint(_:)

Returns a Boolean value that indicates whether UIKit can print the contents of a data object.

```
class func canPrint(_ data: Data) -> Bool
```

## Parameters

`data`

An instance of the <doc://com.apple.documentation/documentation/Foundation/NSData> class that contains PDF data or an image in a format supported by the Image I/O framework. See [View Programming Guide for iOS](https://developer.apple.com/library/archive/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009503) in [View Programming Guide for iOS](https://developer.apple.com/library/archive/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009503) for a list of the supported image formats.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if UIKit can print the contents of the data object, otherwise <doc://com.apple.documentation/documentation/Swift/false>. The method returns <doc://com.apple.documentation/documentation/Swift/false> if `data` is PDF data that specifies that printing is not allowed.

## Discussion

You should call this method to test a data object prior to assigning it to [`printingItem`](/documentation/UIKit/UIPrintInteractionController/printingItem) or [`printingItems`](/documentation/UIKit/UIPrintInteractionController/printingItems).

---

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)