<!--
{
  "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(_:)-364vj",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIPrintInteractionController(cm)canPrintURL:"
  },
  "title" : "canPrint(_:)"
}
-->

# canPrint(_:)

Returns a Boolean value that indicates whether UIKit can print the file that the specified URL references.

```
class func canPrint(_ url: URL) -> Bool
```

## Parameters

`url`

An object representing a URL. Valid `NSURL` objects must use the `file:` or any scheme that can return an <doc://com.apple.documentation/documentation/Foundation/NSData> object with a registered protocol. The file referenced by the URL must contain 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 referenced file, otherwise <doc://com.apple.documentation/documentation/Swift/false>. The method returns <doc://com.apple.documentation/documentation/Swift/false> if `url` references PDF data that specifies that printing is not allowed.

## Discussion

You should call this method to test the data referenced by a URL prior to assigning that URL 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)