Anthony Stirling de717d219a fix: add document ready guards to PDF viewer bridges
Introduces useDocumentReady hook to prevent race conditions when PDF
operations execute before document is fully loaded.

Changes:
- New useDocumentReady() hook tracks document lifecycle
  - Subscribes to onDocumentOpened (sets true)
  - Subscribes to onDocumentClosed (resets to false)
  - Synchronous initial check (no debounce needed)

- Apply documentReady guards to all viewer bridges:
  - AnnotationAPIBridge: guard keyboard deletion
  - AttachmentAPIBridge: guard attachment operations
  - BookmarkAPIBridge: guard bookmark operations
  - DocumentPermissionsAPIBridge: guard permission checks
  - ExportAPIBridge: guard export operations
  - HistoryAPIBridge: guard undo/redo
  - PanAPIBridge: guard pan mode
  - PrintAPIBridge: guard print operations
  - RedactionAPIBridge: guard redaction operations
  - RotateAPIBridge: guard rotation
  - ScrollAPIBridge: guard scroll operations
  - SearchAPIBridge: guard search functionality
  - SelectionAPIBridge: guard selection operations
  - SignatureAPIBridge: guard signature placement
  - SpreadAPIBridge: guard spread mode
  - ThumbnailAPIBridge: guard thumbnail operations
  - ZoomAPIBridge: guard zoom operations

Prevents errors and undefined behavior when user interacts with viewer
before PDF document has fully initialized.

Fixes timing issues with large PDFs and slow network conditions.
2026-02-16 10:41:19 +00:00
2026-02-06 13:45:32 +00:00
2025-12-21 10:40:32 +00:00
2025-12-02 17:15:29 +00:00
2025-09-04 14:08:28 +01:00
2026-02-06 18:06:01 +00:00

Stirling PDF logo

Stirling PDF - The Open-Source PDF Platform

Stirling PDF is a powerful, open-source PDF editing platform. Run it as a personal desktop app, in the browser, or deploy it on your own servers with a private API. Edit, sign, redact, convert, and automate PDFs without sending documents to external services.

Docker Pulls Discord OpenSSF Scorecard GitHub Repo stars

Stirling PDF - Dashboard

Key Capabilities

  • Everywhere you work - Desktop client, browser UI, and self-hosted server with a private API.
  • 50+ PDF tools - Edit, merge, split, sign, redact, convert, OCR, compress, and more.
  • Automation & workflows - No-code pipelines direct in UI with APIs to process millions of PDFs.
  • Enterprise‑grade - SSO, auditing, and flexible on‑prem deployments.
  • Developer platform - REST APIs available for nearly all tools to integrate into your existing systems.
  • Global UI - Interface available in 40+ languages.

For a full feature list, see the docs: https://docs.stirlingpdf.com

Quick Start

docker run -p 8080:8080 docker.stirlingpdf.com/stirlingtools/stirling-pdf

Then open: http://localhost:8080

For full installation options (including desktop and Kubernetes), see our Documentation Guide.

Resources

Support

Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

For development setup, see the Developer Guide.

For adding translations, see the Translation Guide.

License

Stirling PDF is open-core. See LICENSE for details.

Languages
Java 49.9%
TypeScript 39.9%
Python 4.3%
CSS 2.7%
Shell 0.9%
Other 2.2%