I'm relatively new to Automation Engine. I'm trying to create a report in a workflow that will be multi-page PDF. Each individual page is generated by steps within the workflow and I am trying to concatenate them together.
I have tried multiple ways of doing this, all with the same result of a one page PDF that is very tall. Then I started experimenting with doing it via a VB script and executing it via the 'Run Script' ticket within the workflow.
I have created and tested a VB script that works well when NOT executed from an Esko workflow. When executed from an Esko workflow it is failing at the point of opening the first input file (and subsequent input files) as a PDDoc object.
My 'Run Script' ticket indicates to run on my local PC where I have Acrobat Pro installed. This is also where I have tested the VB script and it executes correctly.
Can someone please help me with determining why the open of the input file continues to fail when executed via the workflow?
Below is my VB script:
Function Main(inputs, outputFolder, params)
dim app
dim srcDoc, destDoc
dim blnReturnValue
set app = CreateObject("AcroExch.App")
set srcDoc = CreateObject("AcroExch.PDDoc")
set destDoc = CreateObject("AcroExch.PDDoc")
destDoc.Create
For Each input In inputs
'This open is not working.
blnReturnValue = srcDoc.Open(input)
if blnReturnValue = 0 then
wscript.echo "input=" & input
wscript.echo "input open failed"
end if
blnReturnValue = destDoc.InsertPages (destDoc.GetNumPages() - 1, srcDoc, 0, srcDoc.GetNumPages(), 0)
blnReturnValue = srcDoc.Close
Next
blnReturnValue = destDoc.Save (1, outputFolder & "/" & "NorasTest.pdf")
blnReturnValue = destDoc.Close
blnReturnValue = app.CloseAllDocs()
set srcDoc = nothing
set destDoc = nothing
blnReturnValue = app.Exit
set app = nothing
Main = blnReturnValue
End Function
Thanks,
Nora
I have tried multiple ways of doing this, all with the same result of a one page PDF that is very tall. Then I started experimenting with doing it via a VB script and executing it via the 'Run Script' ticket within the workflow.
I have created and tested a VB script that works well when NOT executed from an Esko workflow. When executed from an Esko workflow it is failing at the point of opening the first input file (and subsequent input files) as a PDDoc object.
My 'Run Script' ticket indicates to run on my local PC where I have Acrobat Pro installed. This is also where I have tested the VB script and it executes correctly.
Can someone please help me with determining why the open of the input file continues to fail when executed via the workflow?
Below is my VB script:
Function Main(inputs, outputFolder, params)
dim app
dim srcDoc, destDoc
dim blnReturnValue
set app = CreateObject("AcroExch.App")
set srcDoc = CreateObject("AcroExch.PDDoc")
set destDoc = CreateObject("AcroExch.PDDoc")
destDoc.Create
For Each input In inputs
'This open is not working.
blnReturnValue = srcDoc.Open(input)
if blnReturnValue = 0 then
wscript.echo "input=" & input
wscript.echo "input open failed"
end if
blnReturnValue = destDoc.InsertPages (destDoc.GetNumPages() - 1, srcDoc, 0, srcDoc.GetNumPages(), 0)
blnReturnValue = srcDoc.Close
Next
blnReturnValue = destDoc.Save (1, outputFolder & "/" & "NorasTest.pdf")
blnReturnValue = destDoc.Close
blnReturnValue = app.CloseAllDocs()
set srcDoc = nothing
set destDoc = nothing
blnReturnValue = app.Exit
set app = nothing
Main = blnReturnValue
End Function
Thanks,
Nora