PDF Hacks: 100 Industrial-Strength Tips & Tools
| < Day Day Up > |
Hack 9 Browse One PDF in Multiple Windows
Tear off pages and leave them on your desktop for reference as you continue reading . Both Adobe Reader and Acrobat confine us to a linear view of documents. Often, for instance, page 17 of a file contains a table I would like to consult as I read page 19, and Acrobat makes this difficult. Here are a couple ways to open one PDF document in many windows, as shown in Figure 1-9. These tricks work with both Acrobat and the free Reader. Figure 1-9. Using your favorite web browser to open one PDF document in many windows
1.10.1 Read PDF with Your Web Browser
One quick solution is to read the PDF from within your web browser. When you open a new browser window (or Mozilla tab), it will duplicate your current PDF view, giving you two views of the same document. This works in Internet Explorer by default. Mozilla requires a little configuration. In Mozilla, select Edit Figure 1-10. Configuring Mozilla to show the current document in newly opened windows and tabs
Drag-and-drop a PDF into your browser to open the PDF. Acrobat/Reader should display the PDF inside the browser. Select File
If trying to open a PDF inside your browser causes it to open inside of Acrobat/Reader instead, check these settings (Windows only):
If you use Acrobat instead of Reader, you will find that many Acrobat-specific features are not available from inside the browser. And, Acrobat won't allow you to save changes to a PDF file, as long as it is also visible in a browser. Close the other, browser-based views to unlock the file before saving. To get a good blend of both Acrobat features and browser-based PDF viewing, we have a simple Acrobat/Reader JavaScript plug-in that enables you to invoke this "browser view" as needed from Acrobat or Reader. Also look into adding an "Open with Browser" option [Hack #6] to the PDF context menu. 1.10.2 Open a New PDF View from Acrobat or Reader
The following little JavaScript adds a menu item to Acrobat/Reader that opens your current PDF inside a browser window, giving you two views of the same document. To use this hack with Acrobat, you will need to disable Acrobat's web capture functionality by unplugging [Hack #4] its Web2PDF ( WebPDF.api ) plug-in. 1.10.2.1 Configure Mozilla
If Mozilla is your default browser and you're using Windows, read this section for possible configuration changes. When Java is disabled, Mozilla often fails to display PDF inside the browser window; it tries to open PDF using an external program, instead. Select Edit To run this hack with Acrobat 5, you will need to trick Mozilla into keeping its DDE ears open for Acrobat's calls. Mozilla activates DDE when it opens, then deactivates it when it closes . We'll open Mozilla and then alter the Windows http handler. This tricks Mozilla into thinking it is no longer the default browser. Under this illusion, Mozilla won't remove the DDE registry entries it created on startup.
The -nostomp argument is not really a Mozilla parameter. By simply adding this text to the Open action, you trick Mozilla into thinking it is no longer the default browser. 1.10.3 The Code
Copy one of the following scripts into a file called open_new_view.js and put it in your Acrobat or Reader JavaScripts directory. Choose the code block that suits your default browser. [Hack #96] explains where to find the JavaScripts directory on your platform. Restart Acrobat/Reader, and open_new_view.js will add a new item to your View menu. The script in Example 1-1 is for Mozilla users and opens the PDF to the current page. The script in Example 1-2 is for Internet Explorer users and opens the PDF to the first page. Example 1-1. open_new_view.moz.js
// open_new_view.moz.js ver. 1.0 (for Mozilla users) // app.addMenuItem( { cName: "-", // menu divider cParent: "View", // append to the View menu cExec: "void(0);" } ); // app.addMenuItem( { cName: "Open New View &3", // shortcut will be: ALT-V, 3 cParent: "View", cExec: "this.getURL( this.URL+ '#page='+ (this.pageNum+1), false );", cEnable: "event.rc= (event.target != null);" } );
Example 1-2. open_new_view.ie.js
// open_new_view.ie.js ver 1.0 (for Internet Explorer users) // app.addMenuItem( { cName: "-", // menu divider cParent: "View", // append to the View menu cExec: "void(0);" } ); // app.addMenuItem( { cName: "Open New View &3", // shortcut will be: ALT-V, 3 cParent: "View", cExec: "this.getURL( this.URL, false );", cEnable: "event.rc= (event.target != null);" } );
You can download these JavaScripts from http://www.pdfhacks.com/open_new_view/. 1.10.4 Running the Hack
After you restart Acrobat, open a PDF document. From the View menu, select Open New View. Your default browser should open and display the PDF, giving you two views of the same PDF. |
| < Day Day Up > |