Gunakake C++ kanggo entuk maksimum RTF nganti PDF kacepetan konversi. Iki minangka solusi piranti lunak profesional lengkap kanggo ngimpor lan ngekspor RTF, PDF, lan akeh format dokumen liyane nggunakake C++.
Kanggo pangembang C++ sing nggoleki solusi sing lancar kanggo ngowahi RTF dadi PDF, 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 RTF, PDF utawa format file liyane, Aspose.Words for C++ nyakup kabeh lan njamin asil sing paling dhuwur. Tes carane kode C++ bisa digunakake karo file RTF sampeyan saiki.
Conto ing ngisor iki nduduhake carane ngowahi RTF dadi PDF kanthi mung sawetara baris kode C++. Mulai kanthi nyakup spasi jeneng Aspose.Words ing proyek C++. Sabanjure, nemtokake path menyang file input lan nggawe obyek Document kanggo mbukak isi RTF. Sampeyan banjur kudu nemtokake path menyang file output PDF lan nggunakake metode Save() kanggo nyimpen asil minangka PDF. 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.rtf");
doc->Save(u"Output.pdf");
using namespace Aspose::Words;
auto doc = MakeObject<Document>(u"Input.rtf");
doc->Save(u"Output.pdf");
using namespace Aspose::Words;
auto doc = MakeObject<Document>(u"Input.rtf");
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}.pdf", page + 1), saveOptions);
}
using namespace Aspose::Words;
auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->InsertImage(u"Input.rtf");
doc->Save(u"Output.pdf");
using namespace Aspose::Words;
auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
auto shape = builder->InsertImage(u"Input.rtf");
shape->GetShapeRenderer()->Save(u"Output.pdf", 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 RTF menyang akeh format file liyane: