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.

On-Premise Server

We have an on-premise server that enables businesses and enterprises to run the PDF.co Web API modules to their on-premise servers. This provides them with more control over file storage and additional customizations.

PDF Search API Sample & Demo

We’ll be using this sample PDF that we prepared for this demo.

Screenshot of Sample PDF
Screenshot of Sample PDF

Using the code snippets below in different programming languages. We can delete a text inside the sample PDF.

The result will look like this.

Screenshot of Output PDF
Screenshot of Output PDF

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 (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/checktrue 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 sample codes are available here.

Now let’s see this program in action.

Output PDF using cURL
Output PDF using cURL

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.

Related Samples: