Free Support Forum - aspose.com

Aspose.pdf SDK

Does your Apose.PDF SDK edit existing text of pdf?

@Dev00161

Thanks for contacting support.

Aspose.PDF API supports extracting as well as replacing found text in existing PDF documents. You may please visit following article(s) in API documentation for more information.

.NET
Replace Text in a PDF Document

Java
Replace Text in a PDF Document

In case of further assistance, please feel free to let us know.

Hey

Can you share API documentation in C++.

@Dev00161

Please use following code snippet to find and replace text in existing PDF documents using Aspose.PDF for C++:

// Open document
System::SharedPtr<Aspose::Pdf::Document> doc = System::MakeObject<Aspose::Pdf::Document>(L"D:\\Tests\\input.pdf");
// Find font that will be used to change document text font
System::SharedPtr<Aspose::Pdf::Text::Font> font = Aspose::Pdf::Text::FontRepository::FindFont(L"Arial");
// Create TextFragmentAbsorber object to find all "hello world" text occurrences
System::SharedPtr<Aspose::Pdf::Text::TextFragmentAbsorber> absorber = System::MakeObject<Aspose::Pdf::Text::TextFragmentAbsorber>(L"hello world");
// Accept the absorber for first page
doc->get_Pages()->idx_get(1)->Accept(absorber);
// Change text and font of the first text occurrence
absorber->get_TextFragments()->idx_get(1)->set_Text(L"hi world");
absorber->get_TextFragments()->idx_get(1)->get_TextState()->set_Font(font);
// Save document
doc->Save(L"D:\\Tests\\output.pdf");

Thanks for your reply Asad.
I need its Quick start document so that i can understand which libs or dll i need to include in my application solution folder.

@Dev00161

Thanks for your feedback.

Please check installation article in API documentation which offers a guide to install the API in your development environment. In case of any further assistance, please feel free to let us know.

Thanks Asad for the installation link. i have downloaded the package but not able to understand how to install it. please help me in this.

@Dev00161

We recommend to use VS2017 in order to develop with Aspose.PDF for C++. In upcoming releases of the API we will be going to deprecate the support upto VS2015 and minimum support version would be VS2017. Furthermore, you can check sample project present in downloaded package of Aspose.PDF for C++ and copy its configuration in order to make everything running. In case you still face any issue, please share some details about which type of issue you are facing. We will try to assist you accordingly.