PdfPageText
Import from: @xbbg/xnews
Defined in: src/pdf.ts (declaration: pdf.d.ts:16)
PDF text extraction, dependency-free.
This reads the text layer; it does not render and it does not OCR. The strategy is deliberately structural rather than xref-driven: real files from these catalogs have broken, hybrid, or stream-based cross-reference tables, so objects are collected by scanning for N G obj … endobj and then expanding every /ObjStm compressed object stream. Two of three sample files from arXiv, BIS, and the Internet Archive carry 30+ object streams, so skipping them would lose most of the document.
Character mapping comes from each font's /ToUnicode CMap when present. Without one, a simple font's bytes are read as WinAnsi and a composite font is reported as lossy rather than silently emitting the wrong glyphs.
Properties
page
readonlypage:number
Defined in: src/pdf.ts (declaration: pdf.d.ts:18)
1-based page number in document order.
text
readonlytext:string
Defined in: src/pdf.ts (declaration: pdf.d.ts:19)
