Wordize for .NET chuyển đổi tài liệu DOCX sang định dạng web với việc bảo toàn cấu trúc, định dạng và kiểu dáng. Class Converter đảm bảo chuyển đổi chính xác DOCX sang HTML cho quy trình xuất bản web.
Thử nghiệm chuyển đổi DOCX sang HTML bằng demo trực tuyến tương tác của chúng tôi. Tải lên tài liệu DOCX của bạn, chạy chuyển đổi và tải xuống trang web sẵn sàng để hiển thị trình duyệt. 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;
Converter.Convert("Input.docx", "Output.html");
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();