Hi. First I would like thank everyone involved for their work on this project. It made my life much easier when I was given a a large project with a ridiculously short time line and an unknown in the project was writing information out to a PDF.
I am using PDFsharp, WPF build and V1.3.
So my situation is that I take an existing PDF, I open it and write a jpg image over one of the pages and close it. This process works great in development and when deployed on IIS6 and Windows Server 2003. When I deploy it on Windows Server 2008 Web Edition SP1 it works 95% of the time. The other 5% I get the exception pasted at the end of this post.
I have searched and the only reference I can find to anything like this is
here.
One of the comments has this piece of information but I cannot find any other information on it.
Quote:
Melinda M, Employee, replied 21 days ago
...
This looks like a bug I've seen in the Windows Imaging Component - it's fixed in Windows 7, but not yet in Server 2008.
There should be a patch coming out for Server 2008 soon, but it's not available yet. I know this is annoying, because I've run up against it myself a bunch!
That comment makes it sound like a Windows problem. Have any of you had any experience with this error? or any thoughts on what I might be able to do to work around it with your library to make this process run at five nines?
Thanks for your input.
Exception: COMException
Message: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
Source: WindowsBase
TargetSite Name: MapUrlToZone
Stack Trace:
at MS.Win32.UnsafeNativeMethods.IInternetSecurityManager.MapUrlToZone(String pwszUrl, Int32& pdwZone, Int32 dwFlags)
at MS.Internal.PresentationCore.SecurityHelper.MapUrlToZoneWrapper(Uri uri)
at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri, Stream stream, BitmapCacheOption cacheOption, Guid& clsId, Boolean& isOriginalWritable, Stream& uriStream, UnmanagedMemoryStream& unmanagedMemoryStream, SafeFileHandle& safeFilehandle)
at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)
at System.Windows.Media.Imaging.BitmapImage.FinalizeCreation()
at System.Windows.Media.Imaging.BitmapImage.EndInit()
at System.Windows.Media.Imaging.BitmapImage..ctor(Uri uriSource, RequestCachePolicy uriCachePolicy)
at System.Windows.Media.Imaging.BitmapImage..ctor(Uri uriSource)
at PdfSharp.Drawing.XImage..ctor(String path)
at PdfSharp.Drawing.XImage.FromFile(String path)