simple script for combining pdf files

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

simple script for combining pdf files Fri Sep 16, 2011 8:00 am • by Graf_Wetter
Hi there,

a little help needed for the following problem:

A rule in Hazel watches a folder, where subfolders with several pdf files are dropped in.

FOLDER_A
--- Subfolder "11111" with single pdf files

What I need now is a simple script to be used in this Hazel rule that does just two things:

1. Combine all of the single pdf files of one subfolder to one combined file (ordered by filename)

2a. name the combined file "combined.pdf" and save it in the same subfolder where the single files came from (here: "11111")
OR
2b. name the combined file with the specific subfolder name (here: "11111.pdf") and save it to the parent folder (here: "FOLDER_A")

Hope this is not to hard for someone who is familiar with scripting.
Unfortunately I am not at all.

Thanks a lot.
Greetings form Germany ...

Graf_Wetter
Graf_Wetter
 
Posts: 37
Joined: Thu Aug 25, 2011 7:18 am

Re: simple script for combining pdf files Mon Sep 19, 2011 4:22 am • by Graf_Wetter
Hi again,

i found the command line tool "pdftk" to process the pdf files.

example:
pdftk *.pdf cat output combined.pdf

Can I use this inside a "run shell script" action ?
How can I lead pdftk to the dropped in subfolders ("11111") to look for the single files ?

Thanks
Graf_Wetter
Graf_Wetter
 
Posts: 37
Joined: Thu Aug 25, 2011 7:18 am

Re: simple script for combining pdf files Mon Sep 19, 2011 11:58 am • by Mr_Noodle
In theory yes, though I don't know enough about the program to say definitively. As for subfolders, there's a sticky article at the top of this forum explaining it.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: simple script for combining pdf files Wed Sep 21, 2011 3:16 am • by Graf_Wetter
Hi,

I made it with an Automator action.
Not very smart, but it works.

If there´s lean script solution out there ... thanks for a short hint.

Graf_Wetter
Graf_Wetter
 
Posts: 37
Joined: Thu Aug 25, 2011 7:18 am

Re: simple script for combining pdf files Thu Oct 03, 2013 6:31 am • by scrabble
Graf_Wetter could you post your solution in detail. I don't get it running.
scrabble
 
Posts: 7
Joined: Tue Aug 30, 2011 4:30 am


Return to Support