Problematic PDF download: Prevent IE from opening PDFs
Posted: Thu Dec 07, 2006 4:32 pm
Sometimes there is no link to the PDF you want to download, so you cannot use the standard "Save Target As" method (cf. http://wiki.imacros.net/SAVEITEM and Save Target As).
In these cases (and assuming there is no way to get the URL of the PDF by other means), you might automate downloading nevertheless: by preventing the browser from opening the PDF. If the document is neither opened in the embedded viewer (i.e. in the IE/iMacros browser window), nor opened by the Adobe Reader, then you can download it like any other file (using an ONDOWNLOAD command in your macro).
Here's how to prevent IE/iMacros browser from opening the PDF:
1) Change Adobe Acrobat Reader settings:
In case you don't want to make these changes to your profile/login, just create another user/profile, apply these changes to this user, and use iimRunner (cf. http://wiki.imacros.net/iimRunner, http://forum.imacros.net/viewtopic.php?t=1439) to have iMacros run under this user's profile.
In these cases (and assuming there is no way to get the URL of the PDF by other means), you might automate downloading nevertheless: by preventing the browser from opening the PDF. If the document is neither opened in the embedded viewer (i.e. in the IE/iMacros browser window), nor opened by the Adobe Reader, then you can download it like any other file (using an ONDOWNLOAD command in your macro).
Here's how to prevent IE/iMacros browser from opening the PDF:
1) Change Adobe Acrobat Reader settings:
- Run Adobe Reader
- From the main menu, select Edit - Preferences
- Click on Internet
- Uncheck the 'Display PDF in browser' setting (see Adobe Reader Preferences.png attachment)
- Windows 7:
- Open an elevated command prompt with administrator privileges (right-click Command Prompt from the Start Menu and select 'Run as administrator')
- Enter the following commands and press ENTER after each one:
- assoc .pdf=
- ftype acrobat=
- Windows XP:
- Open a My Computer/Windows Explorer window
- Select Tools - Folder Options from the menu
- Select the File Types tab
- Find the PDF extension and delete it (see Folder Options.png attachment)
In case you don't want to make these changes to your profile/login, just create another user/profile, apply these changes to this user, and use iimRunner (cf. http://wiki.imacros.net/iimRunner, http://forum.imacros.net/viewtopic.php?t=1439) to have iMacros run under this user's profile.