Need javascript/VB code to open password protected PDF file by passing password in code itself.

Hi,
I have used PDFcreator to create the PDF file with password security
'To create PDF file with password security
With PDFCreator1
.cOption("UseAutosave") = 1
.cOption("UseAutosaveDirectory") = 1
' ==============
.cOption("AutosaveDirectory") = strBackupPath '& "\" & Format(Trim(Sheets("Form16_Database").Range("A" &
I).Value), "0#####") & "\" 'ActiveWorkbook.Path
Debug.Print Trim(Sheets("Form16_Database").Range("A" & I).Value) & "Form16-" & Format(Trim(Sheets
("Form16_Database").Range("A" & I).Value), "0#####") & "-" & Format(Now(), "YYYYMMDDHHMMSS") & ".PDF"
.cOption("AutosaveFilename") = Format(Trim(Sheets("Form16_Database").Range("B" & I).Value), "0#####") & ".PDF"
FileName = Format(Trim(Sheets("Form16_Database").Range("B" & I).Value), "0#####") & ".PDF"
.cOption("AutosaveFormat") = 0
.cOptions.PDFUseSecurity = 1
.cOption("PDFOwnerPass") = 1
.cOption("PDFOwnerPasswordString") = "mypass"
.cOption("PDFUserPass") = 1
.cOption("PDFUserPasswordString") = "mypass"
.cClearCache
End With
'Printing to PDF Creator
ActiveSheet.PrintOut Copies:=1, ActivePrinter:="PDFCreator"
'Making the system wait for the PDF creator to create the file
Do Until PDFCreator1.cCountOfPrintjobs = 1
DoEvents
Sleep 1000
Loop
PDFCreator1.cPrinterStop = False
Sleep 1000
''and To fix digital signature used below code from Acrobat SDK 8.1..
''VB code for fixing Digital Signature --calling jaascript file from SDK.
Sub GetDigitalSignature(PDFFilepath As String, PDFFileName As String, PFXfile As String, Password As String, Top As Double,
Left As Integer)
Dim gapp As Acrobat.AcroApp
Dim gpddoc As Acrobat.AcroPDDoc
Dim jso As Object
Dim FullPath As String
Dim avDoc As CAcroAVDoc
Dim boK As Boolean
Dim ppklite As Object
Set avDoc = CreateObject("AcroExch.AVDoc")
Set gapp = CreateObject("acroexch.app")
Set gpddoc = CreateObject("acroexch.pddoc")
boK = avDoc.Open(PDFFilepath, PDFFileName)
gpddoc.Open (PDFFilepath)
Set jso = gpddoc.GetJSObject()
jso.SetUserPassword (Password)
jso.SetUserDigitalIDPath (PFXfile)
jso.SetSignTop (Top)
jso.SetSignLeft (Left)
jso.app.execMenuItem ("ADBESDK:AddSignature")
avDoc.Close (True)
gapp.Exit
End Sub
Now i am able to create PDF with Digital signature. But We want to assign password protection too..and problem is once we fix Digital signature we can't change security.
My problem is to pass password at the time of opening PDF for embedding signature. Password window should not prompt to the user while running VBA application.
Can you please help me to pass password on fly when file prompt password while opening PDF file. As file need to be opened at the time of fixing signature using sdk javascript code.

Correct, you need to encrypt then sign.
Unfortunately, there is no way to pass a password for opening.

Similar Messages

  • Cannot open a password protected PDF file on my ipad

    WHy can't I open a password protected PDF file on my ipad even after I enter my password.

    Someone on another forum said you can with the app Goodreader Lite, but I haven't gotten to try it yet. I will let you know in about 45 minutes.
    P.S: Or this sounds even better - http://discussions.apple.com/thread.jspa?messageID=11780778&#11780778
    Message was edited by: compwiz1202

  • I need help viewing password protected PDF files on my tablet

    I need help veiwing password protected PDF files on my tablet

    Any free apps available especially for this purpose?
    not that i know of. but i think _*Documents To Go*_ will be worth the expenditure.
    JGG
    edited by the Jolly Green Giant (where Green stands for environmentally friendly)

  • Can't open password protected PDF files.

    As per the thread title, I can't seem to open password protected PDF files via the Mail app.
    I've read that you can open them if they're synced and opened via iBook, however, this is not an option for me.
    I get sent several password protected PDF for work per week and would like to be able to read them directly from the Mail app just like a regular PDF file.
    Does Apple know of this issue and will they implement a fix in the near future?

    Get this:
    http://itunes.apple.com/us/app/pdf-expert-professional-pdf/id323133888?mt=8

  • Opening Password Protected PDF Files attachments on PlayBook

    Hi,
    The Password protected PDF file attachments do not open on PlayBook....Is there any way out???
    Thanks...

    Maybe he would let you be a tester
    I would like to see this app as well.
    Click here to Backup the data on your BlackBerry Device! It's important, and FREE!
    Click "Accept as Solution" if your problem is solved. To give thanks, click thumbs up
    Click to search the Knowledge Base at BTSC and click to Read The Fabulous Manuals
    BESAdmin's, please make a signature with your BES environment info.
    SIM Free BlackBerry Unlocking FAQ
    Follow me on Twitter @knottyrope
    Want to thank me? Buy my KnottyRope App here
    BES 12 and BES 5.0.4 with Exchange 2010 and SQL 2012 Hyper V

  • Will the new iPad open password protected PDF files?

    I attend college online, and have always had a problem viewing password protected PDF files on my iPad. Will the new iPad allow opening these files?
    Thank you!

    You can install the same iOS version running the new iPad onto your iPad.
    Download the free Adobe Reader app from the App Store. It opens password protected PDFs just like thee desktop version.

  • Password Protected PDF Files in Elementary OS

    I have installed Acrobat 9.5.5 on my Elementary OS (Ubuntu base) system but when I try to open a password protected PDF file from my bank Acrobat fails with the error "There was an error opening this document. An updated version of Acrobat is needed in order to open this document.".
    The version that I have installed claims to be 9.5.5 04/26/2013.
    Has anyone got any pointers?
    Thanks

    Well,  first, you probably don't have Acrobat 9.5.5 installed on Ubuntu unless you are running a VM image or using WINE to do so.  You are probably using Adobe Reader 9.x.  If a file was encrypted for Acrobat X and later then you do actually need Adobe Reader version 10.x or later.  Unfortunately there isn't a version 10.x for UNIX/LINUX.  What to do?  Use a VM or WINE and load it up that way.  If you really are running Acrobat 9.5.5 on Ubuntu via a VM image or WINE then you need to load Adobe Reader 10.x or Adobe Reader 11.x.

  • Password protected pdf files in c7

    i am not able to open the password protected pdf files in my c7..it does not even show an option for typing the password..it just show the file is password protected and cannot be opened..i never found such problem in my old n82..why nokia is doing like this in new upgraded phones ...any solutions for this...please...all my mobile bills and credit card bills comes via password protected pdf files...

    Well,  first, you probably don't have Acrobat 9.5.5 installed on Ubuntu unless you are running a VM image or using WINE to do so.  You are probably using Adobe Reader 9.x.  If a file was encrypted for Acrobat X and later then you do actually need Adobe Reader version 10.x or later.  Unfortunately there isn't a version 10.x for UNIX/LINUX.  What to do?  Use a VM or WINE and load it up that way.  If you really are running Acrobat 9.5.5 on Ubuntu via a VM image or WINE then you need to load Adobe Reader 10.x or Adobe Reader 11.x.

  • Acrobat 8.1 and C# - How can you detect password protected PDF files?

    I am modifying our existing C# code that opens PDF files.  But when ever we hit a password protected file, we are prompted for a password.  This is an automated process, so if we detect a password protected file, we move the file to a manual processing folder to be processed later.
    We are using Acrobat 8.1 Standard.
    Our code looks like this:
    using 
    System;
    using 
    System.Collections.Generic;
    using 
    System.Linq;
    using 
    System.Text;
    using 
    Acrobat;
    using 
    System.IO;
    using 
    Word = Microsoft.Office.Interop.Word;
    using 
    System.Reflection;
         AcroApp app = new AcroApp();     app.Hide();
         try
              if (app != null)          {
                   app.CloseAllDocs();
                   AcroAVDoc av = new AcroAVDoc(); 
                   if (av.Open(filename, "Test") == true)               {
                        AcroPDDoc doc = new AcroPDDoc();                    doc = (
    AcroPDDoc)av.GetPDDoc(); 
                        doc.Save((
    short)Acrobat.PDSaveFlags.PDSaveFull, 
                        Utilities.GeneratePath(FileVersion.TEMP) + fi.Name.RemoveFileExtension() + ".PDF");                    doc.Close();
         catch (Exception ex)     {
              ErrorLog.LogError(filename.RemoveFileExtension(), ex);     }
         finally
              app.CloseAllDocs();
              app.Exit();
    This works great for non-password protected PDF files, but it prompts for a password if the file is password protected.  I was looking at the FileOpenEX functionality, but I can not find the reference to bring into my C# project.  It looks like it is only for C++, since I could only find C++ examples.
    Any help would be appreciated.
    Thanks,
    Tom

    There are no methods in the Acrobat SDK for C# for what you wish to accomplish.

  • REQUEST: Support for password-protected PDF files and SD-card installation

    I would like to request for the features in the topic.
    The current version can't open password-protected files hence I still need to download them on a PC before viewing them.
    SD-card install is necessary for some devices running on Froyo as they don't have a lot of internal memory.
    Thanks in advance.

    Hi AndrewSV,
    I am sorry to hear that you are having problems opening password-protected PDF files, and that the users are being prompted for a password, which shouldn't be required for Viewing and Printing the file.
    I have opened up a [https://bugzilla.mozilla.org/show_bug.cgi?id=900822 bug for this issue], and our engineers and volunteers will be able to investigate this issue.
    Yes, please attach the write-protected PDF as an example, so that they can see what's happening.
    Thank you for your help! =)
    - Ralph

  • Convert Excel into Password Protected PDF Files

    Hello Aandi/Lenoard,
    I believe you are the Adobe Forums administrators so I thought you guys are the right people to approach.
    OTHERS ARE ALSO INVITED TO COMMENT ON THIS TOPIC.
    I have C# desktop app which generates Excel files and our goal is to convert these excel files one at a time into password protected PDF files. We use a 3rd party software currently, but I am challenging myself into saying that I can use Adobe Acrobat 9.0 SDK to achieve what is required .
    I have downloaded Acrobat 9.0 SDK and also have Adobe Professional 8.0(trail) in my development machine. Can you firstly tell me if this is possible and secondly what would be required on the client machines to run it?
    THanks,
    Andy

    "Encrypt with Password" is the policy name, not the policy id.
    Did you try enumerating the policy object to see how to set it up? I ran this from the console to get the policy details:
    var policy = security.chooseSecurityPolicy();
    for ( var i in policy )
    console.println(i + ": " + eval("policy." + i));
    That will pop up your list of policies. Choose "Encrypt with Password" and hit Apply, which returned the following:
    policyId: SP_STD_default
    name: Encrypt with Password
    description: This policy will allow you to set an open or modify password on a document.
    handler: Adobe.Standard
    target: document
    Of course, all you really need are the policyId, handler and target. Make sure you read and thoroughly understand the security requirements documented in the API reference for this method as well.

  • OBIEE 11g having problems with password protected PDF files.

    I have been able to get an analysis in OBIEE 11g to display PDF files.
    However, some of these documents contain sensitive information and must be secured. Since anyone with access to the file name
    could simply type in the proper path in the browser window, this is unacceptable. In order to try and prevent this, I created a pdf file
    that is protected with a password.
    Opening the file by itself, produces the desired results. The password is requested before the file will open.
    When I open the file through my analysis in OBIEE, Adobe reader activates, but the password is not requested and the file does not open.
    It is as if OBIEE is somehow not sensing that Adobee is asking for a password.
    Does anyone have any experience with this?

    FYI, in case anyone is interested, I found out what is going on.
    I created the original password protected PDF using Microsoft Word. I did this because I do not have a full version of Adobe Acrobat that allows me to create files.
    On a hunch, I found someone that has a full version of Acrobat, and had them create a password protected PDF file. This file worked perfectly.
    Apparently, Word is not strictly adhering to PDF guidelines, and OBIEE senses the differences, resulting in the file not opening properly.
    Something to keep in mind for anyone linking to password protected PDF files in OBIEE.

  • Printing a password protected PDF file using acroread from Unix?

    We installed v8.1.3 acroread on the server but we are unable to print a password protected PDF file from command line in Unix? <br /><br />cat  <passprotected>.PDF | /usr/bin/acroread -toPostScript | lp -dprinter<br /><br />we get the following error<br /><br />"lp: Error - stdin is empty, so no job has been sent."<br /><br />Please advice <br /><br />Thank you in advance.<br />MSUDHAN.

    Hello,<br /><br />If the pdf file has a doc open password or if printing is disallowed you will not be able to print it using the commandline.<br /><br />Any other pdf can be printed using the same command :<br />cat a.pdf | acroread -toPostScript | lp -d <printer><br /><br />Regards,<br /> Rishi

  • How to recover password Protected PDF Files

    Hi ALL,
    DO we have an option to recover password protected pdf files locked with acrobat.I didnt remember password's of some of my old pdf files
    Thanks,
    Mark
    http://infopeer.com

    I would just ask the 3rd party that created the PDF if they could supply unencrypted files. If there is some reason they will not, I am surprised that they have not restricted printing. Normally when Acrobat security is set, you can not print to a new PDF, even if printing is allowed. One option is to provide the ID and password to the other folks who need to review the PDFs. On the surface, there seems to be a license issue with what you are trying to do and you may need to be careful that the company is not at risk. That is why I am suggesting to coordinate with the 3rd party.
    Sorry. I don't have a solution but just the statement of concern.

  • IPad to wireless printer with password protected pdf files?

    I have a iPad 2 connected wirelessly to a HP Photosmart 6520. I usually have no problem printing a variety of file and docs....including pdf files. My friend sent me some password protected PDF files today. I have the password and can open them just fine....but I can't get them to print. It just ignores me (no error message). Any suggestions?

    FYI, in case anyone is interested, I found out what is going on.
    I created the original password protected PDF using Microsoft Word. I did this because I do not have a full version of Adobe Acrobat that allows me to create files.
    On a hunch, I found someone that has a full version of Acrobat, and had them create a password protected PDF file. This file worked perfectly.
    Apparently, Word is not strictly adhering to PDF guidelines, and OBIEE senses the differences, resulting in the file not opening properly.
    Something to keep in mind for anyone linking to password protected PDF files in OBIEE.

Maybe you are looking for

  • Windows Frustration

    Greetings. About a year ago we did an interactive sales piece in flash that loads and unloads different FLV files contained within SWFs for each section. It was recently brought to our attention that you can only watch each video one time on Windows

  • Driver for intel cs330 webcam on windows 7

    HI I have a great old webcam a Intel CS330, but i have just bought a new computer and its runing windows 7 and i cant seem to find a driver for it :( Could you please tell me where i may get this from if it is avalible or if it will be anytime soon.

  • Dialogs

    Hi, In Forms 6i for NT when pressing a button I'd like to pop-up a new window which should wait for user input, then the flow would come back to the main window that should process the data inserted. I'v tried to use a dialog window, both using the '

  • Producing pdf from XML via XSL:FO

    Anyboy point me in the direction of a good tutorial, book or any other reference on how to produce a pdf from XML, please?

  • Issue with RDS Licensing on Windows 2008 R2

    I'm attempting to consolidate 2 very small Citrix environments (only two total servers in each environment) into a single farm and when attempting to migrate RDP applications to what will be the full production environment, I'm receiving the followin