Tools,

Handwritten PDF to text: 4 tools, tested

66.3%

of handwritten words found, Apple Vision

Get the script

Free on a Mac, 29 lines

0.8 s a page

81 of 100 pages at half the words or more

  1. If swift is missing, run xcode-select --install.
  2. Save pdf2text.swift, also below.
  3. Run swift pdf2text.swift notes.pdf > notes.txt.
  4. Check names, dates and numbers against the PDF.
pdf2text.swift
// Handwritten PDF to text with Apple Vision. Tested on macOS 26.6.
// Run: swift pdf2text.swift notes.pdf > notes.txt   (a second argument sets the render dpi, default 300)
import Foundation
import PDFKit
import Vision

let args = CommandLine.arguments
guard args.count > 1, let doc = PDFDocument(url: URL(fileURLWithPath: args[1])) else {
    print("usage: swift pdf2text.swift file.pdf [dpi]"); exit(1)
}
let scale = (args.count > 2 ? Double(args[2]) ?? 300 : 300) / 72 // 72 to 300 dpi: within 1 point in our test
for n in 0..<doc.pageCount {
    let page = doc.page(at: n)!
    let size = page.bounds(for: .mediaBox).applying(page.transform(for: .mediaBox)).size // turned pages too
    let w = Int(size.width * scale), h = Int(size.height * scale)
    let ctx = CGContext(data: nil, width: w, height: h, bitsPerComponent: 8, bytesPerRow: 0,
                        space: CGColorSpaceCreateDeviceRGB(), bitmapInfo: CGImageAlphaInfo.noneSkipLast.rawValue)!
    ctx.setFillColor(.white)
    ctx.fill(CGRect(x: 0, y: 0, width: w, height: h))
    ctx.scaleBy(x: scale, y: scale)
    page.draw(with: .mediaBox, to: ctx)
    let req = VNRecognizeTextRequest()
    req.recognitionLevel = .accurate // .fast finds almost no handwriting
    req.usesLanguageCorrection = true
    req.recognitionLanguages = ["en-US"]
    try VNImageRequestHandler(cgImage: ctx.makeImage()!, options: [:]).perform([req])
    if n > 0 { print("\u{0C}") } // a form feed between pages, as pdftotext writes
    for line in req.results ?? [] { print(line.topCandidates(1).first?.string ?? "") }
}

It draws each page, then Apple's text reader reads it. Pages come out in order, split by a form feed.

Not on a Mac: RapidOCR, 15 lines

  1. Run pip install rapidocr onnxruntime pypdfium2.
  2. Save pdf2text.py, also below.
  3. Run python -X utf8 pdf2text.py notes.pdf > notes.txt.
pdf2text.py
# Handwritten PDF to text with RapidOCR, for Windows, Linux or a Mac. Tested on a Mac, Nov 2026.
# Install: pip install rapidocr onnxruntime pypdfium2
# Run: python -X utf8 pdf2text.py notes.pdf > notes.txt
import sys

import numpy as np
import pypdfium2 as pdfium
from rapidocr import RapidOCR

engine = RapidOCR()
for n, page in enumerate(pdfium.PdfDocument(sys.argv[1])):
    image = np.asarray(page.render(scale=300 / 72).to_pil().convert("RGB"))
    if n:
        print("\f")  # a form feed between pages
    print("\n".join(engine(image).txts or ()))

It found fewer words than Apple's reader, but it is plain Python, with no account and no upload. I ran it on a Mac only.

Apple's reader found the most words

Same 10 PDFs, 100 pages, same scorer
Tool Found Right
Apple Vision, the script 66.3% 68.4%
RapidOCR 54.5% 58.1%
Our Actor 52.7% 53.5%
OCRmyPDF, psm 11 16.1% 13.1%
OCRmyPDF 12.2% 24.0%
Copy and paste 0.0% no text

Found is the share of the 5,473 true words that came out. Right is the share of output words that are true.

The PDF barely matters to Apple's reader

Apple Vision, words found on 100 pages
PDF drawn at 300 dpi
66.3%
PDF drawn at 150 dpi
66.6%
PDF drawn at 72 dpi
65.7%
The same notes as photos
66.5%

From the PDFs it found 13 fewer words than from the photos. Drawing pages at 150 dpi was as good as 300, and faster:

59 s for 100 pages at 150 dpi

78 s for 100 pages at 300 dpi

Searchable is not the same as read

OCRmyPDF adds a hidden text layer, so search and copy work. But the words in that layer are Tesseract's, and Tesseract is built for print.

12.2% of the words found

42 of 100 pages with no text at all

Its --tesseract-pagesegmode 11 found a little more, and still left 19 pages empty. Before OCR, pdftotext found 0 words: each page is only a picture.

Typed PDFs to text, no install

Run it yourself. Our Apify Actor reads a PDF as it is, $0.006 a scanned page. It is built for print: here it found 52.7% of the handwritten words.

Try the Actor

Or send us the scan. Tack, our AI, does the job for $29, up to 50 pages. Printed text only.

Get one page free

How I tested it
  • Pages: the 100 GNHK test notes of handwritten notes to text, camera photos of real handwriting, 5,473 true words.
  • PDFs: each photo turned upright, saved as a JPEG and put on a US Letter page with img2pdf 0.6.1. 10 PDFs of 10 pages, no text layer. The photos sit at 73 to 532 dpi on the page, 266.5 in the middle.
  • Score: true words found in any order, with the scorer of the notes page. Each PDF page is matched to its note.
  • Mac: macOS 26.6 on Apple Silicon, one PDF at a time, at the lowest priority. Times are wall clock for all 100 pages, with the script built by swiftc -O first.
  • Other tools: our Actor's code at build 0.1.83, run on this Mac, plain text out. The live Actor is now build 0.1.84, which I did not rerun.
  • OCRmyPDF 17.13.0 with Tesseract 5.5.4, at its defaults and with page mode 11. RapidOCR 3.10.0, its default models. pdftotext from Poppler 26.03.0, for the copy and paste row.
  • Only Apple's times are shown. Other jobs shared the Mac during the slower runs.
What I did not test
  • PDFs from tablet note apps such as Goodnotes, where the ink is drawn lines, not a photo.
  • Cloud tools such as Google Drive and Adobe Acrobat.
  • Languages other than English, and printed text.
Sources

Questions people ask

How do I convert a handwritten PDF to text for free?

On a Mac, run the free script on this page. Apple Vision found 66.3% of the words on 100 handwritten pages. On Windows or Linux, use RapidOCR: it found 54.5% in the same test, run on a Mac.

Why can't I copy text from a handwritten PDF?

A scanned page is often just a picture, with no text inside. pdftotext found 0 words in all 10 test PDFs. An OCR tool must read the picture first.

Can I convert a handwritten PDF to Word?

Get the text first, then paste it into Word. Keep the PDF open next to it. Check names, dates and numbers first.