AnthonyM
AnthonyM

Reputation: 1145

Is there a way to password protect PDFs exported from an iOS app?

We are writing an app and I have written the code to export our data in a PDF format.

The problem is the data is sensitive and needs to be protected, is there a way to password protect a PDF exported from an app using the apple libraries?

If not then any other suggestions?

Upvotes: 2

Views: 818

Answers (1)

Michael Dautermann
Michael Dautermann

Reputation: 89509

CGPDFContextCreate takes a dictionary in which you can send a password as one of the attributes.

The details for CGPDFContxtCreate you'll find in Apple's reference documents at:

http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGPDFContext/Reference/reference.html#//apple_ref/c/func/CGPDFContextCreate

And the password setting information you'll find in Apple's docs here:

http://developer.apple.com/library/ios/documentation/GraphicsImaging/Reference/CGPDFContext/Reference/reference.html#//apple_ref/doc/constant_group/Auxiliary_Dictionary_Keys

Upvotes: 1

Related Questions