Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to make an 'Action' delete the original file (after reducing its size) and to output logs?

New Here ,
Jul 01, 2017 Jul 01, 2017

My organisation keeps thousands of PDFs (mostly scanned forms, documents etc.), many of which have ridiculously large file sizes due to incorrect scan settings. I'm looking for a way to automate the task of reducing the file sizes while indicating that the file's size was reduced in case something goes wrong.

Hence, I'm trying to set up a custom Action in Acrobat Pro XI to:

  1. Reduce PDF file sizes in a directory
  2. Delete the original PDFs
    • Acrobat allows you to overwrite the original PDFs (by keeping the original file name), however, I need to insert some text in the filename in order to indicate that it was reduced

    • If text is inserted into the file name, both the original and the reduced files are retained in the directory

     3. Output logs for what was done

    • Whether or not the file size was successfully reduced
    • Whether the file was skipped (for whatever reason)
    • Whether the original file was deleted
    • Date and time of when the Action started on the PDF (not essential)
    • Amount of time it took for the Action to execute on the PDF (not essential)

Is there way to accomplish tasks 2 and 3 via Javascript within the Action? This will be running on a Windows Server 2008 R2 machine if it makes any difference. Any help would be much appreciated.

TOPICS
Acrobat SDK and JavaScript
610
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 02, 2017 Jul 02, 2017

You can't delete the original document.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 02, 2017 Jul 02, 2017
LATEST

Bernd Alheit​ Thanks for your reply. I'll probably have to delete the originals using a PowerShell script then.

How about outputting the logs I've mentioned? Would that be possible?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines