pdfrx_web
    Preparing search index...

    Module @pdfrx/colab

    Collaborative React viewer, strict-revision session protocols, browser relay client, virtual-page adapter, and mixed-source PDF export composition for the pdfrx package family.

    The package keeps rendering and PDF mutation client-local. A relay sequences semantic page, annotation, and form operations; each participant applies the resulting authoritative state to its own open PdfDocument instances.

    @pdfrx/colab

    Collaborative PDF editing for @pdfrx/react. It provides a ready-made React viewer plus the browser client, operation protocols, page-source adapter, and mixed-source export tools needed to synchronize page, annotation, and form changes through an application-hosted relay.

    npm package · Local example · API reference · Detailed guide

    • Synchronizes page insertion, removal, movement, duplication, and rotation; annotations; and AcroForm values.
    • Ordered, revision-checked semantic operations keep WebSocket traffic small and provide authoritative late-join snapshots.
    • Page, annotation, and form changes use independent revision streams so one kind of edit does not block the others.
    • Transient move/resize previews appear remotely without entering persistent snapshots, PDF state, or Undo/Redo history.
    • Stable page-placement and source IDs support documents assembled from multiple immutable PDFs and images.
    • The ready-made React viewer retains the standard @pdfrx/react toolbar, responsive layout, editing tools, and export UI.
    • Lower-level clients, reducers, source adapters, and mixed-source PDF export are available for custom applications and relay implementations.
    • Authentication, persistence, admission, retention, and deployment remain explicit application responsibilities rather than hidden hosted services.
    npm install @pdfrx/colab @pdfrx/react react react-dom
    
    import { CollaborativePdfViewer } from '@pdfrx/colab';
    import '@pdfrx/react/styles.css';
    import '@pdfrx/colab/styles.css';

    export function ReviewRoom() {
    return (
    <CollaborativePdfViewer
    actorId="user-42"
    relayUrl="wss://relay.example.com/collaboration"
    sessionId="review-123"
    src="/documents/review.pdf"
    wasmModulesUrl="/pdfium/"
    className="review-room"
    />
    );
    }
    .review-room {
    height: 100dvh;
    min-height: 0;
    }

    relayUrl must be an application-hosted WebSocket service implementing the exported collaboration protocol. This package does not include or operate a hosted production service. The relay must sequence revision-checked page, annotation, and form operations and expose immutable PDF/raster source PUT/GET endpoints.

    Run npm run dev:colab in this repository to start the example application and reference relay for local development.

    MIT

    AnnotationProtocolError
    FormProtocolError
    PageCollaborationClient
    PageProtocolError
    PageSourceRegistry
    RelayOperationError
    AnnotationOperationRequest
    AnnotationPreview
    AnnotationSessionSnapshot
    CollaborationJoinOptions
    CollaborationJoinRequest
    CollaborationTransport
    CollaborationWebSocket
    CollaborativePdfViewerProps
    CommittedAnnotationOperation
    CommittedFormOperation
    CommittedPageOperation
    FormOperationRequest
    FormSessionSnapshot
    MappedOutlineNode
    PageOperationRequest
    PageSessionSnapshot
    SharedAnnotationImageSource
    SharedAnnotationRecord
    SharedAnnotationUpdate
    SharedFormFieldChange
    SharedFormFieldRecord
    AnnotationPreviewListener
    AnnotationSessionListener
    ClientRelayMessage
    CollaborationConnectionState
    CollaborationConnectionStateListener
    CollaborationFetch
    CollaborationJoinRequestListener
    CollaborationJoinResolutionListener
    CollaborationPresenceListener
    CollaborationWebSocketFactory
    FormSessionListener
    PageProtocolErrorCode
    PageSessionListener
    RelaySourceUrlResolver
    ServerRelayMessage
    SharedAnnotationChange
    SharedAnnotationSpec
    applyCommittedAnnotationOperation
    applyCommittedFormOperation
    applyCommittedPageOperation
    applyPagePlacementsToViewer
    CollaborativePdfViewer
    commitAnnotationOperation
    commitFormOperation
    commitPageOperation
    createPagePlacements
    describePageOperation
    duplicatePlacement
    encodeCollaborativePdf
    fetchRelaySource
    movePlacementToIndex
    parseClientRelayMessage
    parseServerRelayMessage
    relaySourceUrl
    resolvePagePlacements
    rotatePlacement
    uploadRelayAsset
    uploadRelaySource
    validatePageSessionSnapshot