These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Troubleshooting printing issue related to print button scripts

dkueker
Registered: Oct 19 2009
Posts: 7
Answered

Hi There,

I am adding print buttons throughout a large PDF book (452 pages). For instance, I'm adding a print button at the beginning of each chapter to print only the pages from that chapter. Within most chapters, I've also added a print button to a single page within a chapter so that the user can complete and print their input on the interactive fields I've included on that page.

In chapters where I have more than one print button when I execute the "Print Chapter" button it consistently prints 6-8 copies of the very last page of the chapter (the last page specified in the print range). However, the print buttons within the chapters are printing the correct pages (and the correct quantity) per the code I specified. Any ideas on what I might be doing wrong? Any ideas would be very much appreciated.

Here's an example: The code for the "Print Chapter 1" button (this one prints 6 extra copies of page 37)

this.print({
bUI: true,
bSilent: true,
bShrinkToFit: true,
nStart: 6,
nEnd: 37,
});

In chapter 1 I've included another print button near the end of the chapter (this one prints one copy of page 33 as it is supposed to).

this.print({
bUI: true,
bSilent: true,
bShrinkToFit: true,
nStart: 33,
nEnd: 33
});

My Product Information:
Acrobat Pro 8.1.6, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Not sure if that's the problem, but in the reference file it says:
If nStart and nEnd parameters are used, bUI must be false.

Also, remember they are 0-based, so nStart:6 nEnd:37 will print pages 7-38.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

dkueker
Registered: Oct 19 2009
Posts: 7
Thanks Try67 - I originally had the UI parameter set to false (as shown in the scripting guide). I set it to true to work around a different issue I was experiencing when it was set to false.

When it is set to false, I get a permission message that says "This document is trying to send info to the printer. Allow: Yes or No" (Or something similar to that). If I choose no, it disables all of the print buttons throughout the document until I close and open the document again. If I choose Yes then it prints fine. Does anyone know of a way to stop this security feature from showing up?
sharjor
Registered: Jan 21 2010
Posts: 1
javascript is uncentered. The printing doesn't line up under the pictures.