Saturday, March 17, 2007

Screenshot of the PDF Preview Handler in action I know a lot of people out there using either Windows Vista or Office 2007 have been waiting for someone to come out with a good PDF preview handler that lets you preview PDF attachments in Outlook 2007 or from the explorer in Windows Vista.

Unforutnately, I haven't yet seen an official PDF preview handler from any of the companies that make PDF readers.  I decided that since Adobe Acrobat includes a useful PDF ActiveX control, it shouldn't be too difficult to wire everything up with that control to provide a preview handler, so I set out to write that.

After a few hours of tweaking some code, I'm happy to make available my PDF Preview Handler using Adobe Acrobat Reader.

System Requirements:

  • Outlook 2007 or Windows Vista
  • Microsoft .NET Framework 2.0
  • Adobe Acrobat Reader 7.x or later
  • Compatible with 32-bit or 64-bit Windows Vista

Download no longer available

This preview handler was written with help of various code samples for COM interop found online.  Without the help of the .NET community this tool wouldn't be possible.

This software is provided "as-is" without any warranty.  While I've tested it in a number of enivornments, I can't guarnetee it will work everywhere or always.  No support is offered or available for this freeware utility.

Update: Since Adobe has released a version of the Adobe Reader (version 8.1) that includes a PDF Preview Handler, I've discountinued the download.

Sunday, March 18, 2007 12:01:30 PM (Pacific Standard Time, UTC-08:00)
willing to share the COM code :-)? i assume since you built in a COM server you aren't using the Vista-specific APIs and this will work with Outlook 2007 on WinXP no problem. That's a feature request for me that I'd like to accommodate...
Tuesday, March 20, 2007 1:41:09 PM (Pacific Standard Time, UTC-08:00)
timheuer: works like a charm on XP. I'm using Acrobat Reader 8 here.
ryan: thank you. I was annoyed to find that Adobe hadn't gotten around to providing this yet.
Ken
Monday, March 26, 2007 8:09:35 AM (Pacific Standard Time, UTC-08:00)
Works for me too, like a dream. Any chance of seeing the code. I would love to have a go at doing an HTML previewer for XP users? or maybe you could do it?

Top work all the same.
Monday, March 26, 2007 1:29:44 PM (Pacific Standard Time, UTC-08:00)
Sweetness!

Thanks.
Tuesday, March 27, 2007 4:32:37 AM (Pacific Standard Time, UTC-08:00)
Hello Ryan,

I am trying to implement other Preview Handlers that work for Office 2007 on XP. I have been trying to learn from the guidelines mentioned in the sidebar you wrote for Stephen Toub's MSDN Mag article. But, its been tough going. Can you help? Of course, one way would be to share your code, and I will make changes to that code (If only life was that easy). Another way is if you can guide me how to integrate the framework in the MSDN Mag with the COM server Code in the Code Project article.

Oh, also, the PDF plugin works like a DREAM.... thanks a bunch for that one.

Thanks,
Vaibhav
Tuesday, March 27, 2007 7:44:07 AM (Pacific Standard Time, UTC-08:00)
The viewer is working great on my XP box, but I think I may have found a bug.

Outlook hangs when I am previewing a PDF in the reading pane and attempt to switch to my calendar from the navigation pane. When this occurs I am forced to kill Outlook manually and restart. It's not enough to make me uninstall the viewer, I just need to remember to close PDF's prior to switching modes.

I am using XP Pro + sp2, Office 2007 Ultimate, and Acrobat 8.
Wednesday, March 28, 2007 2:21:08 PM (Pacific Standard Time, UTC-08:00)
This works great. I'd recommend, however, that you host a web-browser control instead of Adobe's control. This would allow your viewer to work for HTML and PDF files with no extra work as the browser control will invoke the Acrobat control automatically when presented with a PDF to show. Your previewer would also be able to show XML files, MHTML files, Flash files, and anything else IE already knows how to display.
Anthony Marchesini
Tuesday, April 03, 2007 5:49:24 AM (Pacific Standard Time, UTC-08:00)
I want to thank you for posting this addin....I am using Vista Home Premium with Office 2007 and the addin worked like a champ....Hallelujah for the internet!
Mark McDaniel
Wednesday, April 04, 2007 7:52:53 PM (Pacific Standard Time, UTC-08:00)
Great plugin!

I too experience a problem switching from a PDF preview to any other folder. It does seem that if you don't close the preview it will most definitely hang outlook. I can reliably crash outlook with this, I have have a folder in Outlook where I have just thrown in some PDF's (so each msg IS a PDF) and as there is no other component in the msg to switch too (remember, the whole msg IS a PDF), Outlook is toast.

Other than that - it's smooth! Nice work beating Adobe out the door!
Brendan
Thursday, April 05, 2007 8:26:09 AM (Pacific Standard Time, UTC-08:00)
I tried this on my Windows 2003 SP2 terminal server with Outlook 2007 - it keeps telling me I need Adobe installed - I already have Adobe 8.0 installed. If I answer yes, it takes me to Adobe's download page. If I answer no, it immediately exits.

Too bad - I think would be a great add.
Dean Colpitts
Friday, April 06, 2007 9:11:47 AM (Pacific Standard Time, UTC-08:00)
Perfect, thanks for this handy program, it works fine with Adobe 8 on Outlook 2007.
Saturday, April 07, 2007 1:03:33 PM (Pacific Standard Time, UTC-08:00)
It works great; I'm a fan. If you're interested in working on another one, I'd really like to see a .html/.htm previewer that uses the IE activeX control.
Dave Cortright
Sunday, April 08, 2007 6:54:11 PM (Pacific Standard Time, UTC-08:00)
I face the same issue as Dean Colpitts.
=============================================
I tried this on my Windows 2003 SP2 terminal server with Outlook 2007 - it keeps telling me I need Adobe installed - I already have Adobe 8.0 installed. If I answer yes, it takes me to Adobe's download page. If I answer no, it immediately exits.
=============================================
How ever, my OS is WindowXP SPK2 with Office 2007 Plus and Adobe Reader 8.0 installed. Any comment to resovle this issue?
I really want to have a try.
Thanks.
Frank
Sunday, April 08, 2007 8:54:59 PM (Pacific Standard Time, UTC-08:00)
If you're having problems with the installer reporting Acrobat isn't installed, try uninstalling Adobe Reader and then installing it again. The setup program checks to see if the ActiveX control is registered by looking for HKEY_CLASSES_ROOT\AcroPDF.PDF, and sometimes this key is lost or corrupt. Running repair doesn't seem to fix it, but a full uninstall followed by installing the program again usually fixes it up.
Monday, April 09, 2007 5:18:23 PM (Pacific Standard Time, UTC-08:00)
Hi Ryan,
After uninstall Adobe Reader and re-install it again. It works!
Good Job! Thanks again.
Frank
Monday, April 09, 2007 5:53:35 PM (Pacific Standard Time, UTC-08:00)
Hi Ryan,
One more thing, I found after I installed the plug-in, the usage of CPU by Outlook reach 99%,Is there anything else I need to do? Thanks.
Frank
Monday, April 09, 2007 6:02:10 PM (Pacific Standard Time, UTC-08:00)
Not sure about the 99% CPU usage. Does it persist if you restart Outlook and don't preview a PDF? Does it only start when you preview a PDF file? You might try starting Adobe Reader first, just to make sure all the prompts are out of the way. Does Reader work OK?
Wednesday, April 11, 2007 1:36:31 AM (Pacific Standard Time, UTC-08:00)
also had the problem that ol 2007 reached 100% of cpu use (amd 3200+) just first time after i installed the plugin. had to kill the ol-process, after restarting ol, it did not happen again (up till now). i just wondered why and found out that the error just occours if you switch from a pdf preview to a different folder without closing the preview, e.g. you hve to first switch from the pdf-attachement to the mail and then go to another folder.

installed it on xp sp2 with ol 2k7, ol connects to a exchange 2003 server.
peter
Tuesday, April 17, 2007 8:07:41 AM (Pacific Standard Time, UTC-08:00)
brilliant pluggin. works like a charm on on XP + office 07 enterprise.
Thanks allot.
Friday, April 20, 2007 4:04:24 AM (Pacific Standard Time, UTC-08:00)
thank you so much it's working really well..;-)
thierry
Monday, April 23, 2007 5:28:15 PM (Pacific Standard Time, UTC-08:00)
Just should add, it works with acrobat full version, not just reader. very good. well done.
cliff
Thursday, April 26, 2007 5:11:17 PM (Pacific Standard Time, UTC-08:00)
Here are a few more Preview handlers that can be downloaded for Office 2007 and Vista for ZIP, MSI, BIN, CSV and XPS file types.

http://thinkabdul.com/2007/04/19/free-xpsmsizipcsvbin-file-content-preview-handlers-for-microsoft-office-2007-windows-vista-preview-pane/
Steve
Tuesday, May 01, 2007 6:26:35 AM (Pacific Standard Time, UTC-08:00)
Works great on my Windows XP/Office 2007 combination. Thanks a million for your efforts!
Bill
Saturday, May 05, 2007 8:58:06 AM (Pacific Standard Time, UTC-08:00)
added.... http://pawelbojkowski.blogspot.com/2007/05/pdf-previewer-for-outlook-2007.html
Tuesday, May 08, 2007 2:26:28 AM (Pacific Standard Time, UTC-08:00)
It worked nicely for a while with German outlook2007 and Windows XP, but now I always receive an error. On my Laptop it's the same problem.

System.Runtime.InteropServices.COMException (0x80040154): Klasse nicht registriert (Ausnahme von HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
bei System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance(Guid& clsid, Object punkOuter, Int32 context, Guid& iid)
bei System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)
bei System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)
bei System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)
bei System.Windows.Forms.AxHost.CreateInstance()
bei System.Windows.Forms.AxHost.GetOcxCreate()
bei System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
bei System.Windows.Forms.AxHost.CreateHandle()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.AxHost.EndInit()
bei PdfPreviewHandler.ControlPreviewer.AddPreviewControl()
bei PdfPreviewHandler.ControlPreviewer.LoadFile(String fileName, STGM fileMode)
bei PdfPreviewHandler.FormPreviewSurface.LoadFile(String file, STGM fileMode)
Konrad Büssow
Tuesday, May 08, 2007 6:59:34 AM (Pacific Standard Time, UTC-08:00)
Sounds like Adobe Acrobat isn't installed properly. You might try removing the reader, and then installing it again. A couple of people have reported similar problems where Adobe's reader control becomes "unregistered" strangely.
Wednesday, May 09, 2007 1:12:14 PM (Pacific Standard Time, UTC-08:00)
After preview on PDF I receive this in every windows, hope this could help:

Product
PDF Preview Handler

Descrizione
Stopped working

Signature of the problem
Problem Name: CLR20r3
Signature of the problem 01: pdfpreviewhandler.exe
Signature of the problem 02: 1.0.2.0
Signature of the problem 03: 45fcab78
Signature of the problem 04: PdfPreviewHandler
Signature of the problem 05: 1.0.2.0
Signature of the problem 06: 45fcab78
Signature of the problem 07: 6c
Signature of the problem 08: 11d
Signature of the problem 09: System.NullReferenceException
SO Version: 6.0.6000.2.0.0.768.3
ID Locale: 1040

ID bucket: 24909937
Antonio Giannetto
Sunday, May 13, 2007 8:06:11 AM (Pacific Standard Time, UTC-08:00)
thx it works perfectly !!! win XP SP2 acrobat 8 reader and writter

perfect thx !
Wednesday, May 16, 2007 1:05:32 PM (Pacific Standard Time, UTC-08:00)
Ryan--Thanks a bundle! Not sure if you've seen this yet:
http://msdn.microsoft.com/msdnmag/issues/07/01/PreviewHandlers/default.aspx
Valor
Wednesday, May 16, 2007 7:07:33 PM (Pacific Standard Time, UTC-08:00)
Valor, Thanks for the link to the article on previewers. I actually wrote one of the side bars for that article :).
Thursday, May 24, 2007 5:22:55 AM (Pacific Standard Time, UTC-08:00)
Great plugin!

I too experience a problem switching from a PDF preview to any other folder. It does seem that if you don't close the preview it will most definitely hang outlook. I can reliably crash outlook with this.

Other than that ver nice work.

Greetings,
Georg.
Georg
Monday, May 28, 2007 6:49:10 AM (Pacific Standard Time, UTC-08:00)
Ryan,

Great plug-in, very much appreciated!

I too experience the same switching problem. Switching documents with-in a folder work as a charm, but as soon as I try to switch to any other folder while a pdf document is previewed, Outlook hangs.

My set-up:
Version 1.0.2 of the plug-in
Vista Ultimate (CA-Fr)
Outlook 2007 Ultimate (CA-Fr)
Acrobat reader 8.0.0

Greetings,
Laurent
Laurent O'Brien
Wednesday, June 13, 2007 7:07:59 AM (Pacific Standard Time, UTC-08:00)
FYI - Outlook Reader 8.1 now includes a built in Outlook Previewer, along with a Windows Search filter and a thumbnail preview for explorer.
James
Comments are closed.