Tips & Tricks

Printing Current Page with JavaScript

September 07, 2002


You can execute a script to print a given page within a multiple page document with or without the Print dialog box opening.

To print a page from a button action without the print dialog box opening use the following code:

this.print (false, this.pageNum,

Note that false will keep the dialog box from opening and the item this.pageNum repeated twice in the statement will print only the current page in view. Any other pages in the file will not print.

To print the entire document without the print dialog box opening, use:

this.print (false); 

PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Quick PDF Library

Get products to market faster with this amazing PDF developer SDK. Over 900 functions and an equally...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.