Free plan
Search in PDF
Find a word or phrase in a PDF and see where it appears
About this tool
This tool looks for a word or phrase in the text of a PDF and lists every match with its page number, a little text around it and where it sits on the page. It reads the real text of the PDF, so a scanned PDF with no text will find nothing until you read it with the scan reader tool. You can also get a copy with the matches highlighted.
For example, you search a 60-page contract for every mention of payment terms.
How to use it
- Choose this tool.
- Add your PDF.
- Type the word or phrase to find.
- Choose options such as which pages, matching upper and lower case, whole words only, and whether to get a highlighted copy.
- Press Generate, then read the matches or download the highlighted PDF.
What you get back
You get a list of matches with their pages, and a highlighted copy of the PDF if you asked for it. You can copy or download them.
GOOD TO KNOW
Searches the text layer. A scanned PDF has none: run OCR first (the answer says so). Counts as one file.
TEST IT LIVE
Try Search in PDF 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/search
Tool ID
pdfs.search
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/search" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'file=@document.pdf' \
-F 'query=invoice number' \
-F 'pages=1-3' \
-F 'max_results=200'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.search({
"file": 'document.pdf',
"query": "invoice number",
"pages": "1-3",
"max_results": 200
});
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()->search([
'file' => 'document.pdf',
'query' => 'invoice number',
'pages' => '1-3',
'max_results' => 200,
]);
echo $result->requestId;More in PDFs
