);
}
```
### Response
N/A (Client-side Hook)
```
--------------------------------
### Synchronize Viewer State with UI
Source: https://github.com/pdfcrafttool/pdfcraft/blob/main/public/pdfjs-viewer/form-viewer.html
Listens for 'pagechanging' events to update the page number input field and toggle the disabled state of navigation buttons.
```javascript
eventBus.on('pagechanging', (evt) => { document.getElementById('pageNumber').value = evt.pageNumber; document.getElementById('previousPage').disabled = evt.pageNumber <= 1; document.getElementById('nextPage').disabled = evt.pageNumber >= pdfDocument?.numPages; });
```
--------------------------------
### Next.js Configuration for Unoptimized Images
Source: https://github.com/pdfcrafttool/pdfcraft/blob/main/DEPLOYMENT.md
Configuration within next.config.js to disable image optimization. This is sometimes necessary for specific image types or when dealing with assets that should not be processed by Next.js's image optimization pipeline.
```javascript
images: {
unoptimized: true
}
```
--------------------------------
### GitHub Pages DNS Configuration
Source: https://github.com/pdfcrafttool/pdfcraft/blob/main/DEPLOYMENT.md
DNS record requirements for pointing a custom domain to a GitHub Pages site.
```text
Type: CNAME
Name: www (or @)
Value: your-username.github.io
```
--------------------------------
### POST /api/pdf/convert/pdf-to-images
Source: https://context7.com/pdfcrafttool/pdfcraft/llms.txt
Converts PDF pages into image formats like PNG, JPG, or WebP with resolution and layout controls.
```APIDOC
## POST /api/pdf/convert/pdf-to-images
### Description
Converts PDF pages to images with configurable resolution and grid layout options.
### Method
POST
### Endpoint
/api/pdf/convert/pdf-to-images
### Parameters
#### Request Body
- **pdfFile** (File) - Required - The source PDF file
- **format** (string) - Required - Output format (png, jpg, webp, etc.)
- **scale** (number) - Optional - Resolution scale factor
- **pages** (Array