დაამატეთ წყლის ნიშანი Word ს ან წაშალეთ ადრე დამატებული ჭვირნიშანი C++ ის გამოყენებით

ამ C++ ბიბლიოთეკის გამოყენებით, დაბეჭდეთ Word დოკუმენტი გამოსახულების ან ტექსტური წყლის ნიშნით ან წაშალეთ უკვე დამატებული წყლის ნიშანი რამდენიმე ნაბიჯით

დაამატეთ ტექსტის ან სურათის ჭვირნიშანი Word დოკუმენტებში C++ ის გამოყენებით. ჩატვირთეთ Word დოკუმენტი და ჩადეთ მასში საჭირო წყლის ნიშანი. შემდეგ შეინახეთ შედეგი მოსახერხებელ ფორმატში, როგორიცაა DOCX, PDF, MD, HTML, TXT, DOC, RTF, EPUB, XPS და სხვა, და გაუზიარეთ წყალმონიშნული დოკუმენტი სხვა პირს. ასევე ამოიღეთ წყლის ნიშანი Word დოკუმენტიდან, თუ ჭვირნიშანი ადრე დაემატა დოკუმენტს და დამატების მიზეზები აღარ არის შესაბამისი.

კოდის ნაწყვეტის ნახვა

Word – დაამატეთ ჭვირნიშანი C++ ში

ამ C++ API ით, დეველოპერებს შეუძლიათ დაამატოთ წყლის ნიშანი Word ზე ონლაინ. უბრალოდ შექმენით წყლის ნიშანი ტექსტის ან სურათის გამოყენებით და შემდეგ ჩადეთ ეს წყლის ნიშანი თქვენს Word დოკუმენტში C++ ში.

შენიშვნა: არ არის საჭირო მესამე მხარის აპლიკაციების ან ბიბლიოთეკების დაყენება. ამიტომ, ჩვენი C++ პროგრამული გადაწყვეტა ძალიან მარტივი გამოსაყენებელია.

ამოიღეთ ჭვირნიშანი Word დან – C++

მოცემული C++ SDK ასევე სასარგებლოა Word დან წყლის ნიშნების ამოსაღებად. ჭვირნიშნის ამოღება Word ში ნიშნავს, რომ თქვენ შეგიძლიათ ჩატვირთოთ სასურველი Word დოკუმენტი, რომელიც დაბეჭდილია ტექსტის ან გამოსახულების ჭვირნიშნით, ამოიღოთ ეს ჭვირნიშანი Word დან C++ ის გამოყენებით და შემდეგ შეინახოთ გამომავალი ფაილი მოსახერხებელ ფორმატში – DOC, DOCX, PDF, JPEG, PNG, TIFF და სხვა.

მუშაობა წყლის ნიშანთან Word ში

იმისათვის, რომ შეაფასოთ, თუ როგორ უნდა დაამატოთ ან ამოიღოთ ჭვირნიშანი Word ში ჩვენი C++ API ით, ჩატვირთეთ Word და ჭვირნიშანი, როგორც სურათი ან ტექსტი. შემდეგ აირჩიეთ მოსახერხებელი საექსპორტო ფაილის ფორმატი - DOC, DOCX, PDF, HTML, RTF, XPS და სხვა.

გამოიყენეთ შემდეგი მაგალითი, რომ ნახოთ როგორ მუშაობს:

ფაილს სჭირდება წყლის ნიშნების დამატება
გაუშვით კოდი
ატვირთეთ სურათი, რომლის ჩასმაც გსურთ
აირჩიეთ სამიზნე ფორმატი სიიდან
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.docx"), std::istream::binary));
auto requestImageFile = std::shared_ptr<std::istream>(
   new std::ifstream(std::filesystem::path(L"Input2.docx"), std::istream::binary));
std::shared_ptr<requests::InsertWatermarkImageOnlineRequest> insertWatermarkImageOnline(
    new requests::InsertWatermarkImageOnlineRequest(
        requestDocument, requestImageFile
    )
);
auto insertedWatermarkImage = wordsApi->insertWatermarkImageOnline(insertWatermarkImageOnline);

auto requestDocument = std::shared_ptr<std::istream>(
   insertedWatermarkImage->document->values.begin, std::istream::binary));
std::shared_ptr<requests::ConvertDocumentRequest> convertDocument(
    new requests::ConvertDocumentRequest(
        requestDocument, std::make_shared<std::wstring>(L"docx")
    )
);
wordsApi->convertDocument(convertDocument);
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.docx"), std::istream::binary));
auto requestWatermarkText = std::make_shared<aspose::words::cloud::models::WatermarkText>();
requestWatermarkText->setText(std::make_shared<std::wstring>(L"This is the watermark text."));
requestWatermarkText->setRotationAngle(std::make_shared<double>(90));
std::shared_ptr<requests::InsertWatermarkTextOnlineRequest> insertWatermarkTextOnline(
    new requests::InsertWatermarkTextOnlineRequest(
        requestDocument, requestWatermarkText
    )
);
auto insertedWatermarkText = wordsApi->insertWatermarkTextOnline(insertWatermarkTextOnline);

auto requestDocument = std::shared_ptr<std::istream>(
   insertedWatermarkText->document->values.begin, std::istream::binary));
std::shared_ptr<requests::ConvertDocumentRequest> convertDocument(
    new requests::ConvertDocumentRequest(
        requestDocument, std::make_shared<std::wstring>(L"docx")
    )
);
wordsApi->convertDocument(convertDocument);
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.docx"), std::istream::binary));
std::shared_ptr<requests::DeleteWatermarkOnlineRequest> deleteWatermarkOnline(
    new requests::DeleteWatermarkOnlineRequest(
        requestDocument
    )
);
auto deletedWatermark = wordsApi->deleteWatermarkOnline(deleteWatermarkOnline);

auto requestDocument = std::shared_ptr<std::istream>(
   deletedWatermark->document->values.begin, std::istream::binary));
std::shared_ptr<requests::ConvertDocumentRequest> convertDocument(
    new requests::ConvertDocumentRequest(
        requestDocument, std::make_shared<std::wstring>(L"docx")
    )
);
wordsApi->convertDocument(convertDocument);
გაუშვით კოდი
  
დააკოპირეთ კოდი C++ ბუფერში

როგორ ამოიღოთ ჭვირნიშანი Word ში C++ ის გამოყენებით

  1. დააინსტალირეთ Aspose.Words Cloud for C++
  2. დაამატეთ ბიბლიოთეკის მითითება (ბიბლიოთეკის იმპორტი) თქვენს C++ პროექტს
  3. დააკონფიგურირეთ API თქვენი აპის კლავიშების გამოყენებით
  4. ჩატვირთეთ Word დოკუმენტი, საიდანაც გსურთ ამოიღოთ ჭვირნიშანი
  5. შექმენით მოთხოვნა წყლის ნიშნის ამოღების მიზნით
  6. შეინახეთ შედეგი მოსახერხებელი ფაილის ფორმატში

C++ ბიბლიოთეკა წყლის ნიშნების გამოსაყენებლად DOCX ში

კლონი Aspose.Words Cloud SDK for C++ წყაროს კოდისთვის GitHub-დან. თქვენ შეგიძლიათ იპოვოთ დეტალური ინფორმაცია SDK ის შექმნისა და კონფიგურაციის შესახებ განყოფილებაში "How to use the SDK".

უსაფრთხოების საჭირო სერთიფიკატების სწრაფად მისაღებად და ჩვენს REST API ზე წვდომისთვის, გთხოვთ, მიჰყვეთ დოკუმენტაციაში მოცემულ Instructions.

სისტემის მოთხოვნები

დეტალების სანახავად იხილეთ Repository Documentation.

სხვა მხარდაჭერილი ფაილის ფორმატები

თქვენ შეგიძლიათ დაამატოთ ჭვირნიშანი დოკუმენტს სხვა ფორმატებში:

5%

გამოიწერეთ Aspose პროდუქტის განახლებები

მიიღეთ ყოველთვიური გაზეთები და შეთავაზებები პირდაპირ თქვენს საფოსტო ყუთში.