Sign a PDF document on iOS

To sign an existing approval signature field in a PDF Document:

1PTPDFDoc* doc = [[PTPDFDoc alloc] initWithFilepath: docpath];
2
3// Retrieve the unsigned approval signature field.
4PTField* found_approval_field = [doc GetField: approval_field_name];
5PTDigitalSignatureField* approval_digsig_field = [[PTDigitalSignatureField alloc] initWithIn_field: found_approval_field];
6
7// (OPTIONAL) Add more information to the signature dictionary.
8[approval_digsig_field SetLocation: @"Vancouver, BC"];
9[approval_digsig_field SetReason: @"Document approval."];
10[approval_digsig_field SetContactInfo: @"www.apryse.com"];
11
12// (OPTIONAL) Add an appearance to the signature field.
13PTImage* img = [PTImage CreateWithFile: [doc GetSDFDoc] filename: appearance_img_path encoder_hints: [[PTObj alloc]init]];
14PTSignatureWidget* approval_signature_widget = [[PTSignatureWidget alloc] initWithD: [found_approval_field GetSDFObj]];
15[approval_signature_widget CreateSignatureAppearance: img];
16
17// Prepare the signature and signature handler for signing.
18[approval_digsig_field SignOnNextSave: private_key_file_path in_password: keyfile_password];
19
20// The actual approval signing will be done during the following incremental save operation.
21[doc SaveToFile: outpath flags: e_ptincremental];

Digitally sign PDF files
Full code sample which demonstrates using the digital signature API to digitally sign and/or certify PDF documents.

About Adding An Approval Signature to a PDF Document

The Apryse SDK enables approval signatures in PDF documents using a Digital Certificate, in accordance with the latest PDF specification. By leveraging public key infrastructure (PKI) technology, with a certificate issued by a trusted certificate authority (CA), a signer can use a certificate-based digital ID to guarantee the authenticity of a signature. Placement of a digital signature using a certificate can also guarantee that a document was not modified since the signature was placed, ensuring the authenticity of the document.

Apryse Docs Image

Image taken from Apryse WebViewer

Above is an example of a document containing a certified signature, guaranteed by a certificate generated by Apryse.com.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales