2

My current problem is that starting from the root folder I have to look into each folder and if one file exists then save it as a pdf with the folder name in a different location. If more then one file exists then combine this into one file, save it as a pdf with the folder name in a different location.

Example:

- Root Folder
    - Folder1
        - FileA.tif
        - FileB.tif
    - Folder2
        - FileC.tif                          

- Result Folder
    - Folder1.pdf (Contains FileA.tif and FileB.tif combined into one pdf)
    - Folder2.pdf (Contains FileC.tif as pdf)

I am currently using Acrobat 9 Professional. I know I can do this manually, but I have to do this for hundreds of folders and each folder has one or more files.

My preffered solution would be in Acrobat Javascript on Windows XP.

Somethings that I am trying to figure out is if I can do some sort of:

  • For each folder in Root Folder
  • For each file in folder (Save the folder name too)
  • Combine files (I think I can mange this based on some examples I have seen)

I think that would give me a good start.

Any help would be greatly appreciated.

Pranav Shah
  • 3,115
  • 3
  • 27
  • 45
  • Are you on a Mac? If so, you can do this *really* easily with Terminal and ImageMagick. – Blender Nov 16 '11 at 17:42
  • I believe you can combine files using Acrobat Javascript, but since it doesn't have a file API which would allow you to recurse through directories, you'd have to do a lot of work manually. – 999999 Jan 09 '13 at 18:20

2 Answers2

1

GhostView is a command-line program that can manipulate PDF files. Years ago, I used this to concatenate thousands of PDF files into a single PDF for download. It can convert multiple file types to PDF, plus you can apply all of the PDF security options to your final PDF as needed. You'll need the commercial version if you're packaging this for a product.

Adrian J. Moreno
  • 12,826
  • 1
  • 34
  • 40
0

I am trying to solve the same problem here. You need to install GhostScript and use some bat file to do the job.


I started to write this:

@echo off 
    set folpath=%~dp0
    set PROG="c:\Program Files\gs\gs9.04\bin\gswin64"
    set OUT= "%folpath%Combined.pdf"

    pushd "%~dp0"            

    call %PROG% -o %OUT% -sOUTPUTFILE="%folpath%Merged.pdf" -dBATCH  "%folpath%doc2.pdf" "%folpath%doc1.pdf"
    pause

But it is not ready :)