---
title: "Get an ink signature image in iOS"
canonical_url: "https://www.nutrient.io/guides/ios/knowledge-base/how-do-i-get-an-image-from-signatureviewcontroller/"
md_url: "https://www.nutrient.io/guides/ios/knowledge-base/how-do-i-get-an-image-from-signatureviewcontroller.md"
last_updated: "2026-05-14T16:53:43.872Z"
description: "Learn how to capture and create images of ink signatures using SignatureViewController with this detailed guide."
---

# Capture ink signatures using SignatureViewController

There are two options for getting the image of an ink signature from a `SignatureViewController`.

## Option 1

Subclass the [`SignatureViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/signatureviewcontroller) and override its [`done(_:)`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/signatureviewcontroller/done(_:)) method to access its [`drawView`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/signatureviewcontroller/drawview). This will create the ink signature.

Once you have the ink signature, you can use [`Annotation.image(size:options:)`](https://www.nutrient.io/api/ios/documentation/pspdfkit/annotation/image(size:options:)) to create a `UIImage` of the ink annotation, like so:

### SWIFT

```swift

class CustomSignatureViewController: SignatureViewController {
    override func done(_ sender: Any?) {
        super.done(sender)

        // The current document.
        let document =...
        let pageInfo = document.pageInfoForPage(at:0)!
        let pointSequences = self.drawView.pointSequences.map{ $0.map({ NSValue.valueWithDrawingPoint($0) }) }
        let pdfSpaceLines = ConvertViewLines(pdfLines: pointSequences, pageInfo: pageInfo, viewBounds: self.drawView.frame)
        let lines = pdfSpaceLines.map { $0.map({ $0.drawingPointValue }) }
        let inkAnnotation = InkAnnotation(lines: lines)

        // Create the `UIImage` from the ink annotation in your `SignatureViewController`.
        let image = inkAnnotation.image(size: inkAnnotation.boundingBox.size, options: nil)
    }
}

```

### OBJECTIVE-C

```objc

@interface CustomSignatureViewController : PSPDFSignatureViewController
@end

@implementation CustomSignatureViewController

- (void)done:(id)sender {
    [super done:sender];

    // The current document.
    PSPDFDocument *document =...
    PSPDFPageInfo *pageInfo = [document pageInfoForPageAtIndex:0];
    NSArray<NSArray<NSValue *> *> *pointSequences = self.drawView.pointSequences;
    NSArray<NSArray<NSValue *> *> *lines = PSPDFConvertViewLinesToPDFLines(pointSequences, pageInfo, (CGRect){CGPointZero, pageInfo.size});
    PSPDFInkAnnotation *inkAnnotation = [[PSPDFInkAnnotation alloc] initWithLines:lines];

    // Create the `UIImage` from the ink annotation in your `PSPDFSignatureViewController`.
    UIImage *image = [inkAnnotation imageWithSize:inkAnnotation.boundingBox.size options:nil];
}

@end

```

## Option 2

If, for whatever reason, the [`SignatureViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/signatureviewcontroller) is presented in a context in which a [`Document`](https://www.nutrient.io/api/ios/documentation/pspdfkit/document) isn’t available to get a reference [`PDFPageInfo`](https://www.nutrient.io/api/ios/documentation/pspdfkit/pdfpageinfo) object to perform the annotation calculations, you can call [`DrawView.drawHierarchy(in:afterScreenUpdates:)`](https://developer.apple.com/documentation/uikit/uiview/1622589-drawhierarchy) within an image rendering context to get a direct image out of [`DrawView`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/drawview):

### SWIFT

```swift

class CustomSignatureViewController: SignatureViewController {
    override func done(_ sender: Any?) {
        super.done(sender)

        let rect =...
        let renderer = UIGraphicsImageRenderer(size: rect.size)
        let image = renderer.image { _ in
            self.drawView.drawHierarchy(in: rect, afterScreenUpdates: true)
        }
    }
}

```

### OBJECTIVE-C

```objc

@interface CustomSignatureViewController : PSPDFSignatureViewController
@end

@implementation CustomSignatureViewController

- (void)done:(id)sender {
    [super done:sender];

    CGRect rect =...
    UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:rect.size];
    UIImage *image = [renderer imageWithActions:^(UIGraphicsImageRendererContext *rendererContext) {
        [self.drawView drawViewHierarchyInRect:rect afterScreenUpdates:YES];
    }];
}

@end

```

For more details about accessing properties from a [`SignatureViewController`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/signatureviewcontroller) and its [`drawView`](https://www.nutrient.io/api/ios/documentation/pspdfkitui/signatureviewcontroller/drawview) property, take a look at [`SignAllPagesExample.swift`](https://github.com/PSPDFKit/pspdfkit-ios-catalog/blob/master/Catalog/Examples/Annotations/SignAllPagesExample.swift) from our [Nutrient Catalog app](https://www.nutrient.io/guides/ios/getting-started/example-projects.md#nutrient-catalog).
---

## Related pages

- [Adjusting Size Of Popovers](/guides/ios/knowledge-base/adjusting-size-of-popovers.md)
- [Fix app store connect operation errors in Xcode](/guides/ios/knowledge-base/app-store-connect-operation-errors.md)
- [Archive Errors Cocoapods](/guides/ios/knowledge-base/archive-errors-cocoapods.md)
- [Customize your iOS navigation bar above crop UI](/guides/ios/knowledge-base/customize-the-navigation-bar-in-crop.md)
- [Adding Swipe Gesture Recognizer](/guides/ios/knowledge-base/adding-swipe-gesture-recognizer.md)
- [Configuring Scroll Views](/guides/ios/knowledge-base/configuring-scroll-views.md)
- [Debugging Issues](/guides/ios/knowledge-base/debugging-issues.md)
- [Adding Vector Image Annotation From Instant Json](/guides/ios/knowledge-base/adding-vector-image-annotation-from-instant-json.md)
- [Disabling Auto Opening Comments](/guides/ios/knowledge-base/disabling-auto-opening-comments.md)
- [Customizing Annotation Toolbar Frame](/guides/ios/knowledge-base/customizing-annotation-toolbar-frame.md)
- [Customize Share Sheet Apps](/guides/ios/knowledge-base/customize-share-sheet-apps.md)
- [Customize PDF rendering on iOS](/guides/ios/knowledge-base/customize-document-rendering.md)
- [Disabling Directional Lock](/guides/ios/knowledge-base/disabling-directional-lock.md)
- [Disabling Text Selection](/guides/ios/knowledge-base/disabling-text-selection.md)
- [Disabling Adding Pages With Images](/guides/ios/knowledge-base/disabling-adding-pages-with-images.md)
- [Gatekeeper Alerts Mac Catalyst](/guides/ios/knowledge-base/gatekeeper-alerts-mac-catalyst.md)
- [Customize action sheet appearance on iOS links](/guides/ios/knowledge-base/hide-or-customize-the-action-sheet-link-long-press.md)
- [Drawing An Upright Stamp Annotation On A Rotated Page](/guides/ios/knowledge-base/drawing-an-upright-stamp-annotation-on-a-rotated-page.md)
- [How Do I Change How To Open Links](/guides/ios/knowledge-base/how-do-i-change-how-to-open-links.md)
- [Generate PDFs from complex HTML](/guides/ios/knowledge-base/generating-pdf-from-complex-html.md)
- [How Do I Customize Search Results](/guides/ios/knowledge-base/how-do-i-customize-search-results.md)
- [Adding a custom view controller in iOS](/guides/ios/knowledge-base/how-do-i-add-custom-controller-to-containerviewcontroller.md)
- [How Do I Migrate From Cocoapods To Spm](/guides/ios/knowledge-base/how-do-i-migrate-from-cocoapods-to-spm.md)
- [How Do I Customize The Annotation Inspector](/guides/ios/knowledge-base/how-do-i-customize-the-annotation-inspector.md)
- [How Do I Download Pspdfkit As Fat Frameworks](/guides/ios/knowledge-base/how-do-i-download-pspdfkit-as-fat-frameworks.md)
- [Get notifications for unlocked password-protected PDFs](/guides/ios/knowledge-base/how-do-i-get-notified-when-a-password-protected-document-is-unlocked.md)
- [How Do I Present A Pspdftabbedviewcontroller In Cordova](/guides/ios/knowledge-base/how-do-i-present-a-pspdftabbedviewcontroller-in-cordova.md)
- [Other dependencies.](/guides/ios/knowledge-base/how-do-i-migrate-from-carthage-to-spm.md)
- [How Do I Remove The Sign Arrow From The Signature Form Field](/guides/ios/knowledge-base/how-do-i-remove-the-sign-arrow-from-the-signature-form-field.md)
- [How Do I Select Or Deselect An Annotation Programmatically](/guides/ios/knowledge-base/how-do-i-select-or-deselect-an-annotation-programmatically.md)
- [How to add annotations programmatically in iOS](/guides/ios/knowledge-base/how-do-i-programmatically-add-annotation-to-the-saved-annotations-list.md)
- [Fixing library not found issues in iOS apps](/guides/ios/knowledge-base/library-not-found-swiftpm.md)
- [Fix incorrect page color in night appearance mode](/guides/ios/knowledge-base/how-do-i-reset-custom-document-render-options-before-change-the-appearance-mode.md)
- [Block annotation editing and deletion in iOS](/guides/ios/knowledge-base/prevent-annotation-editing-allow-manipulation.md)
- [Creating invisible digital signatures on iOS](/guides/ios/knowledge-base/invisible-signature.md)
- [Search Special Characters](/guides/ios/knowledge-base/search-special-characters.md)
- [Processor Write To File Url](/guides/ios/knowledge-base/processor-write-to-file-url.md)
- [Setting The Initial Page Selection When Sharing](/guides/ios/knowledge-base/setting-the-initial-page-selection-when-sharing.md)
- [Separate Photo Library And Camera Actions](/guides/ios/knowledge-base/separate-photo-library-and-camera-actions.md)
- [Zoom to specific PDF annotations easily](/guides/ios/knowledge-base/zoom-to-specific-annotation.md)
- [Showing Annotation Tools In The Main Toolbar](/guides/ios/knowledge-base/showing-annotation-tools-in-the-main-toolbar.md)
- [How to store electronic signatures using Instant JSON](/guides/ios/knowledge-base/store-electronic-signatures-from-instant-json-annotations.md)
- [Suppressing File Coordination Alerts](/guides/ios/knowledge-base/suppressing-file-coordination-alerts.md)

