PDF to Text API

Extract text from text-based PDFs for search, indexing, and analysis in your application.

From PDF documents to text

A PDF flows through the PDF to Text API and returns as extracted text.

Extract text from a PDF with one API call

Extract text from a local PDF and save it as a TXT file.

curl --fail --user "demo:demo" \
  --form "input_format=pdf" \
  --form "output_format=txt" \
  --form "file=@input.pdf" \
  --output "document.txt" \
  https://api.pdfcrowd.com/convert/24.04/
import pdfcrowd

api = pdfcrowd.PdfToTextClient("demo", "demo")
api.convertFileToFile("input.pdf", "document.txt")
<?php
require "pdfcrowd.php";

$api = new \Pdfcrowd\PdfToTextClient("demo", "demo");
$api->convertFileToFile("input.pdf", "document.txt");
var pdfcrowd = require("pdfcrowd");
var api = new pdfcrowd.PdfToTextClient("demo", "demo");
api.convertFileToFile("input.pdf", "document.txt",
    function(error, fileName) {
        if (error) return console.error(error);
        console.log("Created " + fileName);
    });
import com.pdfcrowd.*;

Pdfcrowd.PdfToTextClient api =
    new Pdfcrowd.PdfToTextClient("demo", "demo");
api.convertFileToFile("input.pdf", "document.txt");
pdfcrowd.PdfToTextClient api =
    new pdfcrowd.PdfToTextClient("demo", "demo");
api.convertFileToFile("input.pdf", "document.txt");
require "pdfcrowd"

api = Pdfcrowd::PdfToTextClient.new("demo", "demo")
api.convertFileToFile("input.pdf", "document.txt")
package main

import "github.com/pdfcrowd/pdfcrowd-go"

func main() {
    api := pdfcrowd.NewPdfToTextClient("demo", "demo")
    err := api.ConvertFileToFile("input.pdf", "document.txt")
    if err != nil {
        panic(err)
    }
}

Use a file or a URL

Upload a text-based PDF, send its binary data, or provide its URL. The API reads the PDF's text layer and returns a TXT file. Extract the whole document or select the pages your application needs.

PDFCrowd runs the text extraction, so your application can receive the text without installing a local PDF parser. Choose layout-preserving or reading-order output to suit the next processing step.

Choose how the text is extracted

Selection

Extract selected pages or a defined area of a page.

Layout

Choose layout-preserving or reading-order output and configure page breaks and line endings.

Cleanup

Use paragraph detection and options for hyphens and empty lines.

Common uses

  • Supply PDF content to an application's search index.
  • Extract text for analysis or a document-ingestion pipeline.

From PDF to Text

Source PDF
Extracted TXT

Other PDFCrowd products and tools

PDF to HTML API

Display PDF pages as fixed-layout HTML with text and images.

PDF to PDF API

Extract selected pages into another PDF or merge existing documents.

Ready to extract text from your PDFs?

Try the API with a document your application needs to process.