Announcement

Collapse
No announcement yet.

PDF and Command line arguments

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PDF and Command line arguments

    I have a PDF that I’m opening with a AcroRd32.exe from a CD. I would like to place an “Open” password on the PDF file. Where do I tell the PDF file what the password is? In my Action Properties: File – Execute box I have the following:

    File to execute (path and file name):
    %SrcDir%\Acrobat\AcroBat32.exe

    Command line arguments:
    “C:\temp\The Handbook.pdf”

    Thanks!

  • #2
    Re: PDF and Command line arguments

    I don't know if you will be able to do it. I think this was discussed in the past. Here is an article on adobes site about command line:

    http://www.adobe.com/support/techdocs/11666.htm

    This is also from their site, it shows XML code for opening an encrypted PDF

    AREA: Reader Extensions: Encrypted PDF's

    ISSUE: The setUsageRights command fails to execute after decrypting with openPassword. The setUsageRights command only works on an encrypted PDF if the decryptPDF command is used with the master password. The following XML will produce an error.
    <commands>
    <loadContent source="../test_files/ins.pdf" />
    <encryptPDF openPassword="adobe" permissions="copy note"/>
    <decryptPDF password="adobe"/>
    <setUsageRights advancedFormFeatures="enable"/>
    <saveContent name="../result_files/setUsageRights01.pdf" />
    </commands>

    WORKAROUND: Provide a masterPassword to decryptPDF instead of the openPassword.
    <commands>
    <loadContent source="../test_files/ins.pdf" />
    <encryptPDF masterPassword="adobe" permissions="copy note"/>
    <decryptPDF password="adobe"/>
    <setUsageRights advancedFormFeatures="enable"/>
    <saveContent name="../result_files/setUsageRights01.pdf" />
    </commands>
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

    Comment


    • #3
      Re: PDF and Command line arguments

      Well that sucks! Hmmm. [img]/ubbthreads/images/icons/frown.gif[/img]

      Comment


      • #4
        Re: PDF and Command line arguments

        how is this for a final answer

        http://www.adobeforums.com/cgi-bin/[email protected]
        TJ-Tigger
        "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
        "Draco dormiens nunquam titillandus."
        Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

        Comment


        • #5
          Re: PDF and Command line arguments

          Good old Aandi...

          Corey Milner
          Creative Director, Indigo Rose Software

          Comment


          • #6
            Re: PDF and Command line arguments

            Could you just password protect it in a zip file instead?
            TJ-Tigger
            "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
            "Draco dormiens nunquam titillandus."
            Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

            Comment


            • #7
              Re: PDF and Command line arguments

              Nope... Acrobat gives you the ability to "save a copy" as your looking at it. Shoot! Thanks Tigg!

              Comment


              • #8
                Re: PDF and Command line arguments

                I'm not sure a user password would prevent Acrobat from "saving as," but I'll have to try it.

                If you want to prevent printing the PDF, I've seen indications that you do need a user password to prevent some third party software (Ghostscript, GSview, XPDF, Mac OS X preview) from ignoring the restriction.

                Note that if you apply only a user password, someone with Acrobat can remove the user password and any other security settings (no printing, no copying, etc.).

                Have you thought about applying just a master password? At least that way, the saved file would still have the same security restrictions, and you wouldn't have to send the master password to AMS. Also, if you're confident that the users will only have Reader, you can apply restrictions without having either a user or a master password.

                Comment


                • #9
                  Re: PDF and Command line arguments

                  Bruce, give this a try...

                  I can't gaurantee it 100%, but I wasn't able to break it in the tests I did. Basically, its a program that will call the AcroRd32.EXE, wait for the Password dialog box, force the window to the front, then send the password and a carriage return.

                  Anyhow, play with it and see what you think.

                  Download Sample

                  Comment


                  • #10
                    Re: PDF and Command line arguments

                    Thanks Worm! I'll give it a try!

                    Comment


                    • #11
                      Re: PDF and Command line arguments

                      Sure thing, if you have questions about the command line parameters, let me know. I didn't do any explaining at all.

                      Comment


                      • #12
                        Re: PDF and Command line arguments

                        It worked great! This is huge for those of us who need some sort of protection for our PDFs. Thanks again!

                        Comment


                        • #13
                          Re: PDF and Command line arguments

                          Cool Biz!

                          I guess you made it through the parameters okay then.

                          Comment


                          • #14
                            Re: PDF and Command line arguments

                            hey worm,

                            I've downloaded your example and tried it out. It goes as far as waiting for the password prompt and bringing it to the front but it doesn't send the password.
                            Looking through the actions you had setup I can sort of see that at least from the ShellPDF button you mention the password but I'm not really clear about how it is that this is supposed to work and almost as importantly why it is that this doesn't work.

                            Care to enlighten me?

                            Comment


                            • #15
                              Re: PDF and Command line arguments

                              Uh Oh! [img]/ubbthreads/images/icons/shocked.gif[/img]

                              The top link should only open the PDF normally. The bottom link should open the PDF and insert the password. What version of Acrobat Reader?

                              If that's not the case... Uhmmm, I dunno. What OS are you running? Are you using the sample app, or have you modified it?

                              Comment

                              Working...
                              X