Thread View: adobe.acrobat.sdk
10 messages
10 total messages
Started by Galahad_Phillips
Thu, 02 Apr 2009 00:06
Encrypt PDF Files - Adobe Acrobat SDK
Author: Galahad_Phillips
Date: Thu, 02 Apr 2009 00:06
Date: Thu, 02 Apr 2009 00:06
7 lines
897 bytes
897 bytes
I'm new to using the Acrobat SDK. From what I have read I can use the SDK and related JS Objects to encrypt a selected PDF file and assign a Certificate file to the PDF file to use for encryption. Please point me in the right direction on how to get started. The application will be Win Forms on .NET 2.0 Framework written in C# Thanks,
Re: Encrypt PDF Files - Adobe Acrobat SDK
Author: Galahad_Phillips
Date: Thu, 02 Apr 2009 00:11
Date: Thu, 02 Apr 2009 00:11
14 lines
1586 bytes
1586 bytes
Followup: I found the following link that discussing what I want to do accomplish - Encrypt PDF Files With A Certificate. <http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/wwhelp/wwhimpl/common/html/wwhelp.htm?context=sdkHelp&file=000057.html> & This link: <http://livedocs.adobe.com/livecycle/8.2/programLC/programmer/help/wwhelp/wwhimpl/common/html/wwhelp.htm?context=sdkHelp&file=000057.html> What I don't understand about the second link is what is referred to below: Create an Encryption Client API object To programmatically perform an Encryption service operation, you must create an Encryption service client. If you are using the Java Encryption Service API, create an EncrytionServiceClient object. If you are using the web service Encryption Service API, create an EncryptionServiceService object. Since I'm writing the code in C# can I use either the Java Encryption Service API or the web service? Where do I get those references or get these API's?
Re: Encrypt PDF Files - Adobe Acrobat SDK
Author: Leonard_Rosenthol
Date: Thu, 02 Apr 2009 17:06
Date: Thu, 02 Apr 2009 17:06
1 lines
803 bytes
803 bytes
Are you building a desktop solution or a server solution? If desktop, wWill the user have Adobe Acrobat installed on their computer?
Re: Encrypt PDF Files - Adobe Acrobat SDK
Author: Galahad_Phillips
Date: Thu, 02 Apr 2009 17:40
Date: Thu, 02 Apr 2009 17:40
13 lines
1305 bytes
1305 bytes
Thanks for the response. It's a desktop application using Win Forms and C# in .NET 2.0 framework. The client wants to use Adobe SDK to do the encryption, however I'm not quite sure how to do that after reviewing the Acrobat SDK. The user will have Acrobat installed on their machine. The high level requirement is below: 1. Allow user to select a source directory when PDF file(s) reside. 2. Allow user to select an output directory for the PDF file(s) to be copied to once they are encypted. 3. Allow user the ability to select a certificate file (.cer,.pfx) and then use that certificate to encrypt the file(s) from the source directory. Thx so much for your response, this is new territory for me :)
Re: Encrypt PDF Files - Adobe Acrobat SDK
Author: Galahad_Phillips
Date: Thu, 02 Apr 2009 19:56
Date: Thu, 02 Apr 2009 19:56
11 lines
1354 bytes
1354 bytes
I found one other thread on this subject where the requirement was to encrypt a PDF file w/ a cert. See below: <http://www.adobeforums.com/.3c05eda1/3> Lots of references there to the Javascript SDK...to make sure I have the right one, I downloaded it from here: <http://www.adobe.com/cfusion/entitlement/index.cfm?e=acrobat%5Fsdk> I'm reading thru the js_developer_guide.pdf to see how encryption is supposed to work. There's a section titled Security and a sub section called Encrypting files using certificates. I see on p 178 of this doc about creating a new self sign digital ID. I'm wondering if code in this section can be modified to encrypt the document w/ a user selected cert instead of creating on on the fly?
Re: Encrypt PDF Files - Adobe Acrobat SDK
Author: PDL
Date: Thu, 02 Apr 2009 20:34
Date: Thu, 02 Apr 2009 20:34
1 lines
718 bytes
718 bytes
Yes. In the same sample, set bUI to true on the handler.login call and the user should be presented with an interface to select their certificate.
Re: Encrypt PDF Files - Adobe Acrobat SDK
Author: Galahad_Phillips
Date: Fri, 03 Apr 2009 13:30
Date: Fri, 03 Apr 2009 13:30
16 lines
1304 bytes
1304 bytes
Ok, that makes sense. So now that generates a few questions :)
See below:
1. In reading the JS Developer Guide, I don't see anythign stating where the server side JS libraries are located or how I include them for example in my Win Forms project.
2. In the sample I believe I see the handler.login call:
var ppklite = security.getHandler("Adobe.PPKLite");
Then the last line that creates the user certs:
bUI: false.
What does the var bUI refer to? Showing a JS interface to the user? I was simply planning on giving the user a browse option in my Win Forms to select the cert from a Windows dir?
Am I headed in the right direction?
Thanks again!
Re: Encrypt PDF Files - Adobe Acrobat SDK
Author: Galahad_Phillips
Date: Fri, 03 Apr 2009 15:11
Date: Fri, 03 Apr 2009 15:11
42 lines
2132 bytes
2132 bytes
Ok I'm making progress I think :)
The following code should encrypt the pdf file hopefully, however once I execute this code and then open the PDF file, it opens fine:
AFormApp formApp;
CAcroAVDoc doc;
Fields fields;
string nVersion;
string menuItem = string.Empty;
string certPwd = string.Empty;
string jsCode = string.Empty;
//open pdf
doc = (CAcroAVDoc)Interaction.CreateObject("AcroExch.AVDoc", "");
doc.Open(fileName, "Test PDF");
//acrobat form object
formApp = (AFormApp)Interaction.CreateObject("AFormAut.App", "");
//access some object property in objects inside AcroForm.
fields = (Fields)formApp.Fields;
certPwd = "test";
menuItem = "ADBESDK:AddSignature";
jsCode = "SetUserPassword(" + "'" + certPwd + "'); SetUserDigitalIDPath(" + "'" + certPath + "');" + "app.execMenuItem(" + "'" + menuItem + "');";
fields.ExecuteThisJavascript(jsCode);
doc.Close(0);
I created this code based on a sample from the SDK project called FillFormCS.
There's a section in there that contains the following comment:
/******************************************************
VB code in an Acrobat IAC program
to sign a PDF quietly ( no Acrobat running on screen ),
using the JS methods in this file
* *****************************************************
When signing a PDF file is referred to, is in the context of encrypting it with a certificate? Or is it referring to a different kind of signature? Are there any changes I have to make to existing PDF's to encrypt them with a cert?
Thx again!
Re: Encrypt PDF Files - Adobe Acrobat SDK
Author: Galahad_Phillips
Date: Fri, 03 Apr 2009 17:12
Date: Fri, 03 Apr 2009 17:12
3 lines
761 bytes
761 bytes
So follow up to my last post, the sample I was using just signs the file w/ a digital id, not actually encrypting the file from what I can tell. So the research continues...
Re: Encrypt PDF Files - Adobe Acrobat SDK
Author: Galahad_Phillips
Date: Fri, 03 Apr 2009 18:01
Date: Fri, 03 Apr 2009 18:01
13 lines
1319 bytes
1319 bytes
So after more research, it looks like the only way to encrypt a PDF doc is by using the encryptForRecipients method noted on page 171. According to the documentation, this method encrypts the document using the public key certs of each recipient. So basically I have to use ADSI to connect to the directory containing user certs and encrypt the doc for a list of groups. Can I bypass the ADSI part and just specify a static location for the .cer file and then use the encryptForRecipients method? Also I'm using the ExecuteThisJavascript method of the Fields object from the AFormApp class. Does the ExecuteThisJavascript method run the js code against the PDF file? It seems I'm very close to getting this working.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads