แก้ไข ข้อความ ใน C++ SDK

ใช้ REST API เพื่อแก้ไข ข้อความ ใน C++ โดยทางโปรแกรม

เมื่อนักพัฒนาแก้ไขเอกสาร ข้อความ ด้วยไลบรารี C++ นี้ สิ่งที่กำลังแก้ไขจริงๆ คือ Document Object Model (DOM) ดังนั้น การเปลี่ยนแปลงเกือบทั้งหมดในเอกสาร ข้อความ ที่แสดงเป็น DOM ด้วย C++ SDK ที่มีให้ นักพัฒนาสามารถแก้ไขเอกสารได้อย่างง่ายดาย เช่น แก้ไขข้อความ อัปเดตตาราง เพิ่มรูปภาพ และอื่นๆ เพียงโหลด ข้อความ ทำการเปลี่ยนแปลงที่จำเป็นโดยทางโปรแกรม และส่งออกผลลัพธ์เป็นรูปแบบเดียวกันหรือรูปแบบการบันทึกที่รองรับ

ดูข้อมูลโค้ด

แก้ไข ข้อความ ใน C++ โดยใช้ REST API

ไลบรารี C++ ของเราช่วยให้นักพัฒนาสามารถแก้ไขเอกสาร ข้อความ ได้โดยตรงโดยแก้ไข Document Object Model (DOM) ซึ่งหมายความว่าไม่จำเป็นต้องติดตั้งซอฟต์แวร์เพิ่มเติม

แก้ไขข้อความในไฟล์ ข้อความ โดยใช้ C++

กรณีที่นิยมที่สุดในการแก้ไขไฟล์ ข้อความ คือการแก้ไขข้อความ ด้วยโซลูชันซอฟต์แวร์ที่ให้มา คุณสามารถเพิ่ม แก้ไข หรือลบข้อความโดยใช้ C++ ภายในเอกสารได้

แก้ไขตารางในไฟล์ ข้อความ โดยใช้ C++

อีกตัวเลือกการแก้ไข ข้อความ ยอดนิยมคือการแก้ไขตาราง C++ SDK ของเราช่วยให้คุณทำงานกับตารางและข้อความในเซลล์ของตารางได้

นักพัฒนา C++ สามารถเพิ่มหรือลบตารางและเซลล์ตาราง ตลอดจนเพิ่ม แก้ไข และลบข้อความภายใน

เพิ่มรูปภาพไปยังไฟล์ ข้อความ โดยใช้ C++

นอกจากการแก้ไขข้อความและตารางใน ข้อความ แล้ว ยังมีอีกตัวเลือกทั่วไป: การเพิ่มรูปภาพลงในเอกสารใน C++ นักพัฒนา C++ สามารถเพิ่มรูปภาพลงในไฟล์ ข้อความ โดยใช้ DOM

แก้ไข ข้อความ โดยทางโปรแกรม

ลองใช้ C++ SDK อันทรงพลังนี้และประเมินตัวเลือกบางอย่างในการแก้ไขเอกสาร ข้อความ ใช้ตัวอย่างต่อไปนี้ โหลดเอกสาร ข้อความ ของคุณ และทำการเปลี่ยนแปลงบางอย่าง: เพิ่มข้อความ เพิ่มตารางและเซลล์ตารางที่มีข้อความ หรือแทรกรูปภาพลงในเอกสาร ข้อความ:

อัปโหลดเอกสารที่คุณต้องการแก้ไข
รันโค้ด
อัปโหลดรูปภาพที่คุณต้องการแทรก
เลือกรูปแบบเป้าหมายจากรายการ
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);
รันโค้ด
  
คัดลอกรหัส C++ ไปยังคลิปบอร์ด

วิธีแก้ไข ข้อความ ใน C++

  1. ติดตั้ง 'Aspose.Words Cloud สำหรับ C++'
  2. เพิ่มการอ้างอิงไลบรารี (นำเข้าไลบรารี) ไปยัง C++ โครงการของคุณ
  3. โหลด ข้อความ เพื่อแก้ไขใน C++
  4. แทรกเนื้อหาที่จุดเริ่มต้นของ ข้อความ
  5. ดาวน์โหลดเอกสารผลลัพธ์จากที่เก็บข้อมูลบนคลาวด์

C++ ห้องสมุดเพื่อใช้ TXT แก้ไข

Clone Aspose.Words Cloud SDK for C++ จาก GitHub คุณสามารถค้นหาข้อมูลโดยละเอียดเกี่ยวกับการสร้างและกำหนดค่า SDK ได้ในส่วน "How to use the SDK"

หากต้องการรับข้อมูลรับรองความปลอดภัยที่จำเป็นอย่างรวดเร็วและเข้าถึง REST API ของเรา โปรดปฏิบัติตาม Instructions เหล่านี้ในเอกสารประกอบ

ความต้องการของระบบ

อ้างถึง Repository Documentation เพื่อดูรายละเอียด

รูปแบบไฟล์อื่นๆ ที่รองรับ

คุณสามารถดำเนินการแก้ไขสำหรับรูปแบบไฟล์อื่นๆ ได้:

5%

สมัครสมาชิก Aspose Product Updates

รับจดหมายข่าวและข้อเสนอรายเดือนที่ส่งตรงถึงกล่องจดหมายของคุณ