Hack 6 Open PDF Files Your Way on Windows

 < Day Day Up > 

Hack 6 Open PDF Files Your Way on Windows

figs/expert.gif figs/hack6.gif

Multipurpose PDF defies the double-click, so make a right-click compromise. Impose your will on Internet Explorer or Mozilla with a registry hack .

In Windows, you double-click to open a PDF in the default viewer. But what if you have a couple of different Acrobat profiles from [Hack #5] ? Or maybe you want a quick way to open a PDF inside your web browser [Hack #9] ? Add these file-open options to the context menu that appears when you right-click a PDF file. You can even configure Windows to use one of these options when double-clicking a PDF file. Convincing web browsers to open PDFs your way takes a little more work.

Windows XP and 2000 offer a convenient way to open a PDF file using an alternative application. Right-click your PDF file and select Open With from the context menu. A submenu will open with a variety of alternatives. Your options might include Illustrator and Photoshop, for example.


1.7.1 Add an "Open with Acrobat Profile . . . " Option to PDF Context Menus

In [Hack #5] we used a batch program to switch between named Acrobat profiles. You can add these profiles to your PDF context menu, too. In the steps that follow, substitute your profile's name for production .

Windows XP and 2000:

  1. In the Windows File Explorer menu, select Tools Folder Options . . . and click the File Types tab. Select the Adobe Acrobat Document (PDF) file type and click the Advanced button.

  2. Click the New . . . button and a New Action dialog appears. Give the new action a name: Acrobat : production .

  3. Give the action an application to open by clicking the Browse . . . button and selecting cmd.exe , which lives somewhere such as C:\windows\system32\ or C:\winnt\system32\ .

  4. Add these arguments after cmd.exe , changing the paths to suit, so it looks like this:

     C:\windows\system32\cmd.exe /  C c:\switchboard.bat production "%1"  

  5. Click OK, OK, OK and you are done.

Windows 98:

  1. In the Windows File Explorer menu, select Tools Folder Options . . . and click the File Types tab. Select the Adobe Acrobat Document (PDF) file type and click the Edit . . . button.

  2. Click the New . . . button and a New Action dialog appears. Give the new action the name Acrobat : production .

  3. Give the action an application to open by clicking the Browse . . . button and selecting command.com , which lives somewhere such as C:\windows\ .

  4. Add these arguments after command.com , changing the paths to suit, so it looks like this:

     C:\windows\command.com  /C c:\switchboard.bat production "%1"  

  5. Click OK, OK, OK and you are done.

1.7.2 Add an "Open in Browser" Option to PDF Context Menus

This procedure adds an Open in Browser option to PDF context menus, but you can adapt it easily to use any program that opens PDFs. Viewing a PDF from inside a web browser enables you to spawn numerous views [Hack #9] into the same PDF, which can be handy. Opening a PDF in a web browser requires Adobe Acrobat or Reader [Hack #1] .

Windows XP, 2000, and 98:

  1. In the Windows File Explorer menu, select Tools Folder Options . . . and click the File Types tab. Select the PDF file type and click the Advanced button (Windows XP and 2000) or the Edit . . . button (Windows 98).

  2. Click the New . . . button and a New Action dialog appears. Give the new action a name: Open in Browser .

  3. Give the action an application to open by clicking the Browse . . . button and selecting your favorite browser. Explorer fans select iexplore.exe , which lives somewhere such as C:\Program Files\Internet Explorer\ . Mozilla fans select mozilla.exe , which lives somewhere such as C:\ Program Files\mozilla.org\Mozilla\ .

  4. Add " %1 " to the end, so it looks like this:

     "C:\Program Files\Internet Explorer\iexplore.exe"  "%1"  

  5. Click OK, OK, OK and you are done.

If you want to use an application such as Illustrator or Photoshop, it probably has its own entry in the File Explorer's Tools Folder Options File Types dialog. If it does, use its native Open action as a model for your new PDF Open action.


You can set the action that Windows performs when you double-click a PDF by opening the Edit File Type dialog (Tools Folder Options . . . File Types PDF Advanced), selecting the action, and then clicking Set Default.

1.7.3 Open Online PDFs Using Reader, Even When You Have Full Acrobat

The previous instructions enable you to set the default application Windows uses when you double-click a PDF file. This default setting does not affect your browser, however, when you click a PDF hyperlink. Sometimes, for example, you would rather have online PDFs automatically open in Reader instead of Acrobat.

The trick is to make a change to the Windows registry. After installing Acrobat or Reader, Explorer and Mozilla both consult the HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe registry key to find the path to a PDF viewer. You could change the default for this key to C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe , for example, and your browser would open online PDFs with Reader instead of Acrobat.

If you have Acrobat or Reader already running when you open an online PDF, the browser will use this open viewer instead of the viewer given in the registry key.

 < Day Day Up > 


PDF Hacks.
PDF Hacks: 100 Industrial-Strength Tips & Tools
ISBN: 0596006551
EAN: 2147483647
Year: N/A
Pages: 158
Authors: Sid Steward

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net