---
title: "Programatically create PDF annotations in Swift for iOS"
canonical_url: "https://www.nutrient.io/guides/ios/samples/add-annotations-to-pdf-programmatically/"
md_url: "https://www.nutrient.io/guides/ios/samples/add-annotations-to-pdf-programmatically.md"
last_updated: "2026-06-08T09:14:14.409Z"
description: "Learn how to add Ink Annotations in iOS using Swift. Visit our guide for more resources on programmatically creating PDF annotations."
---

# Programatically create PDF annotations in Swift for iOS

Add an Ink Annotation in code. Get additional resources by visiting our guide on [programmatically creating PDF annotations in iOS](/guides/ios/annotations/programmatically-creating-annotations.md).

[Get Started](https://www.nutrient.io/sdk/ios/getting-started.md)

[All Samples](https://www.nutrient.io/guides/ios/samples.md)

[Download](https://www.nutrient.io/guides/ios/downloads.md)

[Launch Demo](https://www.nutrient.io/demo/)

---

```swift

//
//  Copyright © 2017-2026 PSPDFKit GmbH. All rights reserved.
//
//  The Nutrient sample applications are licensed with a modified BSD license.
//  Please see License for details. This notice may not be removed from this file.
//

import PSPDFKit
import PSPDFKitUI

class AddInkAnnotationProgrammaticallyExample: Example {

    override init() {
        super.init()

        title = "Add Ink Annotation"
        category =.annotations
        priority = 10
    }

    override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController? {
        let document = AssetLoader.document(for:.annualReport)
        document.annotationSaveMode =.disabled

        // add ink annotation if there isn't one already.
        let targetPage: PageIndex = 0
        let annotation = InkAnnotation()

        // example how to create a line rect.
        let lines = [
            [CGPoint(x: 100, y: 100), CGPoint(x: 100, y: 200), CGPoint(x: 150, y: 300)],     // first line
            [CGPoint(x: 200, y: 100), CGPoint(x: 200, y: 200), CGPoint(x: 250, y: 300)]
        ]

        // convert view line points into PDF line points.
        let pageInfo = document.pageInfoForPage(at: targetPage)!

        let viewRect = delegate.currentViewController!.view.bounds // this is your drawing view rect - we don't have one yet, so lets just assume the whole screen for this example. You can also directly write the points in PDF coordinate space, then you don't need to convert, but usually your user draws and you need to convert the points afterwards.
        annotation.lineWidth = 5
        annotation.lines = ConvertToPDFLines(viewLines: lines, pageInfo: pageInfo, viewBounds: viewRect)

        annotation.color = UIColor(red: 0.667, green: 0.279, blue: 0.748, alpha: 1)
        annotation.pageIndex = targetPage
        document.add(annotations: [annotation])

        let controller = PDFViewController(document: document)
        return controller
    }
}

class AddHighlightAnnotationProgrammaticallyExample: Example {

    override init() {
        super.init()

        title = "Add Highlight Annotations"
        category =.annotations
        priority = 20
    }

    override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController? {
        let document = AssetLoader.document(for:.annualReport)
        document.annotationSaveMode =.disabled

        // Let's create a highlight for all occurrences of "Business".
        var annotationCounter = 0
        for pageIndex: PageIndex in 0..<document.pageCount {
            guard let textParser = document.textParserForPage(at: pageIndex) else { continue }
            for word in textParser.words where word.stringValue == "Business" {
                guard let range = Range<Int>(word.range) else {
                    continue
                }
                let annotation = HighlightAnnotation.textOverlayAnnotation(with: [Glyph](textParser.glyphs[range]))!
                annotation.color =.orange
                annotation.contents = "This is an automatically created highlight #\(annotationCounter)"

                annotation.pageIndex = pageIndex

                document.add(annotations: [annotation])
                annotationCounter += 1
            }
        }

        // Highlight an entire text selection on the second page, in yellow.
        let pageIndex: PageIndex = 1
        // Text selection rect in PDF coordinates for the first paragraph of the second page.
        let textSelectionRect = CGRect(x: 36, y: 547, width: 238, height: 135)
        let glyphs = document.objects(atPDFRect: textSelectionRect, pageIndex: pageIndex, options: [.extractGlyphs: true as NSNumber])[.glyphs] as! [Glyph]
        let annotation = HighlightAnnotation.textOverlayAnnotation(with: glyphs)!
        annotation.color = UIColor.yellow
        annotation.contents = "This is an automatically created highlight #\(annotationCounter)"

        annotation.pageIndex = pageIndex
        document.add(annotations: [annotation])

        let controller = PDFViewController(document: document)
        controller.pageIndex = pageIndex
        return controller
    }
}

class AddNoteAnnotationProgrammaticallyExample: Example {

    override init() {
        super.init()

        title = "Add Note Annotation"
        category =.annotations
        priority = 30
    }

    override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController? {
        let documentURL = AssetLoader.assetURL(for:.annualReport)
        let data = try? Data(contentsOf: documentURL, options:.mappedIfSafe)

        // we use a NSData document here but it'll work even better with a file-based variant.
        let document = Document(dataProviders: [DataContainerProvider(data: data!)])
        document.annotationSaveMode =.disabled
        document.title = "Programmatically create annotations"

        var annotations = [Annotation]()
        let maxHeight = document.pageInfoForPage(at: 0)!.size.height
        for i in 0...4 {
            let noteAnnotation = NoteAnnotation()
            // width/height will be ignored for note annotations.
            noteAnnotation.boundingBox = CGRect(x: 100, y: (50 + CGFloat(i) * CGFloat(maxHeight / 5)), width: 32, height: 32)
            noteAnnotation.contents = "Note #\(5 - i)"

            annotations.append(noteAnnotation)
        }
        document.add(annotations: annotations)

        let pdfController = PDFViewController(document: document)
        return pdfController
    }
}

class AddPolyLineAnnotationProgrammaticallyExample: Example {

    override init() {
        super.init()

        title = "Add PolyLine Annotation"
        category =.annotations
        priority = 40
    }

    override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController? {
        let document = AssetLoader.document(for:.annualReport)
        document.annotationSaveMode =.disabled

        // Add shape annotation if there isn't one already.
        let pageIndex: PageIndex = 0
        let polyLines = document.annotationsForPage(at: pageIndex, type:.polyLine)
        if polyLines.isEmpty {
            let polyLine = PolyLineAnnotation()
            polyLine.points = [CGPoint(x: 152, y: 333), CGPoint(x: 167, y: 372), CGPoint(x: 231, y: 385), CGPoint(x: 278, y: 354), CGPoint(x: 215, y: 322)]
            polyLine.color = UIColor(red: 0, green: 1, blue: 0, alpha: 1)
            polyLine.fillColor =.yellow
            polyLine.lineEnd2 =.closedArrow
            polyLine.lineWidth = 5
            polyLine.pageIndex = pageIndex
            document.add(annotations: [polyLine])
        }

        let controller = PDFViewController(document: document)
        controller.navigationItem.setRightBarButtonItems([controller.thumbnailsButtonItem, controller.outlineButtonItem, controller.openInButtonItem, controller.searchButtonItem], for:.document, animated: false)
        return controller
    }
}

class AddShapeAnnotationProgrammaticallyExample: Example {

    override init() {
        super.init()

        title = "Add Shape Annotation"
        category =.annotations
        priority = 50
    }

    override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController? {
        let document = AssetLoader.document(for:.annualReport)
        document.annotationSaveMode =.disabled

        // add shape annotation if there isn't one already.
        let pageIndex: PageIndex = 0
        let squares = document.annotationsForPage(at: pageIndex, type:.square)
        if squares.isEmpty {
            let annotation = SquareAnnotation()
            annotation.boundingBox = CGRect(origin:.zero, size: document.pageInfoForPage(at: pageIndex)!.size).insetBy(dx: 100, dy: 100)
            annotation.color = UIColor(red: 0, green: 100 / 255, blue: 0, alpha: 1)
            annotation.fillColor = annotation.color
            annotation.alpha = 0.5
            annotation.pageIndex = pageIndex

            document.add(annotations: [annotation])
        }

        let controller = PDFViewController(document: document) {
            $0.isTextSelectionEnabled = false
        }
        controller.navigationItem.setRightBarButtonItems([controller.thumbnailsButtonItem, controller.openInButtonItem, controller.searchButtonItem], for:.document, animated: false)
        return controller
    }
}

class AddVectorStampAnnotationProgrammaticallyExample: Example {

    override init() {
        super.init()

        title = "Add Vector Stamp Annotation"
        category =.annotations
        priority = 60
    }

    override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController? {
        let document = AssetLoader.writableDocument(for:.welcome, overrideIfExists: false)

        let logoURL = AssetLoader.assetURL(for: "PSPDFKit Logo.pdf")

        // Add stamp annotation if there isn't one already.
        let pageIndex: PageIndex = 0
        let stamps = document.annotationsForPage(at: pageIndex, type:.stamp)
        if stamps.isEmpty {
            // Add a transparent stamp annotation using the appearance stream generator.
            let stampAnnotation = StampAnnotation()
            stampAnnotation.boundingBox = CGRect(x: 180.0, y: 150.0, width: 444.0, height: 500.0)
            stampAnnotation.appearanceStreamGenerator = FileAppearanceStreamGenerator(fileURL: logoURL)
            stampAnnotation.pageIndex = pageIndex
            document.add(annotations: [stampAnnotation])
        }
        let pdfController = PDFViewController(document: document)
        return pdfController
    }
}

class AddFileAnnotationProgrammaticallyExample: Example {

    override init() {
        super.init()

        title = "Add File Annotation With Embedded File"
        category =.annotations
        priority = 70
    }

    override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController? {
        let document = AssetLoader.writableDocument(for:.welcome, overrideIfExists: false)
        let embeddedFileURL = AssetLoader.assetURL(for: "PSPDFKit Logo.pdf")

        // Add file annotation if there isn't one already.
        let pageIndex: PageIndex = 0
        let fileAnnotations = document.annotationsForPage(at: pageIndex, type:.file)
        if fileAnnotations.isEmpty {
            // Create a file annotation.
            let fileAnnotation = FileAnnotation()
            fileAnnotation.pageIndex = pageIndex
            fileAnnotation.iconName =.graph
            fileAnnotation.color =.blue
            fileAnnotation.boundingBox = CGRect(x: 500, y: 250, width: 32, height: 32)

            // Create an embedded file and add it to the file annotation.
            let embeddedFile = EmbeddedFile(fileURL: embeddedFileURL, fileDescription: "PSPDFKit")
            fileAnnotation.embeddedFile = embeddedFile
            document.add(annotations: [fileAnnotation])
        }
        let pdfController = PDFViewController(document: document)
        return pdfController
    }
}

class AddFreeTextAnnotationProgrammaticallyExample: Example, PDFViewControllerDelegate {

    var controller: PDFViewController?

    override init() {
        super.init()

        title = "Create Text Annotation When Tapping Whitespace"
        category =.annotations
    }

    override func invoke(with delegate: ExampleRunnerDelegate) -> UIViewController? {
        let document = AssetLoader.writableDocument(for:.annualReport, overrideIfExists: false)
        controller = PDFViewController(document: document)

        // Setup a tap gesture recognizer.
        let gestureRecognizer = UITapGestureRecognizer()
        gestureRecognizer.addTarget(self, action: #selector(tapGestureRecognizerDidChangeState))

        // Make it work simultaneously with all built-in interaction components.
        controller?.interactions.allInteractions.allowSimultaneousRecognition(with: gestureRecognizer)

        // Setup the failure requirement for the annotation selection component.
        if let selectAnnotationComponent = controller?.interactions.selectAnnotation {
            gestureRecognizer.require(toFail: selectAnnotationComponent)
        }

        // Setup the failure requirement for the annotation deselection component.
        if let deselectAnnotationComponent = controller?.interactions.deselectAnnotation {
            gestureRecognizer.require(toFail: deselectAnnotationComponent)
        }

        // Add your gesture recognizer to the document view controller's view.
        controller?.view.addGestureRecognizer(gestureRecognizer)

        return controller
    }

    @objc func tapGestureRecognizerDidChangeState(_ gestureRecognizer: UITapGestureRecognizer) {
        guard gestureRecognizer.state ==.ended,
              let documentViewController = controller?.documentViewController,
              let pageView = documentViewController.visiblePageView(at: gestureRecognizer.location(in: documentViewController.view)),
              let document = controller?.document,
              let textParser = document.textParserForPage(at: pageView.pageIndex)
        else {
            return
        }

        /*
         We only want to allow taps on whitespace to have an effect, and a touch covers a size. So we
         give the touch a finite size, and see if any of the text blocks on this page intersect.
         If that’s the case, we’re not dealing with whitespace, and therefore should not create a new
         annotation.
         */
        let viewPoint = gestureRecognizer.location(in: pageView)
        let touchSize = CGSize(width: 10, height: 10)
        let touchArea = CGRect(origin: CGPoint(x: viewPoint.x - touchSize.width / 2, y: viewPoint.y - touchSize.height / 2), size: touchSize)

        // Do not forget to convert to PDF coordinates, because that’s where the interesting stuff happens
        let pdfArea = pageView.convert(touchArea, to: pageView.pdfCoordinateSpace)
        if textParser.textBlocks.contains(where: { $0.frame.intersects(pdfArea) }) {
            return
        }

        // Now that we know we aren’t tapping on text, let’s make a new annotation at that point…
        let freeTextAnnotation = FreeTextAnnotation()
        freeTextAnnotation.pageIndex = pageView.pageIndex
        let pdfPoint = pageView.convert(viewPoint, to: pageView.pdfCoordinateSpace)
        freeTextAnnotation.textBoundingBox = CGRect(origin: pdfPoint, size: CGSize(width: 20, height: 20))

        // …style it appropriately and add it to the document
        let styleManager = SDK.shared.styleManager
        styleManager.lastUsedStyle(forKey:.init(tool:.freeText))?.apply(to: freeTextAnnotation)
        document.add(annotations: [freeTextAnnotation])

        /*
         After adding the annotation to the document, select it, grab the annotation view, and tell
         it to begin editing, so that the keyboard comes up. The way we set up the PDFViewController,
         we know that the view returned by `annotationView(for:)` is a `FreeTextAnnotationView`.
         Depending on your configuration, this need not be the case.
         */
        pageView.selectedAnnotations = [freeTextAnnotation]
        let annotationView = pageView.annotationView(for: freeTextAnnotation) as! FreeTextAnnotationView
        annotationView.beginEditing()
    }
}

```

This code sample is an example that illustrates how to use our SDK. Please adapt it to your specific use case.

---

## Related pages

- [Allow freeform image annotation resizing in Swift for iOS](/guides/ios/samples/freeform-image-resize.md)
- [Creating effective link annotations on iOS](/guides/ios/samples/annotations.md)
- [Add file annotation to PDF in Swift for iOS](/guides/ios/samples/add-file-annotation-with-embedded-file.md)
- [Image annotations in Swift for iOS](/guides/ios/samples/annotate-images.md)
- [Add an Apple Maps widget to a PDF page in Swift for iOS](/guides/ios/samples/add-map-widget-to-pdf.md)
- [Add video annotation to PDF in Swift for iOS](/guides/ios/samples/add-video-annotation-to-pdf.md)
- [Add annotation buttons to PDF toolbar in Swift for iOS](/guides/ios/samples/annotation-buttons-in-navigation-bar.md)
- [Create an always-dark annotation toolbar in Swift for iOS](/guides/ios/samples/always-dark-annotation-toolbar.md)
- [Create a custom appearance stream generator in Swift for iOS](/guides/ios/samples/appearance-stream-generator.md)
- [Select PDF text and create a note in Swift for iOS](/guides/ios/samples/create-note-from-selection.md)
- [Maintain annotation aspect ratio in Swift](/guides/ios/samples/aspect-ratio-conserving-resizing.md)
- [Write PDF annotations to XFDF in Swift for iOS](/guides/ios/samples/annotations-to-xfdf.md)
- [Embed Nutrient as a child view controller in Swift for iOS](/guides/ios/samples/child-view-controller-using-parent-navigation-bar.md)
- [PDFViewController controller state in Swift for iOS](/guides/ios/samples/controller-state.md)
- [Enable auto-save in PDF using Swift for iOS](/guides/ios/samples/auto-saving-pdf.md)
- [Blur PDF page in Swift for iOS](/guides/ios/samples/blur-pdf-pages.md)
- [Create link annotations in PDF using Swift for iOS](/guides/ios/samples/create-link-annotation-in-pdf.md)
- [Create PDF bookmark with UI in Swift for iOS](/guides/ios/samples/create-pdf-bookmark-name-ui.md)
- [Custom PDF stamp annotation in Swift for iOS](/guides/ios/samples/custom-pdf-stamp-annotations.md)
- [Add custom font sizes to free text keyboard in Swift for iOS](/guides/ios/samples/custom-buttons-free-text-keyboard-toolbar.md)
- [Customize blend modes in stamp annotations in Swift for iOS](/guides/ios/samples/annotation-inspector-stamp-blend-mode.md)
- [Add a custom free text input accessory in Swift for iOS](/guides/ios/samples/custom-free-text-input-accessory.md)
- [Create password-protected PDF in Swift for iOS](/guides/ios/samples/create-password-protected-pdf.md)
- [Custom Comments Ui](/guides/ios/samples/custom-comments-ui.md)
- [Customize PDF tab titles in Swift for iOS](/guides/ios/samples/custom-tabbed-bar-title.md)
- [Customize PDF annotation toolbar in Swift for iOS](/guides/ios/samples/customize-pdf-annotation-toolbar.md)
- [Customize PDF sharing options in Swift for iOS](/guides/ios/samples/custom-pdf-sharing-options.md)
- [Custom thumbnail PDF view filter in Swift for iOS](/guides/ios/samples/custom-thumbnail-view-controller-filter.md)
- [Customize pencil interactions on PDF using Swift for iOS](/guides/ios/samples/custom-pencil-interaction-action.md)
- [Customize PDF outline in Swift for iOS](/guides/ios/samples/custom-pdf-outline-controller.md)
- [Customize the search result cell in Swift for iOS](/guides/ios/samples/custom-search-result-cell.md)
- [Customize the PDF search highlight color in Swift for iOS](/guides/ios/samples/custom-search-highlight-color.md)
- [Disable bookmark editing in PDF using Swift for iOS](/guides/ios/samples/disable-bookmark-editing.md)
- [Present a confirmation sheet for iOS annotations](/guides/ios/samples/confirm-annotation-deletion.md)
- [Continiously create free text annotations in Swift for iOS](/guides/ios/samples/create-free-text-annotations-continuously.md)
- [Add calculator to PDF using JavaScript on iOS](/guides/ios/samples/calculator.md)
- [Customize the filename of shared PDF in Swift for iOS](/guides/ios/samples/custom-sharing-filenames.md)
- [Disable annotations reviews in PDF using Swift for iOS](/guides/ios/samples/disable-annotation-reviews.md)
- [Customized note annotation view controller in Swift for iOS](/guides/ios/samples/customized-note-annotation-view-controller.md)
- [How to disable digital signature removal in PDFs](/guides/ios/samples/disable-removing-digital-signature.md)
- [Use a custom image picker controller in Swift for iOS](/guides/ios/samples/custom-image-picker-controller.md)
- [Custom Thumbnail Page Label](/guides/ios/samples/custom-thumbnail-page-label.md)
- [Implement a Document Picker sidebar in Swift for iOS](/guides/ios/samples/document-picker-sidebar.md)
- [Initialize a PDF with data in Swift for iOS](/guides/ios/samples/document-data-provider-pdf-from-data.md)
- [Disable scroll bouncing in PDF using Swift for iOS](/guides/ios/samples/disable-scroll-bouncing.md)
- [Asynchronously sign PDF in Swift for iOS](/guides/ios/samples/asynchronous-digital-signature-in-pdf.md)
- [Using a custom annotation provider in Swift for iOS](/guides/ios/samples/annotation-provider-with-rotation.md)
- [Add text annotation to PDF in Swift for iOS](/guides/ios/samples/add-text-annotation-to-pdf.md)
- [Embed, flatten, or remove PDF annotations in Swift for iOS](/guides/ios/samples/annotation-processing.md)
- [Prepare PDF to embed PAdES digital signature in Swift for iOS](/guides/ios/samples/contained-pades-digital-signature.md)
- [Prepare PDF to capture digital signature in Swift for iOS](/guides/ios/samples/contained-digital-signatures.md)
- [Customize the annotation selection knobs in Swift for iOS](/guides/ios/samples/custom-selection-knobs.md)
- [Customize the annotations list in Swift for iOS](/guides/ios/samples/customizing-annotation-list.md)
- [Customize PDF form appearance in Swift for iOS](/guides/ios/samples/customizing-pdf-form-appearance.md)
- [Customize vertical annotation toolbar in Swift for iOS](/guides/ios/samples/custom-vertical-annotation-toolbar.md)
- [Apply XFDF annotations and save it as new PDF in Swift for iOS](/guides/ios/samples/embedded-xfdf-annotation-provider.md)
- [Exit PDF drawing mode automatically in Swift for iOS](/guides/ios/samples/exit-drawing-mode-automatically.md)
- [Add video, audio, image annotation to PDF in Swift for iOS](/guides/ios/samples/gallery.md)
- [Create PDF programmatically in Swift for iOS](/guides/ios/samples/create-pdf-programmatically.md)
- [Encrypt and decrypt a PDF using Swift for iOS](/guides/ios/samples/encrypt-decrypt-pdf.md)
- [PDF highlight annotation blend mode menu in Swift for iOS](/guides/ios/samples/highlight-annotation-blend-mode-menu.md)
- [Fixed-sized PDF stamp annotations in Swift for iOS](/guides/ios/samples/floating-pdf-stamp-annotation.md)
- [Disable bookmark renaming in PDF using Swift for iOS](/guides/ios/samples/disable-bookmark-renaming.md)
- [Customize PDF page lables in Swift for iOS](/guides/ios/samples/custom-page-label.md)
- [Customize annotation link border color in Swift for iOS](/guides/ios/samples/custom-link-border-color.md)
- [Save reading position in PDF using Swift for iOS](/guides/ios/samples/document-view-state-restoration.md)
- [Document With Original Url Set](/guides/ios/samples/document-with-original-url-set.md)
- [Add analytics to PDF components in Swift for iOS](/guides/ios/samples/analytics.md)
- [Display PDF in inbox directory using Swift for iOS](/guides/ios/samples/display-pdf-inbox.md)
- [Add watermark to all PDF pages using Swift for iOS](/guides/ios/samples/draw-watermark-on-pdf-pages.md)
- [Collaborating on PDFs in board meetings using Swift for iOS](/guides/ios/samples/board-meeting.md)
- [Generate a PDF report using Swift for iOS](/guides/ios/samples/generate-pdf-report.md)
- [Draw all PDF annotations as overlays in Swift for iOS](/guides/ios/samples/draw-annotations-as-overlay.md)
- [Clear all PDF annotations with a button in Swift for iOS](/guides/ios/samples/custom-button-in-annotation-toolbar.md)
- [Face redaction in document using Swift for iOS](/guides/ios/samples/face-redaction-in-pdf.md)
- [Custom PDF bookmark provider in Swift for iOS](/guides/ios/samples/custom-pdf-bookmark-provider.md)
- [Customize PDF view margins using Swift for iOS](/guides/ios/samples/dynamic-margins.md)
- [Disable PDF annotation editing in Swift for iOS](/guides/ios/samples/disable-annotation-editing.md)
- [LMS example: Take and grade an exam using Swift for iOS](/guides/ios/samples/e-learning.md)
- [Encrypted Xfdf Annotation Provider](/guides/ios/samples/encrypted-xfdf-annotation-provider.md)
- [Enable fixed PDF toolbar position in Swift for iOS](/guides/ios/samples/top-toolbar-position.md)
- [Add image gallery to PDF in Swift for iOS](/guides/ios/samples/add-image-gallery-to-pdf.md)
- [Add a custom cloudy rectangle annotation to a PDF in Swift for iOS](/guides/ios/samples/add-custom-cloudy-rectangle.md)
- [Encrypt disk cache when rendering PDF in Swift for iOS](/guides/ios/samples/encrypted-cache.md)
- [Update configuration when rotating PDF in Swift for iOS](/guides/ios/samples/update-configuration-when-rotating.md)
- [Monitor UI touches using Swift for iOS](/guides/ios/samples/monitor-touches.md)
- [Add an image signature to PDF in Swift for iOS](/guides/ios/samples/add-image-signature-to-pdf-programmatically.md)
- [Add overlay views to PDF in Swift for iOS](/guides/ios/samples/overlay-views.md)
- [Insert page into PDF from another document in Swift for iOS](/guides/ios/samples/insert-pdf-page-from-document.md)
- [Customize comment font size in PDF using Swift for iOS](/guides/ios/samples/large-font-for-comments.md)
- [Password Not Preset](/guides/ios/samples/password-not-preset.md)
- [Add a bottom inset to the user interface in Swift for iOS](/guides/ios/samples/inset-user-interface.md)
- [Custom saving options after editing PDF in Swift for iOS](/guides/ios/samples/pdf-editor-custom-saving-confirmation.md)
- [Getting started with iOS playground](/guides/ios/samples/playground.md)
- [Create PDF teleprompter using Swift for iOS](/guides/ios/samples/pdf-teleprompter.md)
- [Printer defaults for PDF annotations in Swift for iOS](/guides/ios/samples/printer-defaults.md)
- [PDF reflow with Reader View in Swift for iOS](/guides/ios/samples/pdf-reader-view.md)
- [Configuring multiline titles in PDF using Swift for iOS](/guides/ios/samples/multiline-pdf-title.md)
- [Display PDFViewController in popover using Swift for iOS](/guides/ios/samples/popover-presentation.md)
- [Embed PDFViewController as a child in iOS](/guides/ios/samples/child-view-controller.md)
- [Highlight text in PDF using Swift for iOS](/guides/ios/samples/highlight-text-in-pdf.md)
- [Lazy load PDF annotations in Swift for iOS](/guides/ios/samples/lazy-load-pdf-annotations.md)
- [Configuring PDF reader in Swift for iOS](/guides/ios/samples/e-reader.md)
- [Show PDF download progress in Swift for iOS](/guides/ios/samples/pdf-download-progress.md)
- [Custom annotation provider in Swift for iOS](/guides/ios/samples/custom-annotation-provider.md)
- [PDF page scale and resize using Swift for iOS](/guides/ios/samples/pdf-page-scaling.md)
- [Add copyright watermark to PDF in Swift for iOS](/guides/ios/samples/add-copyright-watermark-to-pdf.md)
- [Programmatically go to PDF outline in Swift for iOS](/guides/ios/samples/programmatically-go-to-outline.md)
- [Enable saving confirmation when exiting PDF in Swift for iOS](/guides/ios/samples/save-confirmation.md)
- [Customize iOS annotation inspector color presets](/guides/ios/samples/preset-customization.md)
- [Programmatically edit PDFs using Swift for iOS](/guides/ios/samples/programmatic-pdf-editing.md)
- [Open PDF with preset password using Swift for iOS](/guides/ios/samples/preset-pdf-passwords.md)
- [Convert HTML to PDF using Swift for iOS](/guides/ios/samples/html-to-pdf.md)
- [Programtically search a PDF using Swift for iOS](/guides/ios/samples/search-without-controller.md)
- [Simplifying the font picker for text annotation using Swift for iOS](/guides/ios/samples/simple-font-picker.md)
- [Show note controller for highlights in Swift for iOS](/guides/ios/samples/show-note-controller-for-highlights.md)
- [Rotate PDF pages with Swift](/guides/ios/samples/rotate-page-temporarily.md)
- [Customize scrubber bar with buttons using Swift for iOS](/guides/ios/samples/scrubber-bar-with-buttons.md)
- [Redact text in PDF using Swift for iOS](/guides/ios/samples/pdf-redaction.md)
- [Select free text annotation in PDF using Swift for iOS](/guides/ios/samples/select-free-text-annotations.md)
- [Convert stamp into a PDF button in Swift for iOS](/guides/ios/samples/stamp-button.md)
- [Create a custom PDF navigation bar with SwiftUI for iOS](/guides/ios/samples/swiftui-custom-navigation-bar.md)
- [Show or hide PDF annotations using Swift for iOS](/guides/ios/samples/toggle-annotation-visibility.md)
- [Toggle PDF form field highlight color in Swift for iOS](/guides/ios/samples/pdf-form-highlight-color.md)
- [Search multiple PDF files using Swift for iOS](/guides/ios/samples/search-multiple-pdf-files.md)
- [Download PDF from URL using Swift for iOS](/guides/ios/samples/remote-document-url.md)
- [Customize view controller for screen mirroring in Swift for iOS](/guides/ios/samples/screen-mirroring.md)
- [Custom PDF page labels in the sharing UI in Swift for iOS](/guides/ios/samples/page-labels-in-sharing-ui.md)
- [Simplifying the annotation inspector using Swift for iOS](/guides/ios/samples/simple-annotation-inspector.md)
- [SwiftUI split screen: Display two PDF views side by side on iOS](/guides/ios/samples/swiftui-split-screen.md)
- [Embed a SwiftUI view inside a page view on iOS](/guides/ios/samples/swiftui-on-page-view.md)
- [Customize PDF editor toolbar using Swift for iOS](/guides/ios/samples/pdf-editor-toolbar-customization.md)
- [Rotate PDF page using Swift for iOS](/guides/ios/samples/rotate-pdf-page.md)
- [Remove password from PDF using Swift for iOS](/guides/ios/samples/remove-pdf-password.md)
- [Custom page template in PDF editor using Swift for iOS](/guides/ios/samples/pdf-editor-custom-templates.md)
- [Open AES-encrypted PDF in Swift for iOS](/guides/ios/samples/open-aes-encrypted-pdf.md)
- [Show multiple files as a single PDF using Swift for iOS](/guides/ios/samples/show-multiple-files-in-pdf.md)
- [Render drawings on PDF pages using Swift for iOS](/guides/ios/samples/pdf-page-drawing.md)
- [Use PDFViewController with SwiftUI for iOS](/guides/ios/samples/swiftui.md)
- [Customize PDF view settings in Swift for iOS](/guides/ios/samples/pdf-view-settings.md)
- [Select all text in a PDF using Swift for iOS](/guides/ios/samples/select-all-pdf-text.md)
- [Link annotation view customization in Swift for iOS](/guides/ios/samples/link-annotation-view-customization.md)
- [Aviation example: Displaying flight plan PDF in Swift for iOS](/guides/ios/samples/aviation.md)
- [Display building floor plans in iOS with Swift](/guides/ios/samples/construction.md)
- [Multi-user PDF collaboration using Swift for iOS](/guides/ios/samples/multi-user-pdf-collaboration.md)
- [Convert MS Office (DOCX, XLSX, PPTX) to PDF in Swift for iOS](/guides/ios/samples/office-to-pdf-conversion.md)
- [OCR PDF using Swift for iOS](/guides/ios/samples/ocr-pdf.md)
- [Import and export annotations in XFDF using Swift for iOS](/guides/ios/samples/xfdf-annotation-provider.md)
- [Search and redact text in a PDF using Swift for iOS](/guides/ios/samples/search-and-redact-pdf-text.md)
- [Configure PDF annotation toolbar using Swift for iOS](/guides/ios/samples/manual-toolbar-setup.md)
- [Show author name on annotation selection in Swift for iOS](/guides/ios/samples/show-author-name-on-annotation-selection.md)
- [Programmatically add a signature to all PDF pages using Swift for iOS](/guides/ios/samples/sign-all-pdf-pages.md)
- [Compare PDF documents using Swift for iOS](/guides/ios/samples/pdf-document-comparison.md)
- [PDF streaming using Swift for iOS](/guides/ios/samples/streaming-pdf.md)
- [PDF streaming with SwiftUI for iOS](/guides/ios/samples/streaming-pdf-swiftui.md)
- [PDF collaboration using Swift for iOS](/guides/ios/samples/pdf-collaboration.md)
- [Create a custom PDF page setting view in SwiftUI for iOS](/guides/ios/samples/swiftui-settings.md)
- [Sticky header for PDF thumbnail view in Swift for iOS](/guides/ios/samples/sticky-header.md)
- [Customize PDF annotation toolbar with SwiftUI for iOS](/guides/ios/samples/swiftui-annotationt-toolbar.md)
- [Cycle through PDF documents using Swift for iOS](/guides/ios/samples/page-view-controller.md)
- [PDF magazine reader using Swift for iOS](/guides/ios/samples/pdf-magazine-reader.md)
- [Show multiple PDFs with tabbed UI using Swift for iOS](/guides/ios/samples/tabbed-bar.md)
- [Custom annotation inspector with SwiftUI for iOS](/guides/ios/samples/swiftui-custom-annotation-inspector.md)
- [Store PDF annotations for multiple users in Swift for iOS](/guides/ios/samples/store-multiple-user-annotations.md)
- [Auto-save PDF annotation changes in Swift for iOS](/guides/ios/samples/save-as-pdf.md)
- [Persist view settings using Swift for iOS](/guides/ios/samples/persist-view-settings.md)
- [Swiftui Sharing](/guides/ios/samples/swiftui-sharing.md)
- [Create email snippet when sharing PDF in Swift for iOS](/guides/ios/samples/predefined-email-body.md)
- [Display measurements on PDF pages or spreads in Swift for iOS](/guides/ios/samples/measurements-on-pages-spreads.md)
- [Add a snake game inside a PDF in Swift for iOS](/guides/ios/samples/snake.md)
- [Using Instant JSON to collaborate on PDFs in Swift for iOS](/guides/ios/samples/instant-json.md)
- [Hide or reveal an area in a PDF using Swift for iOS](/guides/ios/samples/hide-reveal-area-in-pdf.md)
- [PDF text redaction using regex in Swift for iOS](/guides/ios/samples/redact-pdf-text-using-regex.md)
- [Add SwiftUI sidebar next to PDF view on iOS](/guides/ios/samples/swiftui-sidebar.md)
- [PDF form examples using Swift for iOS](/guides/ios/samples/pdf-forms.md)
- [Integrate UIStoryboard with PDFViewController in Swift for iOS](/guides/ios/samples/storyboard.md)
- [Display PDF annotations on layers in Swift for iOS](/guides/ios/samples/pdf-annotation-layers.md)

