Free plan
Delete pages by content
Delete the pages that contain words you choose
About this tool
This tool removes every page that contains certain words or phrases, such as Draft or Intentionally left blank. You can also do the opposite and keep only those pages. A page can match if it has any of your words, or only if it has all of them. The PDF must contain real text, not just a picture of text.
For example, you remove every page that says Draft from a report.
How to use it
- Choose this tool.
- Add your PDF with Upload or drag and drop.
- Type the words or phrases to look for.
- Choose whether to delete or keep the matching pages.
- Press Generate, then download the PDF.
What you get back
You get a new PDF with the pages removed or kept, as you chose. A report-only option just lists the matching pages.
GOOD TO KNOW
Only the text layer is searched; run a scan through the OCR tool first. A job that would leave no page is refused. Counts as one PDF operation.
TEST IT LIVE
Try Delete pages by content in the Studio
One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Family
PDFs
Plan
Free
Method
POST
Endpoint
/v1/pdfs/delete-by-content
Tool ID
pdfs.delete-by-content
Authentication
API key
Accepts
PDF
Background jobs
Yes
Usage group
Pdf
For developers
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/pdfs/delete-by-content" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'file=@document.pdf' \
-F 'terms=["Intentionally left blank","CONFIDENTIAL"]' \
-F 'match=any' \
-F 'action=delete'Node.js
const { DavixH2I } = require('@davixlabs/h2i-sdk');
const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.pdfs.deleteByContent({
"file": 'document.pdf',
"terms": "[\"Intentionally left blank\",\"CONFIDENTIAL\"]",
"match": "any",
"action": "delete"
});
console.log(result.data, result.requestId);PHP
<?php
require 'vendor/autoload.php';
$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->pdfs()->deleteByContent([
'file' => 'document.pdf',
'terms' => '["Intentionally left blank","CONFIDENTIAL"]',
'match' => 'any',
'action' => 'delete',
]);
echo $result->requestId;More in PDFs
