Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Use the MHTML Converter guides when your source is a single-file web archive. Aspose.HTML for .NET converts MHTML streams or files to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, and GIF in C#.
MHTML stores HTML markup and related resources in one archive file, which makes it useful for saved web pages, email-like archives, and portable snapshots. In Aspose.HTML for .NET, MHTML conversion usually reads the source as a stream and passes it to Converter.ConvertMHTML() with save options for the target format. The complete C# example project is available in the Aspose.HTML for .NET GitHub repository.
PdfSaveOptions, ImageSaveOptions, DocSaveOptions, or XpsSaveOptions.Converter.ConvertMHTML() and pass the source stream, options, and output path.The following example converts MHTML to JPG with ImageSaveOptions.
1// Convert MHTML to JPG in C#
2
3// Open an existing MHTML file for reading
4using FileStream stream = File.OpenRead(DataDir + "sample.mht");
5
6// Invoke the ConvertMHTML() method to convert MHTML to JPG
7Converter.ConvertMHTML(stream, new ImageSaveOptions(ImageFormat.Jpeg), Path.Combine(OutputDir, "convert-by-two-lines.jpg"));Use the online MHTML Converter for quick archive conversion. Use Aspose.HTML for .NET when MHTML conversion must be automated in C#.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.