Remove Text from PDF in PHP SDK
API for working with Text in PDF documents using Cloud PHP SDK.
Get StartedHow to delete Text from PDF via Cloud PHP SDK
In order to remove Text from PDF, we’ll use Aspose.PDF Cloud PHP SDK This Cloud SDK assists PHP programmers in developing cloud-based PDF creator, annotator, editor, and converter apps using PHP programming language via Aspose.PDF REST API. Simply create an account at Aspose for Cloud and get your application information. Once you have the App SID & key, you are ready to give the Aspose.PDF Cloud PHP SDK.
Package Manager Console Command
composer install
Steps to delete Text from PDF via PHP SDK
Aspose.PDF Cloud developers can easily load & delete Text from PDF in just a few lines of code.
- Upload the PDF File.
- Define the Rectangle Area.
- Configure Text Replacement.
- Create Text Replacement List.
- Execute the Text Replacement.
- Save the Updated PDF.
Remove Text from PDF using PHP
$name = "sample.pdf";
$this->uploadFile($name);
$rect = new Aspose\PDF\Model\Rectangle();
$rect->setLlx(100);
$rect->setLly(100);
$rect->setUrx(300);
$rect->setUry(300);
$textReplace = new Aspose\PDF\Model\TextReplace();
$textReplace->setOldValue("market");
$textReplace->setNewValue("m_a_r_k_e_t");
$textReplace->setRect($rect);
$textReplace->setRegex(false);
$textReplaceList = new Aspose\PDF\Model\TextReplaceListRequest();
$textReplaceList->setTextReplaces([$textReplace]);
$textReplaceList->setStartIndex(0);
$textReplaceList->setCountReplace(0);
$folder = $this->tempFolder;
Work with Text in PDF
Certain information, like personal details, confidential data, or financial information, may need to be deleted from PDFs before sharing to ensure privacy and data protection. No longer accurate text, such as old contact information, pricing, or policy terms, may need to be removed to keep the document current and relevant. Removing unnecessary text, redundant information, or clutter from a PDF can make it more readable and visually appealing for the audience. These are the main reasons for removing text from DPF, which will make your document more organized, easier to read, and easier to understand.
Remove the Text from PDF documents with Aspose.PDF Cloud PHP SDK.
With our PHP library you can:
- Add PDF document’s header & footer in text or image format.
- Add tables & stamps (text or image) to PDF documents.
- Append multiple PDF documents to an existing file.
- Work with PDF attachments, annotations, & form fields.
- Apply encryption or decryption to PDF documents & set a password.
- Delete all stamps & tables from a page or entire PDF document.
- Delete a specific stamp or table from the PDF document by its ID.
- Replace single or multiple instances of text on a PDF page or from the entire document.
- Extensive support for converting PDF documents to various other file formats.
- Extract various elements of PDF files & make PDF documents optimized.
- You can try out our free App to replace text in PDF files online and test the functionality.
- Learning Resources
- Documentation
- Source Code
- API References
- Product Support
- Free Support
- Paid Support
- Blog
- Why Aspose.PDF Cloud for PHP?
- Customers List
- Security