0.2.2 • Published 5 months ago

@kazuhi-ra/is-openable-pdf v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Motivation

@kazuhi-ra/is-openable-pdf is a utility library that determines whether a PDF file can be opened in a standard PDF viewer. It returns true if the file is not password-protected or if the user password is set to the default (an empty string).

In browser environments, JavaScript alone cannot detect password protection on PDF files—particularly when the user password is an empty string. This library leverages WebAssembly to bypass that limitation and perform accurate checks on PDF accessibility.

Install

npm install @kazuhi-ra/is-openable-pdf

Quick Start

import { isOpenablePdf } from '@kazuhi-ra/is-openable-pdf';

// Check a File object
const isOpenable = await isOpenablePdf(file);

API

isOpenablePdf(file: File | Uint8Array): Promise<boolean>

License

MIT

0.2.2

5 months ago

0.2.1

6 months ago

0.2.0

6 months ago

0.1.0

6 months ago