In http://blog.aloaha.com/2012/09/13/split-large-pdf-into-multiple-small-pdfs/ we explain how to use the Aloaha API to split large PDF documents into many small documents. In case someone is not able to write or use any scripting language it is possible to use the Aloaha Scripting Engine. Below you find the same sample code implemented as Aloaha Workflow Definition File:
‘define variable for output path
Type=set
ValueName=OutPutPath
Value=c:\pdf\out\
Nextblock=dirblock
[dirblock]
‘enumerate files in input path
Type=dir
Extension=pdf
Directory=%OrgPath%
ResultName=files
Nextblock=CheckLoaded
[CheckLoaded]
‘if enumerated files empty then end – else call com function
Type=condition
Input1=%files%
Input2=”"
TrueBlock=end
FalseBlock=CallCOMFunction
[CallCOMFunction]
Type=com
Object=aloahapdf.edit
Function=SplitAndSave
Parameter=5
Parameter0=%OrgPath%
Parameter1=%OutPutPath%
Parameter2=”Der Rechnungsbetrag wird von Ihrem Konto”
Parameter3=”"
Parameter4=Kunden-Nr.:
ResultName=CallCOMFunctionResult
Nextblock=foreachblock
[foreachblock]
‘loop through original files and delete them
Type=foreach
Nextblock=deletefile
LoopName=DeleteLoop
LoopCSV=%files%
ResultName=LoopTemp
[deletefile]
Type=delfile
DeleteFile=%LoopTemp%
Nextblock=endeachblock
[endeachblock]
Type=endeach
LoopName=DeleteLoop
Nextblock=end
1 Trackback or Pingback for this entry
September 13th, 2012 on 10:20 pm
[...] http://blog.aloaha.com/2012/09/13/split-large-pdf-into-multiple-small-pdfs-with-workflow-engine/ [...]