Add Studio Log to My Yahoo

PDF Workflow: Combine Multipage PDF into One Photoshop Document

PDF Workflow allows various methods of processing items that have been printed from applications as PDF files. The following script open a 2, 3, and 4-page PDF in Adobe Photoshop. The resulting pages are then combined into one document side-by-side. The script asks for an output folder and then the number of pages in the PDF. The resulting file can then be merged and saved as appropriate.

The script can also be saved as a droplet and then a 2, 3, and 4-page PDF dropped on it will be combined into a single Photoshop document.

To process print jobs, script requires configuration of PDF Workflow scripting and the scripting plug-in for Photoshop 7.0 must be installed as well.



on open these_items
set thePrefs to {}
set fLocation to choose folder
set newDoc to "newDoc" & 1
set g to display dialog "# of pages?" default answer "2" with icon note giving up after 20
set num to text returned of g
repeat with i from 1 to count of these_items
tell application "Adobe Photoshop 7.0"
activate
repeat with j from 1 to num
set myOps to {page:j}
open item 1 of these_items with options myOps showing dialogs error dialogs
end repeat

set theNames to every document
repeat with k from 1 to count of theNames
set x2 to width of item k of theNames
set y2 to height of item k of theNames
copy {x2, y2} to end of thePrefs
end repeat
set newWidth to 0
set newHeight to 0
repeat with i from 1 to count of thePrefs
set x to item 1 of item k of thePrefs
set y to item 2 of item k of thePrefs
set newWidth to newWidth + x
set newHeight to y
end repeat
-- return {newWidth, newHeight}
set newDocRef to make new document with properties {width:newWidth, height:newHeight, resolution:72.0, name:newDoc, initial fill:transparent}
repeat with i from 1 to count of theNames
set theDoc to item i of theNames
set current document to theDoc
set x2 to item 1 of item i of thePrefs
set y2 to item 2 of item i of thePrefs
select current document region {{0, 0}, {x2, 0}, {x2, y2}, {0, y2}}
copy selection of current document
close current document saving no
set current document to document newDoc
paste
end repeat
set current document to document newDoc
set layerCount to count of layers of current document
set theWidth to item 1 of item 1 of thePrefs
set halfSize to (theWidth / 2)
set thirdSize to (halfSize * 3)
if layerCount is 2 then
translate art layer "Layer 1" of current document delta x -halfSize
translate art layer "Layer 2" of current document delta x halfSize
else if layerCount is 3 then
translate art layer "Layer 1" of current document delta x -theWidth
translate art layer "Layer 3" of current document delta x theWidth
else if layerCount is 4 then
translate art layer "Layer 1" of current document delta x -thirdSize
translate art layer "Layer 2" of current document delta x -halfSize
translate art layer "Layer 3" of current document delta x halfSize
translate art layer "Layer 4" of current document delta x thirdSize
end if
end tell
end repeat
end open

Studio Log

Back