Groups > Software Support > Adobe Acrobat Scripting > Re: Print page range button not working




Print page range button not working

Print page range button not working
Wed, 7 May 2008 11:20:34 -0700
We have been trying to add print functionality to a PDF.
Specifically a button that will launch the print dialog box and print
a specific page range.

We are working in an existing PDF created with Acrobat 8
We've created a button. Written a script for the button.

We have attempted with several scripts and always have mixed results.

Mostly the page range defaults to one page, instead of the range (1-3) sometimes
it defaults to the entire document. Sometimes it works.

We had one that worked consistently, then after we set the document properties,
it stopped.

Post Reply
Re: Print page range button not working
Wed, 7 May 2008 11:50:29 -0700
What document properties did you change? Most will not affect JavaScript but
some like the security setting to prevent modifying form fields will disable all
buttons as well as all other form fields.

You can create a JavaScript to print either using the "PrintParms"
object or not using the object. I find not using the "PrintParms"
object more reliable.

The following code

this.print({bUI: true,
nStart: 0,
nEnd: this.numPages - 1,
bSilent: false,
bShrinkToFit: false,
bPrintAsImage: false,
bReverse: false,
bAnnotations: false
 });

Post Reply
Re: Print page range button not working
Wed, 7 May 2008 12:45:50 -0700
I changed the document properties for Navigation tab and Page layout. I don't
think the property changes are affecting the javascripts on the button but the
print range in the print dialog window gets selected differently each time
clicking the print button, while the same pdf file was opened for the whole
time.

I tried JavaScripts to print both the "PrintParms" object or not using
the object. I agree with you that not using the "PrintParms" object is
more reliable, and found out that the page range works fine when bUI is turned
off. It seems like the javascript get screwed when the print dialog box opens.

I listed the code that I used for your reference.

this.print({
bUI: true,
bSilent: true,
bShrinkToFit: true,
nStart: 0,
nEnd: 1
Post Reply
about | contact