Wordize for .NET chuyển đổi MHT sang định dạng JPG với việc bảo toàn cấu trúc, định dạng và nội dung. Class Converter đảm bảo chuyển đổi chính xác để di chuyển tài liệu một cách liền mạch.
Thử nghiệm chuyển đổi MHT sang JPG bằng demo trực tuyến tương tác của chúng tôi. Tải lên file MHT của bạn, chạy chuyển đổi và tải xuống tài liệu JPG. Mã C# được cung cấp sẵn sàng để tích hợp vào dự án .NET của bạn.
using Wordize.Conversion;
using Wordize.Saving;
var imageStreams = Converter.ConvertToImages("Input.mht", new ImageSaveOptions(SaveFormat.Jpg));
foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i)))
{
using var _ = stream;
stream.Position = 0;
using var file = File.Create($"Output_{page + 1}.jpg");
stream.CopyTo(file);
}
using Wordize.Conversion;
Converter.Convert("{{input1}}", "{{output}}");
using Wordize.Conversion;
using Wordize.Saving;
var imageStreams = Converter.ConvertToImages("{{input1}}", new ImageSaveOptions(SaveFormat.{{saveFormat}}));
foreach (var (stream, page) in imageStreams.Select((s, i) => (s, i)))
{
using var _ = stream;
stream.Position = 0;
using var file = File.Create($"Output_{page + 1}.{{outputExt}}");
stream.CopyTo(file);
}
using Wordize.Conversion;
using Wordize.Saving;
ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFormat.{{saveFormat}});
saveOptions.PageLayout = MultiPageLayout.Vertical(10);
Converter.Create()
.From("{{input1}}")
.To("{{output}}", saveOptions)
.Execute();