Digital Action or Imaging aren’t legacy plugins. Apart from auto-rotating image output, they are still very relevant today and also enable the creation of image formats such as TIFF, JPEG, VDX, PDF-A, PDF-X…etc while setting image properties such as resolution, compression or downsampling…etc; which can’t currently be done using Connect alone. In addition, they can be used in combination with the Search module to create a true archiving system.
If you are simply interested in rotating the PDF page, the following VBScript will rotate all pages of PDF to portrait in a mixed orientation multipage PDF.
The PDF API is available here.
http://help.objectiflune.com/files/EN/alambicedit-api/AlambicEdit.html
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
Notice that you can get the orientation of pages with:
currentOrientation = myPDF.Pages(x).Orientation
and you can set the orientation with:
myPDF.Pages(x).Orientation = 180
Hence depending on the characteristics of your original PDF, the above script could be reduced to this:
dim myPDF, pageCount, x
Set myPDF = Watch.GetPDFEditObject
myPDF.open Watch.GetJobFileName,false
pageCount = myPDF.Pages.Count
for x = 0 to pageCount-1
myPDF.Pages(x).Orientation = 0
next
myPDF.Save False