How To Enable TIFF Image Support
By default TIFF images are disabled when viewing XPS documents. You can enable TIFF image support by referencing the open source TIFF library and registering the TIFF image decoder. The following step-by-step tutorial demonstrates how to enable TIFF images.
|Note: TIFF images are disabled by default in order to minimize the size of the Document Toolkit library.
1) Open Visual Studio 2010 and open your Silverlight 4 application
2) Use NuGet to install the TIFF package reader
(DocumentToolkit.IO.LibTiff). NuGet automatically installs the
package as well if not already there. Please note that the Document Toolkit packages are found in the
First Floor Software
package feed. Learn more at
How To Install Document Toolkit using NuGet
3) Register the TIFF image decoder before loading your document. The Application_Startup or RootVisual contructor are excellent locations.
// ensure the TIFF decoder is registered
ImageDecoders.RegisterImageDecoder(ContentType.TypeImageTiff, new TiffDecoder());
And that's it. TIFF images found in XPS documents are now decoded and correctly rendered.