From d143d2c660ef583fcb9a5cae9060f22fa34a9605 Mon Sep 17 00:00:00 2001 From: electrovir Date: Wed, 8 May 2024 14:15:38 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20electrov?= =?UTF-8?q?ir/pdf-text-reader@12568d5cbb52c25450700f520961953d784413ed=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/combinePagesIntoSingleString.html | 4 ++-- functions/parsePage.html | 4 ++-- functions/parsePageItems.html | 4 ++-- functions/readPdfPages.html | 4 ++-- functions/readPdfText.html | 4 ++-- index.html | 4 ++-- modules.html | 4 ++-- types/PartialWithUndefined.html | 4 ++-- types/PdfPage.html | 4 ++-- types/PdfProgressData.html | 4 ++-- types/ReadPdfTextParams.html | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/functions/combinePagesIntoSingleString.html b/functions/combinePagesIntoSingleString.html index 0817730..b669822 100644 --- a/functions/combinePagesIntoSingleString.html +++ b/functions/combinePagesIntoSingleString.html @@ -1,2 +1,2 @@ -combinePagesIntoSingleString | pdf-text-reader - v5.0.1

Function combinePagesIntoSingleString

  • Combine all PDF pages into a single string.

    -

    Parameters

    Returns string

\ No newline at end of file +combinePagesIntoSingleString | pdf-text-reader - v5.1.0

Function combinePagesIntoSingleString

  • Combine all PDF pages into a single string.

    +

    Parameters

    Returns string

\ No newline at end of file diff --git a/functions/parsePage.html b/functions/parsePage.html index c3f76cb..45081f4 100644 --- a/functions/parsePage.html +++ b/functions/parsePage.html @@ -1,2 +1,2 @@ -parsePage | pdf-text-reader - v5.0.1

Function parsePage

\ No newline at end of file +parsePage | pdf-text-reader - v5.1.0

Function parsePage

\ No newline at end of file diff --git a/functions/parsePageItems.html b/functions/parsePageItems.html index 8b7d244..87ee037 100644 --- a/functions/parsePageItems.html +++ b/functions/parsePageItems.html @@ -1,5 +1,5 @@ -parsePageItems | pdf-text-reader - v5.0.1

Function parsePageItems

  • Parses individual text items generated by pdf.js This allows lower level control of what actually +parsePageItems | pdf-text-reader - v5.1.0

    Function parsePageItems

    • Parses individual text items generated by pdf.js This allows lower level control of what actually gets parsed. For example, a consumer of this function may remove entire sections of the pdf text prior to passing items in here. See parsePage function above for example usage.

      Parameters

      • pdfItems: TextItem[]

        An array of TextItem items.

        -

      Returns PdfPage

    \ No newline at end of file +

Returns PdfPage

\ No newline at end of file diff --git a/functions/readPdfPages.html b/functions/readPdfPages.html index e00db01..b6f1848 100644 --- a/functions/readPdfPages.html +++ b/functions/readPdfPages.html @@ -1,4 +1,4 @@ -readPdfPages | pdf-text-reader - v5.0.1

Function readPdfPages

  • Read a PDF and convert it into lines of text.

    +readPdfPages | pdf-text-reader - v5.1.0

    Function readPdfPages

    • Read a PDF and convert it into lines of text.

      If a URL is used to fetch the PDF data a standard XMLHttpRequest(XHR) is used, which means it must follow the same origin rules that any XHR does e.g. No cross domain requests without CORS.

      -

      Parameters

      Returns Promise<PdfPage[]>

    \ No newline at end of file +

    Parameters

    Returns Promise<PdfPage[]>

\ No newline at end of file diff --git a/functions/readPdfText.html b/functions/readPdfText.html index 387239c..7890735 100644 --- a/functions/readPdfText.html +++ b/functions/readPdfText.html @@ -1,2 +1,2 @@ -readPdfText | pdf-text-reader - v5.0.1

Function readPdfText

\ No newline at end of file +readPdfText | pdf-text-reader - v5.1.0

Function readPdfText

\ No newline at end of file diff --git a/index.html b/index.html index 1bfcaef..4cfbcc3 100644 --- a/index.html +++ b/index.html @@ -1,4 +1,4 @@ -pdf-text-reader - v5.0.1

pdf-text-reader - v5.0.1

PDF Text Reader

Dead simple PDF text reader for Node.js. Uses Mozilla's pdfjs-dist package.

+pdf-text-reader - v5.1.0

pdf-text-reader - v5.1.0

PDF Text Reader

Dead simple PDF text reader for Node.js. Uses Mozilla's pdfjs-dist package.

Requires ESM and Node.js v22 or greater. (These are requirements from Mozilla's pdf-dist package itself.)

Install

npm install pdf-text-reader
 
@@ -29,4 +29,4 @@
import * as pdfjs from 'pdfjs-dist';
import type {TextItem} from 'pdfjs-dist/types/src/display/api';
import {parsePageItems} from 'pdf-text-reader';

async function main() {
const doc = await pdfjs.getDocument('myDocument.pdf').promise;
const page = await doc.getPage(1); // 1-indexed
const content = await page.getTextContent();
const items: TextItem[] = content.items.filter((item): item is TextItem => 'str' in item);
const parsedPage = parsePageItems(items);
console.info(parsedPage.lines);
}

main();
-
\ No newline at end of file +
\ No newline at end of file diff --git a/modules.html b/modules.html index 471f403..bc6d4fb 100644 --- a/modules.html +++ b/modules.html @@ -1,4 +1,4 @@ -pdf-text-reader - v5.0.1

pdf-text-reader - v5.0.1

Index

Type Aliases

PartialWithUndefined +pdf-text-reader - v5.1.0

pdf-text-reader - v5.1.0

Index

Type Aliases

\ No newline at end of file +
\ No newline at end of file diff --git a/types/PartialWithUndefined.html b/types/PartialWithUndefined.html index bd6f7bc..c6edafe 100644 --- a/types/PartialWithUndefined.html +++ b/types/PartialWithUndefined.html @@ -1,3 +1,3 @@ -PartialWithUndefined | pdf-text-reader - v5.0.1

Type alias PartialWithUndefined<T>

PartialWithUndefined<T>: {
    [Prop in keyof T]?: T[Prop]
}

Same as the built-in Partial type but also allows each property to be undefined. Compatible with +PartialWithUndefined | pdf-text-reader - v5.1.0

Type alias PartialWithUndefined<T>

PartialWithUndefined<T>: {
    [Prop in keyof T]?: T[Prop]
}

Same as the built-in Partial type but also allows each property to be undefined. Compatible with PartialAndUndefined from @augment-vir/common.

-

Type Parameters

  • T extends object
\ No newline at end of file +

Type Parameters

  • T extends object
\ No newline at end of file diff --git a/types/PdfPage.html b/types/PdfPage.html index 6ec9a87..09fbd60 100644 --- a/types/PdfPage.html +++ b/types/PdfPage.html @@ -1,2 +1,2 @@ -PdfPage | pdf-text-reader - v5.0.1

Type alias PdfPage

PdfPage: {
    lines: string[];
}

A single page within a PDF file.

-

Type declaration

  • lines: string[]
\ No newline at end of file +PdfPage | pdf-text-reader - v5.1.0

Type alias PdfPage

PdfPage: {
    lines: string[];
}

A single page within a PDF file.

+

Type declaration

  • lines: string[]
\ No newline at end of file diff --git a/types/PdfProgressData.html b/types/PdfProgressData.html index 0f3ca1b..c231942 100644 --- a/types/PdfProgressData.html +++ b/types/PdfProgressData.html @@ -1,2 +1,2 @@ -PdfProgressData | pdf-text-reader - v5.0.1

Type alias PdfProgressData

PdfProgressData: {
    loaded: number;
    total: number;
}

Progress updates sent by the pdfjs-dist dependency.

-

Type declaration

  • loaded: number
  • total: number
\ No newline at end of file +PdfProgressData | pdf-text-reader - v5.1.0

Type alias PdfProgressData

PdfProgressData: {
    loaded: number;
    total: number;
}

Progress updates sent by the pdfjs-dist dependency.

+

Type declaration

  • loaded: number
  • total: number
\ No newline at end of file diff --git a/types/ReadPdfTextParams.html b/types/ReadPdfTextParams.html index 43d0635..cab07ac 100644 --- a/types/ReadPdfTextParams.html +++ b/types/ReadPdfTextParams.html @@ -1,2 +1,2 @@ -ReadPdfTextParams | pdf-text-reader - v5.0.1

Type alias ReadPdfTextParams

ReadPdfTextParams: PartialWithUndefined<{
    password: string;
    pathToPdfJsDistNodeModule: string;
    progressCallback: ((progressData) => void);
}> & RequireExactlyOne<{
    allOptions: DocumentInitParameters;
    data: DocumentInitParameters["data"];
    filePath: string;
    url: string;
}>

All options for reading pdf text to function. Most are optional.

-
\ No newline at end of file +ReadPdfTextParams | pdf-text-reader - v5.1.0

Type alias ReadPdfTextParams

ReadPdfTextParams: PartialWithUndefined<{
    options: Partial<Omit<DocumentInitParameters, "data" | "url">>;
    password: string;
    pathToPdfJsDistNodeModule: string;
    progressCallback: ((progressData) => void);
}> & RequireExactlyOne<{
    data: NonNullable<DocumentInitParameters["data"]>;
    filePath: NonNullable<DocumentInitParameters["url"]>;
    url: NonNullable<DocumentInitParameters["url"]>;
}>

All options for reading pdf text to function. Most are optional.

+
\ No newline at end of file