MCPcopy Create free account
hub / github.com/LibPDF-js/core / parseNormal

Method parseNormal

src/parser/document-parser.ts:178–192  ·  view source on GitHub ↗

* Normal parsing path.

()

Source from the content-addressed store, hash-verified

176 * Normal parsing path.
177 */
178 private parseNormal(): ParsedDocument {
179 // Phase 1: Parse header
180 const version = this.parseHeader();
181
182 // Phase 2: Find startxref
183 const xrefParser = new XRefParser(this.scanner);
184
185 const startXRef = xrefParser.findStartXRef();
186
187 // Phase 3: Parse XRef chain (follow /Prev)
188 const { xref, trailer } = this.parseXRefChain(xrefParser, startXRef);
189
190 // Phase 4: Build document with lazy object loading
191 return this.buildDocument(version, xref, trailer, false);
192 }
193
194 /**
195 * Recovery parsing using brute-force when normal parsing fails.

Callers 1

parseMethod · 0.95

Calls 4

parseHeaderMethod · 0.95
findStartXRefMethod · 0.95
parseXRefChainMethod · 0.95
buildDocumentMethod · 0.95

Tested by

no test coverage detected