Skip navigation
Neil-Kentucky
Currently Being Moderated

JavaCode: Save as image, then re-combine as PDF?

Jul 24, 2012 7:53 AM

Tags: #java #image #print #as #flatten

I'm using Acrobat X Pro, Windows 7.

 

I'm trying to remove ALL ability for clients to modify data in a file.  Because not even flattening will remove everything, and printing and scanning again is out of the question, I have a slow workaround: I save my PDF as a PNG image, then back as a PDF in order to clean the file and make everything permanent.

 

This is VERY time consuming so in order to speed up this process, I need an action that runs a javascript that does the following:

 

1) Save the current open file as a PNG into currentdirectory\currentfilename1.png... filename2.png... filename3.png... etc.

2) Combines the PNG files into a single PDF.

3) Saves that PDF as the original filename with "_img" appended to the end of the filename.

4) Deletes the PNG files recently created.

 

Can someone help me code this? It looks like something that a guru could code quickly, but i know nothing about java yet this code would save me hours a day.  Any help you can offer is greatly appreciated! Thank you.

 

-Neil

 
Replies
  • Currently Being Moderated
    Jul 25, 2012 12:07 AM   in reply to Neil-Kentucky

    Won't they just run OCR? Or, if it is worth five minutes, create new elements and copy/paste them over your file? Or just make a fake if a changed document has value to them?

     

    Stopping modification is pretty much a non-starter. They way the world is going is digital signatures, which don't stop anything, but make it easy to verify you have an original, and to detect change.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 2, 2012 6:18 AM   in reply to Neil-Kentucky

    Is there a reason it needs to be Java, or are you just referring to the javascript execution available in Acrobat's Actions?

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 2, 2012 7:59 AM   in reply to Neil-Kentucky

    Adobe Acrobat doesn't use Java.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 2, 2012 8:07 AM   in reply to Neil-Kentucky

    Neil-Kentucky wrote:

     

    It can be setup any way.. I just need it to execute automatically at the press of a button anad i thought that java was the only way.

     

    You're using the term 'Java' instead of 'JavaScript'. They are not the same thing. Acrobat uses JavaScript, not Java.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 8, 2012 1:44 PM   in reply to Neil-Kentucky

    I haven't used it myself, but have you checked out the 'Sanitize document' feature in Acrobat X? It's under the 'Tools' bar, 'Protection' tab. I believe this might do what you need.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2012 6:51 AM   in reply to Neil-Kentucky

    One more question - is there a reason you aren't using the security settings to restrict any edits to the document? It's available at the click of a button and fairly effective at rendering documents unusable for anything but viewing (correctly configured).

     

    Other than that, you could create an action that has no steps, just the Save function, using the 'Export File9s) to Alternate format' option to create the PNG files (adding the _img extension.

     

    Then create a second action that assembles files in the directory (where the PNG files were saved) into a single PDF.

     

    Unfortunately, you're stuck with having not only multiple actions, but manual intervention with this method, as you have to identify the files to combine for the second action.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2012 10:22 AM   in reply to Neil-Kentucky

    Did you try it? On the PDF form I tested it on, it seemed to make the entire PDF into an image (Text that was native & selectable in the original PDF was rasterized in the sanitized file)

    Neil-Kentucky wrote:

     

    MarkWalsh wrote:

     

    I haven't used it myself, but have you checked out the 'Sanitize document' feature in Acrobat X? It's under the 'Tools' bar, 'Protection' tab. I believe this might do what you need.

     

    It might protect the document, but you are able to visually discern that the document was electronically modified that way.  Such as stamps flickering when you page down while the images refresh.  Although you cannot modify them, it's quite obvious they were added later.  With an image it's all blended together as one.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points