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

Method extractText

src/api/pdf.ts:3096–3105  ·  view source on GitHub ↗

* Extract text from all pages in the document. * * Returns an array of PageText objects, one per page, containing * structured text content with position information. * * @returns Array of PageText for each page * * @example * ```typescript * const allText = await pdf.extr

()

Source from the content-addressed store, hash-verified

3094 * ```
3095 */
3096 extractText(): PageText[] {
3097 const pages = this.getPages();
3098 const results: PageText[] = [];
3099
3100 for (const page of pages) {
3101 results.push(page.extractText());
3102 }
3103
3104 return results;
3105 }
3106
3107 /**
3108 * Search for text across all pages in the document.

Callers 5

mainFunction · 0.45
mainFunction · 0.45

Calls 2

getPagesMethod · 0.95
pushMethod · 0.80

Tested by

no test coverage detected