Gunakake C++ kanggo entuk maksimum Word nganti XPS kacepetan konversi. Iki minangka solusi piranti lunak profesional lengkap kanggo ngimpor lan ngekspor Word, XPS, lan akeh format dokumen liyane nggunakake C++.
Kanggo pangembang C++ sing nggoleki solusi sing lancar kanggo ngowahi Word dadi XPS, Aspose.Words for C++ nyedhiyakake API konversi file sing intuisi lan langsung. Solusi kita ngidini pangembang C++ gampang ngowahi file saka format siji menyang format liyane, dadi alat sing penting kanggo ngotomatisasi tugas konversi file.
Apa sampeyan nggarap Word, XPS utawa format file liyane, Aspose.Words for C++ nyakup kabeh lan njamin asil sing paling dhuwur. Tes carane C++ kode bisa digunakake karo file Word sampeyan saiki.
Conto ing ngisor iki nduduhake carane ngowahi Word dadi XPS kanthi mung sawetara baris C++ kode. Mulai kanthi nyakup spasi jeneng Aspose.Words ing proyek C++. Sabanjure, nemtokake path menyang file input lan nggawe obyek Document kanggo mbukak isi Word. Sampeyan banjur kudu nemtokake path menyang file output XPS lan nggunakake metode Save() kanggo nyimpen asil minangka XPS. API konversi bakal nemtokake format file output adhedhasar ekstensi file sing ditemtokake.
dotnet add package Aspose.Words.Cpp
Nyalin
using namespace Aspose::Words;
auto doc = MakeObject<Document>(u"Input.docx");
doc->Save(u"Output.xps");
using namespace Aspose::Words;
auto doc = MakeObject<Document>(u"Input.docx");
doc->Save(u"Output.xps");
using namespace Aspose::Words;
auto doc = MakeObject<Document>(u"Input.docx");
for (int page = 0; page < doc->get_PageCount(); page++)
{
auto extractedPage = doc->ExtractPages(page, 1);
extractedPage->Save(String::Format(u"Output_{0}.xps", page + 1));
}
using namespace Aspose::Words;
auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->InsertImage(u"Input.docx");
doc->Save(u"Output.xps");
using namespace Aspose::Words;
auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
auto shape = builder->InsertImage(u"Input.docx");
shape->GetShapeRenderer()->Save(u"Output.xps", 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 Word menyang akeh format file liyane: