Tips & Tricks

Silently Printing Your PDF

March 23, 2000

Advertisement
Advertisement
 

If you have ever had the need to give your end users a 'Print' button on the page then read on.

Select the Form Field tool (see Figure 1.1), and draw a small button sized area on the page (see Figure 1.2). When the Form Field dialog comes up give the Field a name (myButton) and select 'Button' from the 'Type' list box (see Figure 1.3).


Figure 1.1


Figure 1.2


Figure 1.3

Click the 'Actions' tab and select the 'Mouse Up' event and click the 'Add...' button. Select 'JavaScript' from the 'Type' listbox, and click the 'Edit...' button (see Figure 1.4).


Figure 1.4

Type the following Javascript code into the editor window (case sensitive) to (see Figure 1.5):


Figure 1.5

Print the Current Page only:

this.print(false,this.pageNum, this.pageNum,false);    

OR

Print from the current page to the end of the document:

this.print(false,this.pageNum, this.numPages,false);

The four parts of the javascript print command are:

  • True/False - Determines whether the 'Print Dialog' window is displayed.
  • Start Page Number
  • End Page Number
  • True/False - Determines whether the 'Cancel' print job dialog window is displayed.

You can type any valid page number in place of the 'this.pageNum' and 'this.numPages' statements.

Note: If you want to put some text on the 'face' of the button see below Figure 1.6 and Figure 1.7.


Figure 1.6


Figure 1.7

Copyright Dave Wraight & Planet PDF. No unauthorised reproduction, distribution or publication permitted.

Related Products at PDF Store

PitStop Professional

The industry standard that combines preflight, interactive editing and automated correction capabili... View full product details
Download free demo

ARTS PDF Aerialist

Take Acrobat to the next level with advanced splitting and merging; flexible bookmark creation and m... View full product details
Download free demo

Quite Imposing Plus

A plug-in for Adobe Acrobat to perform imposition. Additional functionality is added to that of Quit... View full product details
Download free demo

PDF In-Depth Free Product Trials Ubiquitous PDF

Nitro PDF Professional

the perfect PDF product for business and enterprise, combining an extremely competitive price with a...

Download free demo

XpdfViewer

This ActiveX control (OCX) provides a PDF file viewer component, enabling developers to add PDF viewing...

Download free demo

Ubiquitous PDF: PDF eBooks-Library

If you are looking for a good store of PDF content, you could do a lot worse than visiting eBooks-Library.com...

September 03, 2009
Search Planet PDF
more searching options...







Download PDF Creator

Download The Best of Planet PDF volume 2
Planet PDF Newsletter
Most Popluar Articles
Features

Collating PDFs using JavaScript

Despite the numerous benefits, there can be potential issues with the conversion of paper documents into electronic archives. When scanning paper pages into PDF, it's possible to end up with the odd- and even-numbered pages in separate PDF files. It can be very time-consuming to collate them manually, but there is an easier way. Sean Stewart explains.

Featured Product

BCL easyPDF SDK

BCL easyPDF SDK is a set of PDF Programming Libraries designed specifically to help Software Developers / Programmers build and deploy enterprise class PDF applications for corporate wide PDF...

Platinum Sponsor
Create & Edit PDF - Nitro PDF Software

ARTS PDF

Silver Sponsors

PDF-Tools enfocus

QuickPDF: The Unrivaled PDF Developer Toolkit