Sunting teks ing C++ SDK

Gunakake REST API kanggo nyunting teks ing C++ kanthi terprogram

Nalika pangembang ngowahi teks dokumen nganggo perpustakaan C++ iki, sing lagi diowahi yaiku Model Obyek Dokumen (DOM). Dadi, meh kabeh owah-owahan bisa ditindakake kanggo teks dokumen sing diwakili minangka DOM. Kanthi C++ SDK sing disedhiyakake, pangembang bisa kanthi gampang nyunting dokumen: ngowahi teks, nganyari tabel, nambah gambar lan liya-liyane. Cukup mbukak teks, gawe owah-owahan sing dibutuhake kanthi program lan ekspor asil menyang format nyimpen sing padha utawa sing didhukung.

Ndeleng potongan kode

Sunting teks ing C++ nggunakake REST API

Pustaka C++ kita menehi pangembang kemampuan kanggo ngowahi teks dokumen kanthi langsung kanthi nyunting Document Object Model (DOM), tegese ora ana piranti lunak tambahan sing kudu diinstal.

Sunting teks ing teks file nggunakake C++

Kasus sing paling populer kanggo nyunting teks file yaiku nyunting teks. Kanthi solusi piranti lunak sing diwenehake, sampeyan bisa nambah, ngowahi utawa mbusak teks nggunakake C++ ing dokumen kasebut.

Sunting tabel ing teks file nggunakake C++

Pilihan editing teks liyane sing populer yaiku nyunting tabel. C++ SDK kita ngidini sampeyan nggarap tabel lan teks ing sel tabel.

Pangembang C++ bisa nambah utawa mbusak sel tabel lan tabel, uga nambah, ngowahi lan mbusak teks ing njero.

Tambah gambar menyang teks file nggunakake C++

Saliyane nyunting teks lan tabel ing teks, ana pilihan umum liyane: nambahake gambar menyang dokumen ing C++. Pangembang C++ uga bisa nambah gambar menyang teks file nggunakake DOM.

Sunting teks kanthi terprogram

Coba C++ SDK sing kuat iki lan evaluasi sawetara opsi ing panyuntingan teks dokumen. Nggunakake conto ing ngisor iki, muat teks dokumen lan gawe sawetara owah-owahan: nambah teks, nambah tabel lan sel tabel kanthi teks utawa lebokake gambar menyang teks dokumen:

Unggah dokumen sing pengin diowahi
Kode roto
Unggah gambar sing pengin dilebokake
Pilih format target saka dhaptar
using namespace aspose::words::cloud;

auto config = std::make_shared<ApiConfiguration>(L"####-####-####-####-####", 
   L"##################");
auto wordsApi = std::make_shared<WordsApi>(config);

auto requestDocument = std::shared_ptr<std::istream>(new std::ifstream(
   std::filesystem::path(L"Input.txt"), std::istream::binary));
auto requestParagraph = std::make_shared<aspose::words::cloud::models::ParagraphInsert>();
requestParagraph->setText(std::make_shared<std::wstring>(L"Morbi enim nunc faucibus a."));

std::shared_ptr<requests::InsertParagraphOnlineRequest> insertParagraphRequest(
    new requests::InsertParagraphOnlineRequest(
        requestDocument, requestParagraph
    )
);
auto insertParagraph = wordsApi->insertParagraphOnline(insertParagraphRequest);

std::shared_ptr<requests::ConvertDocumentRequest> convertRequest(
    new requests::ConvertDocumentRequest(
        insertParagraph->document->values.begin,
          std::make_shared<std::wstring>(L"txt")
    )
);
auto convert = wordsApi->convertDocument(convertRequest);
using namespace aspose::words::cloud;

auto config = std::make_shared<ApiConfiguration>(L"####-####-####-####-####", 
   L"##################");
auto wordsApi = std::make_shared<WordsApi>(config);

auto requestDocument = std::shared_ptr<std::istream>(new std::ifstream(
   std::filesystem::path(L"Input.txt"), std::istream::binary));
auto requestTable = std::make_shared<aspose::words::cloud::models::TableInsert>();
requestTable->setColumnsCount(std::make_shared<int32_t>(1));
requestTable->setRowsCount(std::make_shared<int32_t>(2));

std::shared_ptr<requests::InsertTableOnlineRequest> insertTableRequest(
    new requests::InsertTableOnlineRequest(
        requestDocument, requestTable, std::make_shared<std::wstring>(L"")
    )
);
auto insertTable = wordsApi->insertTableOnline(insertTableRequest);

std::shared_ptr<requests::ConvertDocumentRequest> convertRequest(
    new requests::ConvertDocumentRequest(
        insertTable->document->values.begin,
          std::make_shared<std::wstring>(L"txt")
    )
);
auto convert = wordsApi->convertDocument(convertRequest);
using namespace aspose::words::cloud;

auto config = std::make_shared<ApiConfiguration>(L"####-####-####-####-####", 
   L"##################");
auto wordsApi = std::make_shared<WordsApi>(config);

auto requestDocument = std::shared_ptr<std::istream>(new std::ifstream(
   std::filesystem::path(L"Input1.txt"), std::istream::binary));

auto requestDrawingObject = 
   std::make_shared<aspose::words::cloud::models::DrawingObjectInsert>();
requestDrawingObject->setHeight(std::make_shared<double>(0));
requestDrawingObject->setLeft(std::make_shared<double>(0));
requestDrawingObject->setTop(std::make_shared<double>(0));
requestDrawingObject->setWidth(std::make_shared<double>(0));
requestDrawingObject->setRelativeHorizontalPosition(
   std::make_shared<aspose::words::cloud::models::DrawingObjectInsert::RelativeHorizontalPosition>(
      aspose::words::cloud::models::DrawingObjectInsert::RelativeHorizontalPosition::MARGIN));
requestDrawingObject->setRelativeVerticalPosition(
   std::make_shared<aspose::words::cloud::models::DrawingObjectInsert::RelativeVerticalPosition>(
      aspose::words::cloud::models::DrawingObjectInsert::RelativeVerticalPosition::MARGIN));
requestDrawingObject->setWrapType(
   std::make_shared<aspose::words::cloud::models::DrawingObjectInsert::WrapType>(
      aspose::words::cloud::models::DrawingObjectInsert::WrapType::INLINE));

auto requestImageFile = std::shared_ptr<std::istream>(new std::ifstream(
   std::filesystem::path(L"Input2.txt"), std::istream::binary));
std::shared_ptr<requests::InsertDrawingObjectOnlineRequest> insertDrawingObjectRequest(
    new requests::InsertDrawingObjectOnlineRequest(
        requestDocument, requestDrawingObject, requestImageFile, 
		   std::make_shared<std::wstring>(L"sections/0")
    )
);
auto insertDrawingObject = wordsApi->insertDrawingObjectOnline(insertDrawingObjectRequest);

std::shared_ptr<requests::ConvertDocumentRequest> convertRequest(
    new requests::ConvertDocumentRequest(
        insertDrawingObject->document->values.begin,
          std::make_shared<std::wstring>(L"txt")
    )
);
auto convert = wordsApi->convertDocument(convertRequest);
Kode roto
  
Nyalin kode C++ menyang clipboard

Cara Ngowahi teks ing C++

  1. Pasang 'Aspose.Words Cloud kanggo C++'
  2. Tambah referensi perpustakaan (ngimpor perpustakaan) menyang proyek C++ sampeyan
  3. Muat teks kanggo nyunting ing C++
  4. Lebokake isi ing wiwitan teks
  5. Download dokumen asil saka panyimpenan maya

Pustaka C++ kanggo nggunakake panyuntingan TXT.

Klone Aspose.Words Cloud SDK for C++ kode sumber saka GitHub. Sampeyan bisa nemokake informasi rinci babagan mbangun lan ngonfigurasi SDK ing bagean "How to use the SDK".

Kanggo entuk kredensial keamanan sing dibutuhake lan ngakses REST API kanthi cepet, tindakake Instructions iki ing dokumentasi.

Requirements Sistem

Deleng Repository Documentation kanggo ndeleng rincian.

Format file liyane sing didhukung

Sampeyan bisa nindakake operasi suntingan kanggo format file liyane:

5%

Langganan kanggo Aspose Update Product

Entuk buletin saben wulan lan tawaran langsung dikirim menyang kothak layang.

© Aspose Pty Ltd 2001-2024. Kabeh hak dilindhungi undhang-undhang.