Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Combine PDF Pages automator step strips annotations

Oh, I was so excited when I noticed the Combine PDF Pages command in Automator.


Then I was less excited when I discovered that if any of the pages has annotations created in Acrobat Pro, those annotations are removed from the newly combined PDF.


Since Preview, for some strange reason, is not AppleScript-able, Automator is the only way I see to do this.


Acrobat is somewhat scriptable to a degree but does not have a combine PDFs command in the dictionary.


So, has anyone figured out a way to automate the merging of PDFs via a script, workflow, app, etc -- while RETAINING the annotations? I am triggering this from FileMaker as part of a work process we're developing, so manually merging the PDFs kind of defeats the purpose.


Anyone have any suggestions?


Thanks,


Jeff

Many-OTHER

Posted on Mar 22, 2013 8:26 AM

Reply
Question marked as Best reply

Posted on Mar 22, 2013 10:58 AM

Found It!


Ok, so it seems "insert pages" is in the Acrobat dictionary; I was looking for an equivelant of "Combine Files into Single PDF". Anyway, here's draft one of the script. I'll probably make it less clunky next week, but this is basically how it works:


set nFile to ""

set pCount to 0

set pdfList to {}

set pdfNameList to {}

set sourcePath to "SL:Users:joeuser:Desktop:fix ccd:Source:"

set targetPath to "SL:Users:joeuser:Desktop:fix ccd:Target:"

set coverFileName to "cover.pdf"

tell application "Finder"

movefile (sourcePath & coverFileName) tofoldertargetPath

set my pdfList to every file in folder sourcePath

repeat with f in pdfList

set pdfNameList to pdfNameList & (name of f)

end repeat

end tell


tell application "Adobe Acrobat Pro"

--activate

open (my targetPath & my coverFileName) with invisible

set targetDoc to last document

set my pCount to (number of pages) of targetDoc

get my pdfNameList

repeat with f in my pdfNameList

set c to number of documents

open (sourcePath & f) with invisible

repeat until c < (number of documents)

end repeat

set newDoc to last document

set nPages to (number of pages) of newDoc


insert pagestargetDocafter my pCountfromnewDocstarting with 1 number of pagesnPages

set my pCount to (my pCount) + nPages


closenewDoc

end repeat

savetargetDoc

closetargetDoc

end tell


tell application "Finder"

set f to file (my targetPath & my coverFileName)

set name of f to "New Merges PDF.pdf"

end tell

1 reply
Question marked as Best reply

Mar 22, 2013 10:58 AM in response to Jeff at K2

Found It!


Ok, so it seems "insert pages" is in the Acrobat dictionary; I was looking for an equivelant of "Combine Files into Single PDF". Anyway, here's draft one of the script. I'll probably make it less clunky next week, but this is basically how it works:


set nFile to ""

set pCount to 0

set pdfList to {}

set pdfNameList to {}

set sourcePath to "SL:Users:joeuser:Desktop:fix ccd:Source:"

set targetPath to "SL:Users:joeuser:Desktop:fix ccd:Target:"

set coverFileName to "cover.pdf"

tell application "Finder"

movefile (sourcePath & coverFileName) tofoldertargetPath

set my pdfList to every file in folder sourcePath

repeat with f in pdfList

set pdfNameList to pdfNameList & (name of f)

end repeat

end tell


tell application "Adobe Acrobat Pro"

--activate

open (my targetPath & my coverFileName) with invisible

set targetDoc to last document

set my pCount to (number of pages) of targetDoc

get my pdfNameList

repeat with f in my pdfNameList

set c to number of documents

open (sourcePath & f) with invisible

repeat until c < (number of documents)

end repeat

set newDoc to last document

set nPages to (number of pages) of newDoc


insert pagestargetDocafter my pCountfromnewDocstarting with 1 number of pagesnPages

set my pCount to (my pCount) + nPages


closenewDoc

end repeat

savetargetDoc

closetargetDoc

end tell


tell application "Finder"

set f to file (my targetPath & my coverFileName)

set name of f to "New Merges PDF.pdf"

end tell

Combine PDF Pages automator step strips annotations

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.