Modify Vista and Office 2007 File and Attachment Preview Handlers to Support Foxit PDF Reader

In Windows Vista’s File Explorer and Microsoft Office Outlook 2007 have a feature that allows you to preview an attachment in email message from within the Outlook 2007 itself directly after click on the preview option when you select an attachment, or the content of a file in Vista File Explorer when highlighted. The preview will be shown in preview pane in Outlook 2007 and Vista layout, and thus users need not to open the files in external programs or applications.

Vista Preview Pane
XML file preview in Windows Vista

By default, the built-in native preview feature has only a few supported handlers for limited file types and extensions such as Word documents, PowerPoint presentations, Excel spreadsheets, \font files, video and audio files, and a variety of other file types that are commonly sent as attachments. PDF (Portable Document Format) documents which is popular and widely used is left out. However, Microsoft Developer Network (MSDN) provides a sample preview handlers which you can download and install in order to has the ability to preview Adobe PDF documents in Vista and Outlook 2007. However, the developer use Adobe ActiveX control for the Acrobat PDF reader implementation, which will require users to have Adobe Reader or Adobe Acrobat Reader installed.

If you’re using alternative Acrobat PDF reader like Foxit Reader, then you will need to modify the PDF preview handler source code so that Windows Vista and Office Outlook 2007 can support Foxit Reader API properly, as advised by timheuer.

The file to modify is PdfPreviewHandler.cs from the free preview handlers add-on download from MSDN (link at the bottom). Go to about line 41 and change to the following:


// Foxit Reader ActiveX
public PdfAxHost()
: base("d46a7492-4b6c-446f-8100-4812edf406c9") { }

Next, the pinvoke method has to be changed as Adobe ActiveX control and API uses a LoadFile() signature, but foxit uses an OpenFile() signature. Foxit also uses a second parameter which is the starting page of the document. So locate the LoadFile in the file, and change to OpenFile to looks like the following:


_ocx.GetType().InvokeMember(
"OpenFile", BindingFlags.InvokeMethod, null, // changed to OpenFile
_ocx, new object[] { fileName, 0 }, CultureInfo.InvariantCulture); // added 0 parameter to array

Save the file, compile and deploy. And now you will have PDF preview capability in Windows Vista and Office 2007 without the need of Adobe Acrobat Reader. Note that you will need to get Foxit Reader SDK (ActiveX) in order for this modified version of Foxit PDF previewer to work, not just installing Foxit Reader, with charge or license fee applied.


One Response to “Modify Vista and Office 2007 File and Attachment Preview Handlers to Support Foxit PDF Reader”

  1. dott
    May 27th, 2008 14:40
    1

    There is no need to modify nothing, just associate .pdf extension(there are a lot of preview handler association editors) with “MSDN Magazine Internet Explorer preview handler” and you will have working the real FoxitReader ActiveX as preview handler not that buggy and limited “FoxitReaderSDK(ActiveX)”. Same for every file type that InternetExplorer or one of his plugins can handler.

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.
Custom Search

New Articles

Incoming Search Terms for the Article

pdf preview handler for vista x64 - PDF VIEWER HANDLER FOR VISTA - pdf preview vista 64 - Office 2007 pdf reader - pdf preview handler for vista error - msdn magazine pdf preview error - office 2007 pdf viewer - pdf preview handler for vista - vista 64 pdf preview - outlook 2007 preview attachments - pdf viewer office 2007 - pdf viewer for office 2007 - pdf previewer for vista - outlook wav previewer - foxitreader vorschau vista explorer - pdf preview vista - preview wav in outlook - previsualizar pdf vista - How do I set Outlook 2007 to preview in Acrobat reader instead of Word? - office 2007 unable to preview adobe file - file preview vista - vista pdf preview - file previewers for outlook 2007 - pdf preview handler for vista 64 - pdf view handler for vista - outlook .wav previewer - Outlook 2007 preview not available - adobe pdf attachment preview add-in - file previewers for outlook - office pdf previewer - outlook pdf file preview not working - Attachment and Document Previewers htm - office 2007 pdf viewer - outlook 2007 wav file previewer - Outlook 2007 attachment previewers - outlook 2007 attachment previewer acrobat reader - pdf preview handler vista x64 - preview pdf files in vista - Foxit reader upgrade for Vista - outlook 2007 .wav previewer - outlook document previewer - "pdf viewer" in office 2007 - download Preview Handlers - file associations in outlook 2007 - i want to open attachment files in pdf reader in outlook 2007 - jpeg files not opening in outlook 2007 - office 2007 file viewer - outlook preview attachments wav - pdf preview for vista - Preview Handlers lots Windows 7 -