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 - pdf preview handler for vista x64 - office 2007 pdf reader - office 2007 pdf viewer - pdf preview vista 64 - outlook wav previewer - outlook .wav previewer - PDF VIEWER HANDLER FOR VISTA - msdn magazine pdf preview error - vista 64 pdf preview - outlook 2007 preview attachments - PDF file preview - pdf preview handler for vista 64 - preview file in outlook 07 - wav outlook previewer - outlook wav file previewer - pdf reader for office 2007 - preview not available for pdf file in office 2007 - pdf previewer for vista - 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 previewers for outlook 2007 - pdf viewer for office 2007 - adobe pdf previewer - adobe preview outlook - adobe file previewer - change the preview for file in outlook 2007 - outlook preview pane PDF handler - Outlook 2007 preview file - preview wav file outlook 2007 - wav file previewer outlook - wav file previewers - acrobat previewer for office 2007 - integrate office outlook attachment preview - message preview not working on Outlook 2007 after installing AVG 9 - msdn magazine pdf preview handler - outlook 2007 mail voice attachment wav file won\'t open Outlook 2007 - outlook pdf viewer handler for vista error - outlook 2007 attachment previewers - Outlook 2007 file previewers - pdf preview handler for vista adobe - preview pdf vista - upload handlers. vista - WEBARCHIVE File office 2007 - how to remove preview handlers office 2007 - office 2007 pdf reader -