is-url-pdf
ai-research-agent / extractor/pdf-to-html/util/is-url-pdf
Extract
isUrlPDF()
function isUrlPDF(url): Promise<boolean>
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
Parameter | Type | Description |
---|---|---|
|
| The URL to check. |
Returns
Promise
<boolean
>
True if the URL points to a PDF, false otherwise.