OK, I would definitely use a Run Script in the workflow to preprocess the PDF before using it as a background in the Designer.
Copy and paste the following script in the Run Script action and set the language to VBScript. In this example, all rotated PDF files are saved with their original name in E:\OLForums\156122\tempPDF\. Edit the path to suit your environment.
The next step in your process can be a Folder capture action which grabs the PDF from the above path and pass it to either the Execute Data Mapping or All In One step.
dim myPDF, myRotatedPDF, myRect
dim x, pageHeight, pageWidth, tempright, myRotatedPDFName
myRotatedPDFName = Watch.GetOriginalFileName
Set myPDF = Watch.GetPDFEditObject
myPDF.open Watch.GetJobFileName,false
Set myRotatedPDF = Watch.GetPDFEditObject
myRotatedPDF.create “E:\OLForums\156122\tempPDF\” & myRotatedPDFName
Set myRect = CreateObject(“AlambicEdit.PdfRect”)
for x = 0 to myPDF.Pages.Count-1
Set myRect = myPDF.Pages(x).size
pageWidth = myRect.Right
pageHeight = myRect.Top
if (pageWidth < pageHeight) then
myRect.Bottom = 0
myRect.Left = 0
myRect.Top = 842 'height in points for A4
myRect.Right = 595 ' width in 595 points for A4
myRotatedPDF.Pages.insert x, myRect
myRotatedPDF.Pages(x).merge2 myPDF.Pages(x),0,0,0,1
else
tempright = myRect.Right
myRect.Right = myRect.Top
myRect.Top = tempright
myRotatedPDF.Pages.insert x, myRect
myRotatedPDF.Pages(x).merge2 myPDF.Pages(x),0,myRect.Top,90,1
end if
next
myRotatedPDF.save false
The Alambic API documentation is available here:
http://help.objectiflune.com/files/EN/alambicedit-api/AlambicEdit.html
The Watch API documentation is available here:
http://help.objectiflune.com/en/pres-workflow-user-guide/8.5/#Workflow/Scripts/Watch_Object.html