Class MetafileImageParsedEventArgs
Represents the parameters required for MetafileImageParsed event that occurs while importing a Word document.
Inheritance
System.Object
MetafileImageParsedEventArgs
Namespace: Syncfusion.EJ2.DocumentEditor
Assembly: Syncfusion.EJ2.DocumentEditor.dll
Syntax
public class MetafileImageParsedEventArgs : EventArgs
Examples
The following code example demonstrates how to hook MetafileImageParsed event for creating a fallback raster image from a metafile image using any third-party image converter while converting Word document to SFDT.
//Hooks MetafileImageParsed event.
WordDocument.MetafileImageParsed += OnMetafileImageParsed;
//Converts DocIO DOM to SFDT DOM.
WordDocument sfdtDocument = WordDocument.Load(docIODocument);
//Unhooks MetafileImageParsed event.
WordDocument.MetafileImageParsed -= OnMetafileImageParsed;
//Serializes SFDT DOM to SFDT string.
//Disposes the SFDT document.
sfdtDocument.Dispose();
//Converts Metafile to raster image.
private static void OnMetafileImageParsed(object sender, MetafileImageParsedEventArgs args)
{
//You can write your own method definition for converting metafile to raster image using any third-party image converter.
args.ImageStream = ConvertMetafileToRasterImage(args.MetafileStream);
}
Properties
ImageStream
Gets or sets the alternate raster image stream used as fallback.
Declaration
public Stream ImageStream { get; set; }
Property Value
Type |
---|
System.IO.Stream |
IsMetafile
Gets a value indicating whether the image is metafile.
Declaration
public bool IsMetafile { get; }
Property Value
Type |
---|
System.Boolean |
MetafileStream
Gets the original metafile image stream.
Declaration
public Stream MetafileStream { get; }
Property Value
Type |
---|
System.IO.Stream |
Methods
Dispose()
Releases all resources used by the MetafileImageParsedEventArgs instance.
Declaration
public void Dispose()