---
title: pdf417BarcodeGenerator()
framework: coreimage
role: symbol
role_heading: Type Method
path: coreimage/cifilter-swift.class/pdf417barcodegenerator()
---

# pdf417BarcodeGenerator()

Generates a high-density linear barcode.

## Declaration

```swift
class func pdf417BarcodeGenerator() -> any CIFilter & CIPDF417BarcodeGenerator
```

## Return Value

Return Value The generated image.

## Discussion

Discussion This method generates a PDF417 barcode as an image. PDF417 is a high-density stacked linear barcode format defined in the ISO 15438 standard. Use this filter to generate alphanumeric or numeric-only barcodes. Commonly used on identification cards or inventory management because of the large amount of data the barcode can hold. The PDF417 barcode generator filter uses the following properties: The compactionMode property takes one of the following numeric values:  |  |   |  |   |  |   |  |   |  |  Select either 1 or the appropriate valid value for your data that gives the most compact output. The following code creates a filter that generates a PDF417 barcode: func pdf417Barcode(inputMessage: String) -> CIImage {     let pdf417BarcodeGenerator = CIFilter.pdf417BarcodeGenerator()     pdf417BarcodeGenerator.message = inputMessage.data(using: .ascii)!     pdf417BarcodeGenerator.minWidth = 56     pdf417BarcodeGenerator.maxWidth = 58     pdf417BarcodeGenerator.maxHeight = 283     pdf417BarcodeGenerator.minHeight = 13     pdf417BarcodeGenerator.dataColumns = 9     pdf417BarcodeGenerator.rows = 6     pdf417BarcodeGenerator.preferredAspectRatio = 0.0     pdf417BarcodeGenerator.compactionMode = 1     pdf417BarcodeGenerator.compactStyle = 1     pdf417BarcodeGenerator.correctionLevel = 0.01     pdf417BarcodeGenerator.alwaysSpecifyCompaction = 0     return pdf417BarcodeGenerator.outputImage! }

## See Also

### Filters

- [attributedTextImageGenerator()](coreimage/cifilter-swift.class/attributedtextimagegenerator().md)
- [aztecCodeGenerator()](coreimage/cifilter-swift.class/azteccodegenerator().md)
- [barcodeGenerator()](coreimage/cifilter-swift.class/barcodegenerator().md)
- [blurredRectangleGenerator()](coreimage/cifilter-swift.class/blurredrectanglegenerator().md)
- [checkerboardGenerator()](coreimage/cifilter-swift.class/checkerboardgenerator().md)
- [code128BarcodeGenerator()](coreimage/cifilter-swift.class/code128barcodegenerator().md)
- [lenticularHaloGenerator()](coreimage/cifilter-swift.class/lenticularhalogenerator().md)
- [meshGenerator()](coreimage/cifilter-swift.class/meshgenerator().md)
- [qrCodeGenerator()](coreimage/cifilter-swift.class/qrcodegenerator().md)
- [randomGenerator()](coreimage/cifilter-swift.class/randomgenerator().md)
- [roundedRectangleGenerator()](coreimage/cifilter-swift.class/roundedrectanglegenerator().md)
- [roundedRectangleStrokeGenerator()](coreimage/cifilter-swift.class/roundedrectanglestrokegenerator().md)
- [starShineGenerator()](coreimage/cifilter-swift.class/starshinegenerator().md)
- [stripesGenerator()](coreimage/cifilter-swift.class/stripesgenerator().md)
- [sunbeamsGenerator()](coreimage/cifilter-swift.class/sunbeamsgenerator().md)
