---
title: "canPrint(_:)"
framework: uikit
role: symbol
role_heading: Type Method
path: "uikit/uiprintinteractioncontroller/canprint(_:)-364vj"
---

# canPrint(_:)

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

## Declaration

```swift
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 https://developer.apple.com/library/archive/documentation/WindowsViews/Conceptual/ViewPG_iPhoneOS/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009503 in 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

Return Value true if UIKit can print the contents of the referenced file, otherwise false. The method returns false if url references PDF data that specifies that printing is not allowed.

## Discussion

Discussion You should call this method to test the data referenced by a URL prior to assigning that URL to printingItem or printingItems.

## See Also

### Determining printability

- [isPrintingAvailable](uikit/uiprintinteractioncontroller/isprintingavailable.md)
- [canPrint(_:)](uikit/uiprintinteractioncontroller/canprint(_:)-4e0bs.md)
- [printableUTIs](uikit/uiprintinteractioncontroller/printableutis.md)
