Why Use PDF Search API?
The PDF.co PDF Search API can help you delete a specific text inside your PDF. You can choose to delete single or multiple texts.
All the documents sent through our Web API are encrypted and secure. We use SSL, TLS, and file encryption security to protect your data. To learn more, please read our security page https://pdf.co/security
PDF Search API Benefits
Credit-Based System
No licenses are required. You only need to pay credits every time you use our API. You may choose to get credits through our subscription plan or credit packs.
PDF Search API Sample & Demo
We’ll be using this sample PDF that we prepared for this demo.

Using the code snippets below in different programming languages. We can delete a text inside the sample PDF.
The result will look like this.

Before we proceed with the code. Let us first check the v1/pdf/edit/delete-text parameters and their uses.
Endpoint
URL: | https://api.pdf.co/v1/pdf/edit/delete-text |
Method: | POST |
Parameter | Description |
url | required. Link to the source file. |
searchStrings[] | required. array of strings to search. |
caseSensitive | optional. Set to false to use case-insensitive search. |
pages | optional. Comma-separated list of page indices (or ranges) to process. IMPORTANT: the very first page starts with 0 (zero). To set a range use the dash –, for example: 0, 2-5, 7-. |
expiration | optional. Output link expiration in minutes. Default is 60 (i.e. 60 minutes or 1 hour). After this delay generated output file(s) (if any) will be auto-removed from PDF.co temporary files storage. Max allowed expiration period depends on your current subscription plan. To store permanent input files (e.g. re-usable images, pdf, documents), please use PDF.co built-in Files Storage instead. |
encrypt | optional. Enable encryption for the output file: true or false |
async | optional. Runs processing asynchronously. Returns jobId to use with job/check : true or false |
name | optional. Output file name. |
profiles | optional. Must be a String. Set custom configuration. See profiles examples here |
Now we are ready to write some codes.
cURL Code Snippet
curl --location --request POST 'https://api.pdf.co/v1/pdf/edit/delete-text' \ --header 'Content-Type: application/json' \ --header 'x-api-key: YOUR_API_KEY' \ --data-raw '{ "url": "https://bytescout-com.s3-us-west-2.amazonaws.com/files/demo-files/cloud-api/pdf-to-text/sample.pdf", "name": "pdfWithTextDeleted", "caseSensitive": "false", "searchStrings": [ "Notes", "City, State Zip" ] }'
This sample code and other cURL source source code samples are available here.
Now let’s see this program in action.

The Sample code for text deleting in JavaScript is available here.
The Sample code for text deleting in PHP is available here.
The Sample code for text deleting in Python is here.
The Sample code for text deleting in Java is available here.
The Sample code for text deleting in C# is available here.