←Select platform

MimeType Property

Summary

The optional mime type of the document being loaded.

Syntax

C#
VB
Java
C++
public string MimeType { get; set; } 
Public Property MimeType() As String 
   Get 
   Set 
public:  
   property String^ MimeType 
   { 
      String^ get() 
      void set(String^ value) 
   } 
public int getMimeType() 
public void setMimeType(int value) 

Property Value

Optional mime type of the document being loaded. The default value is null.

Remarks

The document engine tries to determine the document's image format from the data itself since most document formats such as PDF, TIFF, PNG, DOCX, etc., contain a unique signature that can be parsed. Other file formats such as Text do not. If parsing the signature fails, the engine tries to determine the document's type from the file extension. For example, if the document has the extension .txt or .text, and parsing for its signature fails, then the engine will assume the document is a text file.

If, however, the file name or URL does not contain a valid signature, (for instance, if it is being returned from dynamically-generated content by a web server or from a cache item), then the above mechanism will fail.

In such cases, the mime type (if available) can be set in MimeType. The engine will then use this information if all of the above have failed to load the document. In the case of a text file, set MimeType to "text/plain" and the load operation should succeed. The mime type that corresponds to a particular LEADTOOLS RasterImageFormat constant can be obtained by calling the RasterCodecs.GetMimeType helper method.

Requirements

Target Platforms

Help Version 19.0.2017.10.18
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Documents Assembly