pdfrx_web
    Preparing search index...

    Interface PdfRawObjectEditor

    Builds a batch of raw PDF-object edits for PdfDocument.editRawObjects.

    Methods only record operations while the callback runs. No document mutation occurs until the callback completes. The batch is then sent in one worker command, either directly or through the temporary-copy transaction selected by PdfRawObjectEditOptions.atomic.

    A target says where to edit; a patch value says what to store. Use catalog or object for a starting target and at for a nested dictionary/array container. createDictionary returns a PdfRawCreatedObject: pass it directly as a later target, or pass its reference property as a value in another object.

    interface PdfRawObjectEditor {
        appendArrayValue(target: PdfRawTarget, value: PdfRawPatchValue): void;
        at(target: PdfRawTarget, ...path: (string | number)[]): PdfRawTarget;
        catalog(): PdfRawTarget;
        createDictionary(
            entries?: Record<string, PdfRawPatchValue>,
        ): PdfRawCreatedObject;
        object(objectNumber: number): PdfRawTarget;
        removeArrayValue(target: PdfRawTarget, index: number): void;
        removeDictionaryValue(target: PdfRawTarget, key: string): void;
        setArrayValue(
            target: PdfRawTarget,
            index: number,
            value: PdfRawPatchValue,
        ): void;
        setDictionaryValue(
            target: PdfRawTarget,
            key: string,
            value: PdfRawPatchValue,
        ): void;
        setStreamData(target: PdfRawTarget, data: Uint8Array): void;
    }
    Index
    • Returns a target for a nested container below target.

      String components select dictionary keys without the leading /; number components select zero-based array items. Indirect references encountered between components are dereferenced automatically.

      Parameters

      • target: PdfRawTarget

        The target value.

      • ...path: (string | number)[]

        The path value (string or number[]).

      Returns PdfRawTarget

      The resulting PdfRawTarget.

      const firstKid = editor.at(editor.object(pagesObjectNumber), 'Kids', 0);
      
    • Replaces a stream's decoded bytes. PDFium updates the stream representation when the document is encoded.

      Parameters

      • target: PdfRawTarget

        The target value.

      • data: Uint8Array

        The input data.

      Returns void