Skip to main content

is-url-pdf

Documentation / extractor/pdf-to-html/util/is-url-pdf

Extract​

isUrlPDF()​

function isUrlPDF(url: string): Promise<boolean>;

Defined in: extractor/pdf-to-html/util/is-url-pdf.js:12

Detects if a given URL points to a PDF file by checking the stream's first bytes for %PDF- then ends the request. Useful for hidden pdf url that does not end with pdf

Parameters​

ParameterTypeDescription

url

string

The URL to check.

Returns​

Promise<boolean>

True if the URL points to a PDF, false otherwise.

Author​

ai-research-agent (2024)