Professional Web Applications Themes

Shell command from within Adobe Professional, copy and delete file - Adobe Acrobat SDK

I was hoping one of the experienced technical folks on this forum could help me out. BACKGROUND - A group within our organization is responsible for scanning and QC'ing doents. They perform the QC step by opening the digitized file in Adobe Professional, making any required changes, saving the file and then using Explorer to move the QC's file to another production directory where it is processed. NEED - It would be very helpful if from Adobe Professional, they could click on a button or select a menu option (i.e. QC Complete) from within Adobe that would copy the current ...

  1. #1

    Default Shell command from within Adobe Professional, copy and delete file

    I was hoping one of the experienced technical folks on this forum could help me out.

    BACKGROUND - A group within our organization is responsible for scanning and QC'ing doents. They perform the QC step by opening the digitized file in Adobe Professional, making any required changes, saving the file and then using Explorer to move the QC's file to another production directory where it is processed.

    NEED - It would be very helpful if from Adobe Professional, they could click on a button or select a menu option (i.e. QC Complete) from within Adobe that would copy the current file open in Adobe to the production directory without having to switch to Windows explorer, locate the file (they're might be hundreds in the directory) and then manually move it.

    Is there a way to add a button or menu item that would execute a Windows OS shell command to copy the file that Adobe currently has open? If it could also be deleted from the QC directory once the copy was successful that would be a bonus. Ideally, if this can be done, it would be also be nice if it could read the production directory from some sort of a config file, but if this is too difficult having it hardcoded in a script would work as there are only about 5 QC'ers in our organization.

    As I am not an experienced Adobe SDK developer, I'd appreciate any actual code examples to get me pointed in the right direction.

    Thanks in advance.
    David_Gottholm@adobeforums.com Guest

  2. #2

    Default Re: Shell command from within AdobeProfessional, copy and delete file

    I would suggest that you take the approach of encapsulating all of the acrobat functions within an external program -
    there are examples of how to do this in teh SDK - and then the external program could do all of the necessary functions just like normal - programs do this sort of stuff all the time.

    this way - the acrobat fnctions are just a part of the QC functions that you need to perform - and which are easily performed using C++ / , etc.
    michael_eisenman@adobeforums.com Guest

  3. #3

    Default Re: Shell command from within AdobeProfessional, copy and delete file

    You could also add a button to a toolbar with a folder-level JavaScript that performs a "Save As" to a preset path.
    PDL@adobeforums.com Guest

  4. #4

    Default Re: Shell command from within AdobeProfessional, copy and delete file

    What I was hoping to do is perhaps just encapsulate the file processing (copy,delete) into a small C++ , Java, VBScript routine that gets called from Acrobat and passed doent related parameters (i.e. filename, path, etc) that Acrobat has in memory about the currently opened file.

    If I'm understanding you correctly, are you suggesting that I create an executeable that encapulates all the Acrobat functionality? My concern with that approach, if I'm understanding you correctly, is that it encapsulates all of Acrobat which might cause issues relating to periodic Acrobat updates, etc. and overall maintainability. Given that all I want to do is a couple of simple os file manipulations, I dont want to create a specialized executable that essentially "incorporates" the Acrobat executable functions. I'd like a simple plug-in or script that I can pass parameters to and have it do the os file level stuff.

    Not sure if we are talking the same approach, but I'm looking for a solution where I call out from Acrobat, pass a few parameters. The modification to acrobat might just be the addition of a button or menu item that does the callout with the appropriate parameters.
    David_Gottholm@adobeforums.com Guest

  5. #5

    Default Re: Shell command from within AdobeProfessional, copy and delete file

    by encapsulating - I am simply stating that -
    From your application - which competently knows all the business rules and how to call remote files to execute them , etc - (normal stuff) that you simply add a lookup capability - to selct the files of interest , and then call acrobat to operate on the file - normally -
    this will allow acrobat to do what acrobat does nicely -
    as far as updates, etc - you wont need to deal with because you will be calling the newest versin of acrobat every time . so it becomes a transparent issue for your routine ;
    michael_eisenman@adobeforums.com Guest

  6. #6

    Default Re: Shell command from within AdobeProfessional, copy and delete file

    Thanks Michael, I see where your coming from and I agree that is a good approach assuming we had another driving application. However our QC process basically starts with Acrobat professional. There is no other application to modify to then call Acrobat. That is why I was looking for an approach on the other end of yours where Acrobat calls out rather then an encapsulating program (that doesn't currently exist)calling Acrobat. I understand that this is just a small improvement that makes one aspect of the QC person's job a little easier.

    Based on this if you have any suggestion, I'd greatly appreciate it. There was a suggestion of using javascript, not sure if that's an option.

    So again in summary (if possible from Acrobat)
    - Add a button to Acrobat toolbar (or menu item)
    - when clicked, call (C++, Java, VBScript, Javascript) passing parameters.
    - ok, I'm adding something new...after it calls script, displays message box with simple message like "File Transferred"

    If this is possible, again, any code examples would certainly help. Or specific references to SDK examples.

    Thanks a bunch!
    GottADC@adobeforums.com Guest

  7. #7

    Default Re: Shell command from within AdobeProfessional, copy and delete file



    So again in summary (if possible from Acrobat) - Add a button to Acrobat
    toolbar (or menu item) - when clicked, call (C++, Java, VBScript, Javascript)
    passing parameters. - ok, I'm adding something new...after it calls script,
    displays message box with simple message like "File Transferred"




    This is all possible.
    PDL@adobeforums.com Guest

  8. #8

    Default Re: Shell command from within AdobeProfessional, copy and delete file

    The parameters that I would need would be the fully qualified file and path of the file that Acrobat currently has open. I believe that would be all. As far as where I would get it, it would have to come from Acrobat by accessing it's interal DOM or similiar structure. Again, I am not an Acrobat SDK expert so I'm not sure if Acrobat allows you to access some of it's doent structure values. I would assume it has to be possible in order to perform SDK related functions.

    Another comment/request - assuming the callout from Acrobat is not feasible and I have to encapulate our processing (as Micheal suggested), do any of you have recommendations on a development platform? I'm assuming that Microsoft VisualStudio is a logical choice given that the examples seem to be based on Visual Studio. I'm a former developer so it's been a little while. I'm most familiar with Java but it seems the SDK examples are geared to C#, C, VB and javascript. Since C# is very similiar to Java that would work for me.

    Michael - I downloaded the SDK, but did not see an example referencing an external window. However, I do not have VisualStudio so I can't load and see the exact functionaility. Do you know the specific SDK example you were referring to?

    Thanks again for the help.
    GottADC@adobeforums.com Guest

  9. #9

    Default Re: Shell command from within AdobeProfessional, copy and delete file

    If all you want to do is save a file currently open in Acrobat to a specified location with a single button click, why are you worried about using Acrobat in an external window? Yes it would be a solution but it's way overkill for what you're trying to do.
    PDL@adobeforums.com Guest

  10. #10

    Default Re: Shell command from within AdobeProfessional, copy and delete file

    PDL - I'm all for the simplified solution. It's not quite as easy as just saving the file although very close.

    Again looking for:
    - Add a button to Acrobat toolbar (or menu item)
    - when clicked, call (C++, Java, VBScript, Javascript) passing parameter(fully qualified doent currently open).
    - displays message box with simple message like "File Transferred"

    I need someone who has more experience with Adobe development to tell me this is feasible and hopefully provide specific code examples on how to actually do it.
    GottADC@adobeforums.com Guest

  11. #11

    Default Re: Shell command from within AdobeProfessional, copy and delete file



    It's not quite as easy as just saving the file although very close.




    What exactly needs to be done then? From your original post it seems that you were simply trying to move a saved file from one folder to another and just wanted to eliminate Windows Explorer. In what ways would saving directly to this target folder not be sufficient?
    PDL@adobeforums.com Guest

  12. #12

    Default Re: Shell command from within AdobeProfessional, copy and delete file

    It sounds like PDL may have the best solution for you here -
    My appraoch was assuming that you had someone there to program the executive driver.

    If your processes originate with Acrobat - this may be the best appraoch -

    PDL is very good at this -
    michael_eisenman@adobeforums.com Guest

  13. #13

    Default Re: Shell command from within AdobeProfessional, copy and delete file

    Thanks,

    PDL - Just to round out the picture of the ideal scenario:

    - Within Acrobat Professional -
    - Add a toolbar button and/or menu item and/or hotkey to Acrobat
    - when above intiated:
    - Display message box confirming "QC Complete - transfer to Production" (OK, Cancel)
    - click OK
    - Acrobat programmatically saves current .pdf file that is open and active
    - Acrobat calls (C++, Java, VBScript, Javascript) plug-in/script passing parameter (current fully qualified .pdf filename with path).
    - Plug-in/script copies .pdf file from QC directory to Production processing directory

    - If transfer (previous step) successful then

    - Acrobat programmatically closes current .pdf file that is open and active

    - Plug-in/script deletes .pdf file from QC directory.

    - Display message box confirming "Transfer to Production complete" (OK)
    - click Cancel - do nothing

    Ideally, a config file could be read that contains config items (i.e. QC and Production directory paths). These are all the features that would be ideal.

    This relatively small utility would save each SRM QC'er (once file QC is complete) from having to:
    - navigate to QC directory
    - locate .pdf file in directory (that might have many files in it).
    - Move that specific .pdf file to the production directory.
    - Navigate back to QC directory, locate .pdf file and delete it (assuming transfer to production directory is successful).

    Note: Cut and paste also an option (to remove delete step) but it still involves locating the .pdf file, possibly selecting the wrong one, etc. If automated, it will save time given the repetitive nature of the task and it will also reduce potential errors.
    GottADC@adobeforums.com Guest

  14. #14

    Default Re: Shell command from within AdobeProfessional, copy and delete file

    The only part of the above that a folder-level JavaScript would not be able to do is delete the PDF file from the QC folder (JavaScript from within Acrobat cannot delete files for security reasons).

    So basically, you have 2 options:

    1. Simplest solution is to do the above with a folder-level JavaScript, and then just have the QC'er manually delete the file after.

    2. A plug-in could handle all the above, including deleting the file, but would be considerably more effort especially if you are new to the SDK.
    PDL@adobeforums.com Guest

  15. #15

    Default Re: Shell command from within Adobe Professional, copy and delete file

    You could use app.launchURL.

    Have a look at

    http://acrobatusers.com/forum/javascript/how-exec-system-command-or-programs-javascript
    Unregistered Guest

Similar Threads

  1. running shell command within php
    By Andreas Paasch in forum PHP Development
    Replies: 3
    Last Post: November 12th, 10:00 PM
  2. formatting output of `ls -l` shell command
    By lecichy in forum PHP Development
    Replies: 5
    Last Post: October 16th, 02:05 AM
  3. Using 'Shell' command in code.
    By Alex Mirzayanov in forum ASP.NET Web Services
    Replies: 1
    Last Post: September 19th, 08:54 AM
  4. executing a shell command within a function
    By Svlyp in forum PHP Development
    Replies: 0
    Last Post: August 16th, 12:19 AM
  5. unix command to delete parts of a file
    By melissa_benkyo in forum Linux / Unix Administration
    Replies: 6
    Last Post: July 9th, 07:22 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139