Proofread page text and PDFs in a test

page.ai.proofread() checks visible page text, a PDF, or any string for spelling, grammar, and brand-name errors, and page.extractPdfText() reads PDFs, including scans, with OCR.

Typos in a pricing page, a datasheet, or a published contract are easy to ship and hard to catch by eye. page.ai.proofread() checks text for spelling, grammar, and brand errors and returns each finding with its location, type, word, confidence, and suggested fix. page.extractPdfText() reads a PDF from a URL, a path, or bytes, and uses OCR for scanned pages.

const report = await page.ai.proofread({
  glossary: { allowed: ['Continuous Quality'], brands: ['Donobu'] },
});
expect(report.findings).toEqual([]);

await page.ai.proofread({
  text: await page.extractPdfText({ source: '/terms.pdf' }),
  failOnErrors: true,
});
  • Glossary rules: allowed terms are never flagged, and brand spellings are enforced
  • Product codes and part numbers are not treated as words
  • Findings point to the PDF page, line, and character
  • Verdicts are cached per line, so unchanged text costs nothing on reruns