←Select platform

MimeType Property

Summary

The optional mime type of the document being loaded.

Syntax
C#
C++/CLI
Java
Python
public string MimeType { get; set; } 
public:  
   property String^ MimeType 
   { 
      String^ get() 
      void set(String^ value) 
   } 
public int getMimeType() 
public void setMimeType(int value) 
MimeType # get and set (LoadDocumentOptions) 

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 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.