This project is read-only.

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 DocumentToolkit 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.

using FirstFloor.Documents.Imaging;
using FirstFloor.Documents.IO.LibTiff;

// 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.

Last edited Dec 6, 2011 at 3:00 PM by kozw, version 1


wa_dev Jan 14, 2012 at 5:21 AM 
ANSWER: it litterally means "image/tiff", and it's strongly typed as FirstFloor.Documents.ContentType.TypeImageTiff

I've noticed that import or using the various FirstFloor namespaces conflict with numerous other namespaces... which is fine, I just have to strongly type out methods, properties ect the long way.

Thanks again for the great work on the toolkit!!!

wa_dev Jan 14, 2012 at 5:03 AM 
"ContentType.TypeImageTiff" <-- My parameters show this is supposed to be a string... what is the literal string that TypeImageTiff defines? or what namespace is this under? maybe its' just ".tiff"... thanks, and great work on the toolkit!!!