https://github.com/osiris-team/pdf.js-utils
A collection of utility functions for pdf.js to make the lives of developers easier.
https://github.com/osiris-team/pdf.js-utils
Last synced: 5 months ago
JSON representation
A collection of utility functions for pdf.js to make the lives of developers easier.
- Host: GitHub
- URL: https://github.com/osiris-team/pdf.js-utils
- Owner: Osiris-Team
- License: mit
- Created: 2024-08-01T11:54:22.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-01T12:03:57.000Z (almost 2 years ago)
- Last Synced: 2025-04-04T05:51:10.210Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 9.77 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pdf.js-utils
A collection of utility functions for pdf.js to make the lives of developers easier.
### Usage
Copy [src.js](./src.js) into your project or prepend it to your JavaScript code
to be able to use the additional functions provided.
### Adding/Removing Text Fields
Direct Usage: `addTextEditor(1, "hello world!")`
Safe Usage:
```js
waitForAnnotationEditorLayer()
.then(() => {
console.log('All annotation editor layers are ready!');
// Your code here that depends on the pageEditorLayer, for example:
addTextEditor(1, "hello world!")
})
.catch(error => {
console.error(error);
});
```