Frequently Asked Question

Encrypt a pdf (iOS)
Last Updated 11 months ago

This article shows how to Encrypt a pdf.

This feature is available only with Premium License.

// Get Documents directory path
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
// Set the encrypted file path
NSString *docPath = [documentsDirectory stringByAppendingPathComponent:@"enc_file.pdf"];
// Set the pdf file id
NSString *pdfId = @"123456789abcdefghijklmnopqrstuv";
unsigned char c = [pdfId cStringUsingEncoding:NSUTF8StringEncoding];
// Encrypt the current pdf file
[m_doc encryptAs:docPath :@"user" :@"admin" :0x4 :4 :&c];


Loading ...