Free plan

Extract Text

Copy all the text out of a PDF
POST
/v1/pdfs/text

About this tool

This tool takes the text out of a PDF so you can copy it, search it or use it elsewhere. It reads the text that is already in the file, so a scanned PDF that is only pictures gives nothing; use the scan reader tool for that. You can keep the page layout, or get a simple version with headings and lists as Markdown or HTML.
For example, you copy the words of a long report into a Word document to rewrite parts of it.

How to use it

  1. Choose this tool.
  2. Add your PDF.
  3. Choose which pages you want.
  4. Choose the form: plain text, or text with headings and lists as Markdown or HTML. For plain text you can keep the layout.
  5. Press Generate, then copy or download the text.

What you get back

You get the text on screen and as a file you can copy or download.
TEST IT LIVE

Try Extract Text in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
PDFs
Plan
Free
Method
POST
Endpoint
/v1/pdfs/text
Tool ID
pdfs.text
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/text" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'file=@document.pdf' \
  -F 'pages=all' \
  -F 'layout=true' \
  -F 'format=text'

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.text({
    "file": 'document.pdf',
    "pages": "all",
    "layout": true,
    "format": "text"
  });
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()->text([
    'file' => 'document.pdf',
    'pages' => 'all',
    'layout' => true,
    'format' => 'text',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Copy all the text out of a PDF.

Extract Text accepts PDF. You can send several files in one request.

Extract Text is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/pdfs/text with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.