About this tool
This tool pulls the words out of a document, such as PDF, Word, Excel or PowerPoint, and gives you only the text. You can get plain text, Markdown (text with simple marks for headings and lists) or a structured view. If your Office file is locked, type its password. A scanned PDF with no real text will give little or nothing.
For example, you copy the words of a Word report into an e-mail or another program.
How to use it
- Choose this tool.
- Add your document with Upload or drag and drop.
- Choose plain text, Markdown or structured.
- Press Generate.
- Copy the text or download it.
What you get back
You get the text on screen to copy, or as a file to download.
GOOD TO KNOW
Scanned PDFs have no text layer: use /v1/pdfs/ocr first. With output=url the text comes back as a file (txt, md or json), and response, filename and filename_template deliver and name it like any other file; with output=inline (the default) there is no file, so those three parameters are accepted and change nothing.
TEST IT LIVE
Try Document Text in the Studio
One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Family
Documents
Plan
Free
Method
POST
Endpoint
/v1/documents/text
Tool ID
documents.text
Authentication
API key
Accepts
PDF, DOCX, XLSX, PPTX, ODT, ODS +25 more
Background jobs
Yes
Usage group
Documents
For developers
Use it from your code
cURL
curl -X POST "https://app.h2i.davixlabs.io/v1/documents/text" \
-H "X-Api-Key: $DAVIX_H2I_API_KEY" \
-F 'file=@document.pdf' \
-F 'format=txt' \
-F 'output=inline' \
-F 'response=url'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.documents.text({
"file": 'document.pdf',
"format": "txt",
"output": "inline",
"response": "url"
});
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->documents()->text([
'file' => 'document.pdf',
'format' => 'txt',
'output' => 'inline',
'response' => 'url',
]);
echo $result->requestId;Documentation
Guides that use this tool
More in Documents
