<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPrinter/init(name:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPrinter(cm)printerWithName:"
  },
  "title" : "init(name:)"
}
-->

# init(name:)

Creates and returns a printer object initialized with the specified printer name.

```
init?(name: String)
```

## Parameters

`name`

The name of the printer.

## Return Value

An initialized `NSPrinter` object, or `nil` if the specified printer was not available.

## See Also

[`name`](/documentation/AppKit/NSPrinter/name)

The printer’s name.

[`NSPrinter`](/documentation/AppKit/NSPrinter)

An object that describes a printer’s capabilities.

[`printerNames`](/documentation/AppKit/NSPrinter/printerNames)

Returns the names of all available printers.



---

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)