I have a script which stamps page numbers and revision number on documents. The documents have a mixture of portrait and landscape sheets and are arranged "naturally" in the PDF for ease of on-line reading. However the customer wants the page numbers aligned when printed and filed (in portrait)
To achieve this I rotate all the landscape pages to portrait; stamp the page, then rotate them all back again. The stamp includes a document number and revision which goes in the bottom right hand corner as [C2] Rev [C3] I've attached the stamp file*,
Occasionally, one of two strange things occur
a) the revision number is not added
b) the complete revision text box is moved slightly to the right, and the revision is partially off the printable area.
I can't for the life of me work out why this is happening - I will have a go at repeating it.
But it's definitely in the PDF when viewed in Acrobat XI so I thought I'd mention it. I'm currently manually fixing this. (It could be an out-of-resource problem - Windows Seven professional 64b, SP-1, Intel i7-4600U , 8G memory)
The script is as below, with %1 being the current section letter. The FOR loop through the rotations file; the IF selects the rotation set which is for this section letter. (Back to front, but it works)
for /F "usebackq eol=; tokens=1*" %%i in (rotations.txt) do if %%i == %~1 PDFShellTools rotate -s Angle=-90 Pages=%%j "Section %~1.pdf"
PDFShellTools stamp -s StampRules=1- "DynCustomText='%~1','%DocNumber%','%Rev%'" Template=page.stp "Section %~1.pdf"
for /F "usebackq eol=; tokens=1*" %%i in (rotations.txt) do if %%i == %~1 PDFShellTools rotate -s Angle=90 Pages=%%j "Section %~1.pdf"
The rotations text contains the following sort of text.
A 8-9
B 2
D 42,44,46,48,50,52,54,56,58,60,62,64
M 9-13,25-42
;P
Q 2-8,80,275
;S