Author Topic: Possible bug - Stamping and Rotating combination  (Read 7165 times)

0 Members and 1 Guest are viewing this topic.

conrad.drake

  • Newbie
  • *
  • Posts: 35
Possible bug - Stamping and Rotating combination
« on: November 06, 2015, 06:06:18 AM »
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


RTT

  • Administrator
  • *****
  • Posts: 907
Re: Possible bug - Stamping and Rotating combination
« Reply #1 on: November 07, 2015, 10:23:21 PM »
Does the problem always occur with a specific PDF file, or it is a random behavior? If specific to some PDFs, please send me one sample so I can test here.

Regarding the method you are using. Instead of rotating the landscape oriented pages, you may apply, to these specific pages, a rotated stamp (see attachment).

conrad.drake

  • Newbie
  • *
  • Posts: 35
Re: Possible bug - Stamping and Rotating combination
« Reply #2 on: November 08, 2015, 11:32:59 PM »
Over the next month or so I should be doing plenty of this sort of thing - and I will try to reproduce and qualify this behaviour. I've got two examples but I'm not at liberty to release them.

Ps -  thanks for the stamping  tip - will try that later!!
Pps - it is reproducible.   One file which does it has a mixture of page sizes and layouts.   I'll see if I can trim it down to a working subset that I can send.
Ppps - I can confirm it is the stamp action not the rotation (which I suspected). 

conrad.drake

  • Newbie
  • *
  • Posts: 35
Re: Possible bug - Stamping and Rotating combination
« Reply #3 on: November 09, 2015, 03:15:49 AM »
Ok, I have a single page which reliably fails which I can share.  Attached is the original file, a (mis) stamped file and  the stamp template.

It'll be interesting to see if it misbehaves for you.

Command line was:

PDFShellTools stamp -s StampRules=1- "DynCustomText='R','RAUE001','0A'" Template=page.stp                         "Section R8.pdf"

The stamp works with other 8.26 x 11.69  sheets  (as reported by Adobe)  And with 7.5" x 10" & A3 sheets

RTT

  • Administrator
  • *****
  • Posts: 907
Re: Possible bug - Stamping and Rotating combination
« Reply #4 on: November 09, 2015, 10:38:43 PM »
Thanks for the sample PDF. I've found the problem and I've just finished fixing it. It occurs with pages that have the media box origin with an offset. Should be OK in the next release.

conrad.drake

  • Newbie
  • *
  • Posts: 35
Re: Possible bug - Stamping and Rotating combination
« Reply #5 on: November 10, 2015, 12:50:48 AM »
Great news!  Thanks again!