Gunakake C++ kanggo entuk maksimum MHTML nganti JPG kacepetan konversi. Iki minangka solusi piranti lunak profesional lengkap kanggo ngimpor lan ngekspor MHTML, JPG, lan akeh format dokumen liyane nggunakake C++.
Kudu ngowahi MHTML dadi JPG gambar kanthi program? Kanthi Aspose.Words for C++ pangembang bisa gampang ngowahi MHTML menyang JPG format gambar mung sawetara baris C++ kode.
Modern document-processing C++ API nggawe JPG saka MHTML kanthi kacepetan dhuwur. Nguji kualitas MHTML menyang JPG langsung ing browser. C++ kuat ngidini ngowahi MHTML akeh format gambar populer.
Conto ing ngisor iki nduduhake carane ngowahi MHTML dadi JPG gambar ing C++.
Tindakake langkah sing gampang kanggo nguripake MHTML file menyang JPG format grafis. Waca MHTML saka drive lokal, banjur simpen minangka JPG, nemtokake format gambar sing dibutuhake dening extension JPG Kanggo loro MHTML maca lan JPG nulis sampeyan bisa nggunakake jeneng berkas kanthi qualified. Konten grafis output JPG bakal padha karo MHTML file.
dotnet add package Aspose.Words.Cpp
Nyalin
using namespace Aspose::Words;
auto doc = MakeObject<Document>(u"Input.mhtml");
auto saveOptions = MakeObject<ImageSaveOptions>(SaveFormat::Jpg);
for (int page = 0; page < doc->get_PageCount(); page++)
{
saveOptions->set_PageSet(MakeObject<PageSet>(page));
doc->Save(String::Format(u"Output_{0}.jpg", page + 1), saveOptions);
}
using namespace Aspose::Words;
auto doc = MakeObject<Document>(u"Input.mhtml");
doc->Save(u"Output.jpg");
using namespace Aspose::Words;
auto doc = MakeObject<Document>(u"Input.mhtml");
auto saveOptions = MakeObject<ImageSaveOptions>(SaveFormat::Png);
for (int page = 0; page < doc->get_PageCount(); page++)
{
saveOptions->set_PageSet(MakeObject<PageSet>(page));
doc->Save(String::Format(u"Output_{0}.jpg", page + 1), saveOptions);
}
using namespace Aspose::Words;
auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->InsertImage(u"Input.mhtml");
doc->Save(u"Output.jpg");
using namespace Aspose::Words;
auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
auto shape = builder->InsertImage(u"Input.mhtml");
shape->GetShapeRenderer()->Save(u"Output.jpg", MakeObject<ImageSaveOptions>(SaveFormat::Svg));
Ana telung opsi kanggo nginstal Aspose.Words for C++ kanggo lingkungan pangembang. Pilih salah siji sing cocog karo kabutuhan sampeyan lan tindakake pandhuan langkah demi langkah:
Sampeyan bisa nggunakake perpustakaan C++ iki kanggo nggawe piranti lunak ing Microsoft Windows, Linux lan macOS:
Yen sampeyan nggawe piranti lunak kanggo Linux utawa macOS, priksa informasi babagan katergantungan perpustakaan tambahan (fontconfig lan paket sumber terbuka mesa-glu) ing Dokumentasi Produk.
Sampeyan bisa ngowahi MHTML menyang akeh format file liyane: