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

Method parse

src/parser/document-parser.ts:159–173  ·  view source on GitHub ↗

* Parse the PDF document.

()

Source from the content-addressed store, hash-verified

157 * Parse the PDF document.
158 */
159 parse(): ParsedDocument {
160 try {
161 return this.parseNormal();
162 } catch (error) {
163 // Only attempt recovery for recoverable parsing errors
164 if (this.options.lenient && error instanceof RecoverableParseError) {
165 this.warnings.push(`Normal parsing failed: ${error.message}`);
166
167 return this.parseWithRecovery();
168 }
169
170 // All other errors propagate (credentials, unsupported features, etc.)
171 throw error;
172 }
173 }
174
175 /**
176 * Normal parsing path.

Callers 5

loadMethod · 0.95
reloadMethod · 0.95

Calls 3

parseNormalMethod · 0.95
parseWithRecoveryMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected