PDF Web SDK Documentation

Comprehensive Guide for Developers: UI & SDK Integration, Configuration, and API Reference

PDF Web SDK
    Preparing search index...

    Interface IPdfEditor

    Interface for PDF editing operations

    This interface provides methods to interact with PDF documents including:

    • File operations (open, save, close)
    • Document manipulation (pages, bookmarks, annotations)
    • Text and image content editing
    • Security settings
    • Metadata manipulation
    interface IPdfEditor {
        addAttachment(
            documentId: string,
            data: Readonly<IAddAttachmentData>,
        ): ResponseBase<IAddAttachmentResponse>;
        addBookmark(
            documentId: string,
            data: Readonly<IBookmarkRequestData>,
        ): ResponseBase<IAddBookmarkResponse>;
        addCustomSystemFonts(
            documentId: string,
            data: readonly ICustomSystemFonts[],
        ): Promise<Uint8Array<ArrayBufferLike>>;
        autoOrderAnnotation(
            documentId: string,
            data: Readonly<IAutoOrderAnnotationData>,
        ): ResponseBase<IUndoResponse>;
        beginTransaction(
            body: Readonly<IBeginTransactionData>,
        ): ResponseBase<string>;
        bookmarks(documentId: string): ResponseBase<IBookmarksResponse>;
        cancelTransaction(documentId: string): ResponseBase<IUndoResponse>;
        canChangeAnnotZOrder(
            documentId: string,
            data: Readonly<ICanChangeAnnotZOrderData>,
        ): ResponseBase<ICanChangeAnnotZOrderResponse>;
        canChangeElementZOrder(
            documentId: string,
            data: Readonly<ICanChangeElementZOrderData>,
        ): ResponseBase<ICanChangeElementZOrderResponse>;
        canChangeTextBlockZOrder(
            documentId: string,
            data: Readonly<IChangeTextBlockZOrder>,
        ): ResponseBase<ICanChangeTextBlockZOrderResponse>;
        changeAcroformValue(
            documentId: string,
            data: Readonly<IChangeAcroformValueData>,
        ): ResponseBase<IUndoResponse>;
        changeAnnotationProperties(
            documentId: string,
            data: Readonly<IChangeAnnotationPropertiesData>,
        ): ResponseBase<IChangeAnnotationPropertiesResponse>;
        changeAnnotOrder(
            documentId: string,
            data: Readonly<IChangeAnnotOrderData>,
        ): ResponseBase<IUndoResponse>;
        changeDocumentHistory(
            documentId: string,
            data: Readonly<IChangeDocumentHistoryData>,
        ): ResponseBase<Readonly<IUndoResponse>>;
        changeElementMatrix(
            documentId: string,
            data: Readonly<IChangeElementMatrixData>,
        ): ResponseBase<IChangeElementMatrixResponse>;
        changeElementOrder(
            documentId: string,
            data: Readonly<IChangeElementOrderData>,
        ): ResponseBase<IUndoResponse>;
        changeFontAttributes(
            documentId: string,
            data: Readonly<IChangeFontAttrsWorkerData>,
        ): ResponseBase<Readonly<ITextBlocksResponse>>;
        changeLayerState(
            documentId: string,
            data: Readonly<IChangeLayerStateData>,
        ): ResponseBase<IChangeLayerStateResponse>;
        changeListStyle(
            documentId: string,
            data: Readonly<IChangeListStyleData>,
        ): ResponseBase<Readonly<ITextBlocksResponse>>;
        changeMargin(
            documentId: string,
            body: Readonly<IChangeMarginData>,
        ): ResponseBase<IUndoResponse>;
        changePagesBoxes(
            documentId: string,
            body: Readonly<IChangePagesBoxesData>,
        ): ResponseBase<IUndoResponse>;
        changeParaAttrs(
            documentId: string,
            data: Readonly<IChangeParaAttrsData>,
        ): ResponseBase<Readonly<ITextBlocksResponse>>;
        changeProperties(
            documentId: string,
            body: Readonly<IChangePropertiesData>,
        ): ResponseBase<IUndoResponse>;
        changeTextBlockZOrder(
            documentId: string,
            data: Readonly<IChangeTextBlockZOrderData>,
        ): ResponseBase<ITextBlocksResponse>;
        clearAllSignatures(
            params: Readonly<{ documentId: string }>,
        ): ResponseBase<Uint8Array<ArrayBufferLike>>;
        clearDocumentHistory(documentId: string): ResponseBase<string>;
        closeFile(documentId: string): ResponseBase<ICloseFilesResponse>;
        copyContentElement(
            documentId: string,
            data: Readonly<ICopyContentElementData>,
        ): ResponseBase<ICopyContentElementResponse>;
        copyTextBlock(
            documentId: string,
            data: Readonly<ICopyTextBlockData>,
        ): ResponseBase<ICopyTextBlockResponse>;
        createAnnotation(
            documentId: string,
            body: Readonly<ICreateAnnotationUnifiedData>,
        ): ResponseBase<ICreateAnnotationUnifiedResponse>;
        createClip(
            documentId: string,
            body: Readonly<ICreateClipData>,
        ): ResponseBase<ICreateClipResponse>;
        createFillSign(
            documentId: string,
            body: Readonly<IFillSignCreateData>,
        ): ResponseBase<IFillSignCreateResponse>;
        createMeasurementCalibration(
            documentId: string,
            data: Readonly<ICreateMeasurementCalibrationData>,
        ): ResponseBase<IUndoResponse>;
        createTextBlock(
            documentId: string,
            data: Readonly<ICreateTextBlockData>,
        ): ResponseBase<ITextBlocksResponse>;
        cropImage(
            documentId: string,
            body: Readonly<ICropImageData>,
        ): ResponseBase<ICropImageResponse>;
        deleteAnnotations(
            documentId: string,
            body: Readonly<IDeleteAnnotsWorkerData>,
        ): ResponseBase<IUndoResponse>;
        deleteAttachment(
            documentId: string,
            data: Readonly<IDeleteAttachmentData>,
        ): ResponseBase<IUndoResponse>;
        deleteBatesNumbering(documentId: string): ResponseBase<IUndoResponse>;
        deleteBookmark(
            documentId: string,
            data: Readonly<IDeleteBookmarkData>,
        ): ResponseBase<IUndoResponse>;
        deleteBookmarkAll(documentId: string): ResponseBase<IUndoResponse>;
        deleteClip(
            documentId: string,
            body: Readonly<IDeleteClipData>,
        ): ResponseBase<IDeleteClipResponse>;
        deleteContentElements(
            documentId: string,
            data: Readonly<IDeleteContentElementData>,
        ): ResponseBase<IUndoResponse>;
        deleteFillSign(
            documentId: string,
            body: Readonly<IFillSignDeleteData>,
        ): ResponseBase<IPatchFillSignResponse>;
        deleteHeader(
            documentId: string,
            body: Readonly<IDeleteHeaderData>,
        ): ResponseBase<IUndoResponse>;
        deletePageNumber(
            documentId: string,
            body: Readonly<IDeletePageNumberData>,
        ): ResponseBase<IUndoResponse>;
        deleteText(
            documentId: string,
            data: Readonly<IDeleteCharsRangeData>,
        ): ResponseBase<Readonly<ITextBlocksResponse>>;
        deleteTextBlocks(
            documentId: string,
            data: Readonly<IDeleteTextBlockData>,
        ): ResponseBase<IDeleteTextBlockResponse>;
        deleteWatermark(
            documentId: string,
            body: Readonly<IDeleteWatermarkData>,
        ): ResponseBase<IUndoResponse>;
        deskew(
            documentId: string,
            data: Readonly<IDeskewData>,
        ): ResponseBase<IDeskewDataResponse>;
        doWhiteout(
            documentId: string,
            data: Readonly<IDoWhiteoutData>,
        ): ResponseBase<IDoWhiteoutResponse>;
        downloadSignedVersion(
            documentId: string,
            data: Readonly<IDownloadSignedVersionData>,
        ): ResponseBase<Uint8Array<ArrayBufferLike>>;
        drawPage(
            documentId: string,
            data: Readonly<IDrawPageData>,
        ): ResponseBase<IDrawPageResponse>;
        editPageText(
            documentId: string,
            data: Readonly<IEditPageTextData>,
        ): ResponseBase<ITextBlocksResponse>;
        editTextParagraphs(
            documentId: string,
            data: Readonly<IEditTextParagraphs>,
        ): ResponseBase<ITextBlocksResponse>;
        endTransaction(documentId: string): ResponseBase<IUndoResponse>;
        exportAcroformsFdfData(
            documentId: string,
        ): ResponseBase<Uint8Array<ArrayBufferLike>>;
        exportComments(
            documentId: string,
        ): ResponseBase<Uint8Array<ArrayBufferLike>>;
        exportFile(
            documentId: string,
            data: Readonly<IExportFileFromWorkerParams>,
        ): ResponseBase<IExportFileResponse>;
        exportFillSignSignAsset(
            documentId: string,
            data: Readonly<IExportFillSignSignAsset>,
        ): ResponseBase<Blob>;
        exportStampAppearance(
            documentId: string,
            data: Readonly<IExportAppearanceStampData>,
        ): ResponseBase<string>;
        extractAllAttachments(
            documentId: string,
        ): ResponseBase<{ data: Uint8Array; filename: string }[]>;
        extractAttachment(
            documentId: string,
            data: Readonly<IExtractAttachmentData>,
        ): ResponseBase<Uint8Array<ArrayBufferLike>>;
        extractImage(
            documentId: string,
            data: Readonly<IExtractImageData>,
        ): ResponseBase<Uint8Array<ArrayBufferLike>>;
        extractImages(
            documentId: string,
            data: Readonly<IExtractImagesData>,
        ): ResponseBase<Uint8Array<ArrayBufferLike>>;
        extractPages(
            documentId: string,
            data: Readonly<IExtractData>,
        ): ResponseBase<Uint8Array<ArrayBufferLike>>;
        findArtifacts(
            body: Readonly<IFindArtifactsData>,
        ): ResponseBase<IFindArtifactsResponse>;
        flattenAnnotation(
            documentId: string,
            data: Readonly<IFlattenAnnotData>,
        ): ResponseBase<IUndoResponse>;
        forgetContentElement(
            documentId: string,
            data: Readonly<IForgetContentElementData>,
        ): ResponseBase<string>;
        getAcroforms(body: Readonly<IGetAcroformsData>): ResponseBase<IFormField[]>;
        getContent(
            data: Readonly<IGetPageContentData>,
        ): ResponseBase<IGetContentResponse>;
        getDocumentAnnotations(
            params: Readonly<IDocumentAnnotationsData>,
        ): Promise<IOpenFileAnnotation[]>;
        getDocumentHistory(documentId: string): ResponseBase<IDocumentHistory>;
        getDocumentInfo(
            params: Readonly<IDocumentInfoData>,
        ): ResponseBase<IDocumentInfoResponse>;
        getDocumentPermissions(
            params: Readonly<{ documentId: string }>,
        ): ResponseBase<{ permissions: string }>;
        getDocumentSecurity(
            params: Readonly<{ documentId: string }>,
        ): ResponseBase<IDocumentSecurity>;
        getMeasurementViewports(
            documentId: string,
            data: Readonly<IGetMeasurementViewportsData>,
        ): ResponseBase<IGetMeasurementViewportsResponse>;
        getPageAnnotations(
            params: Readonly<IGetPageContentData>,
        ): ResponseBase<IGetContentDataAnnotation[]>;
        getPageContent(
            params: Readonly<IGetPageContentData>,
        ): ResponseBase<IListContentResponse>;
        getPageFillSign(
            params: Readonly<IGetPageContentData>,
        ): ResponseBase<IFillSignField[]>;
        getPageText(
            body: Readonly<IGetPageContentData>,
        ): ResponseBase<ITextBlocksDataResponse>;
        getTextAsTable(
            documentId: string,
            data: Readonly<IGetTextAsTableData>,
        ): ResponseBase<ITextAsTableResponse>;
        importAcroformsFdfData(
            documentId: string,
            file: File,
        ): ResponseBase<IUndoResponse>;
        insertBatesNumbering(
            documentId: string,
            data: Readonly<IInsertBatesNumberingData>,
        ): ResponseBase<IUndoResponse>;
        insertChar(
            documentId: string,
            data: Readonly<IInsertCharData>,
        ): ResponseBase<Readonly<ITextBlocksResponse>>;
        insertHeader(
            documentId: string,
            body: Readonly<IInsertHeaderData>,
        ): ResponseBase<IUndoResponse>;
        insertImage(
            documentId: string,
            data: Readonly<IInsertImageData>,
        ): ResponseBase<IInsertImageResponse>;
        insertPageNumber(
            documentId: string,
            body: Readonly<IInsertPageNumberData>,
        ): ResponseBase<IUndoResponse>;
        insertWatermark(
            documentId: string,
            body: Readonly<IInsertWatermarkData>,
        ): ResponseBase<IUndoResponse>;
        listAttachments(
            body: Readonly<IAttachmentData>,
        ): ResponseBase<IAttachment[]>;
        listDocumentClaims(documentId: string): Promise<string[]>;
        listFonts(documentId?: string): Promise<IFontMini[]>;
        loadCustomSystemFont(
            documentId: string,
            data: Uint8Array,
        ): ResponseBase<ILoadCustomSystemFontResponse[]>;
        mergeTextBlocks(
            documentId: string,
            data: Readonly<IMergeTextBlocksData>,
        ): ResponseBase<ITextBlocksResponse>;
        moveBookmark(
            documentId: string,
            data: Readonly<IMoveBookmarkData>,
        ): ResponseBase<IUndoResponse>;
        openBlank(
            body: Readonly<ICreateNewDocumentData>,
        ): ResponseBase<IFileDataResponse>;
        openByFile(data: Readonly<IFileDataFile>): ResponseBase<IFileDataResponse>;
        orderAnnotation(
            documentId: string,
            data: Readonly<IOrderAnnotationData>,
        ): ResponseBase<IUndoResponse>;
        pasteContentElement(
            documentId: string,
            data: Readonly<IPasteContentElementData>,
        ): ResponseBase<IPasteContentElementResponse>;
        pasteTextBlock(
            documentId: string,
            data: Readonly<IPasteTextBlockData>,
        ): ResponseBase<ITextBlocksResponse>;
        patchBookmark(
            documentId: string,
            data: Readonly<IBookmarkRequestData>,
        ): ResponseBase<IAddBookmarkResponse>;
        patchFillSign(
            documentId: string,
            body: Readonly<IFillSignPatchData>,
        ): ResponseBase<IPatchFillSignResponse>;
        previewBatesNumbering(
            body: Readonly<IPreviewBatesNumberingData>,
        ): ResponseBase<Uint8Array<ArrayBufferLike>>;
        previewHeader(
            body: Readonly<IPreviewHeaderData>,
        ): ResponseBase<Uint8Array<ArrayBufferLike>>;
        previewWatermark(
            body: Readonly<IPreviewWatermarkData>,
        ): ResponseBase<Uint8Array<ArrayBufferLike>>;
        registerUserFonts(fonts: IUserFontData): void;
        replaceDocument(documentId: string, file: File): Promise<void>;
        replacePagesWorker(
            documentId: string,
            workerData: IReplacePagesWorkerData,
        ): ResponseBase<IUndoResponse>;
        replaceText(
            documentId: string,
            data: Readonly<IReplaceTextData>,
        ): ResponseBase<Readonly<ITextBlocksResponse>>;
        resetAcroformsFdfData(documentId: string): ResponseBase<IUndoResponse>;
        resizePages(
            documentId: string,
            body: Readonly<IChangeSizeData>,
        ): ResponseBase<IUndoResponse>;
        reversePage(
            documentId: string,
            data: Readonly<IReversePages>,
        ): ResponseBase<IUndoResponse>;
        rotatePages(
            documentId: string,
            params: Readonly<IRotatePagesData>,
        ): ResponseBase<IUndoResponse>;
        saveAttachment(
            documentId: string,
            data: Readonly<ISaveAttachmentData>,
        ): ResponseBase<ISaveAttachmentResponse>;
        saveOptimized(
            documentId: string,
            data: Readonly<ISaveOptimizedData>,
        ): Promise<Uint8Array<ArrayBufferLike>>;
        securityApplyRedactions(documentId: string): ResponseBase<IUndoResponse>;
        securityOwnerAuthorization(
            body: Readonly<ISecurityOwnerAuthorizationData>,
        ): ResponseBase<IDocumentPermissionsResponse>;
        securitySaveSettings(
            documentId: string,
            body: Readonly<ISecuritySaveSettingsData>,
        ): ResponseBase<ISecuritySaveSettingsResponse>;
        setBackground(
            documentId: string,
            body: Readonly<ISetBackgroundData>,
        ): ResponseBase<IUndoResponse>;
        transformClip(
            documentId: string,
            body: Readonly<ITransformClipData>,
        ): ResponseBase<ITransformClipResponse>;
        transformTextBlock(
            documentId: string,
            data: Readonly<ITransformTextBlockData>,
        ): ResponseBase<ITextBlocksResponse>;
    }
    Index

    Methods

    addAttachment addBookmark addCustomSystemFonts autoOrderAnnotation beginTransaction bookmarks cancelTransaction canChangeAnnotZOrder canChangeElementZOrder canChangeTextBlockZOrder changeAcroformValue changeAnnotationProperties changeAnnotOrder changeDocumentHistory changeElementMatrix changeElementOrder changeFontAttributes changeLayerState changeListStyle changeMargin changePagesBoxes changeParaAttrs changeProperties changeTextBlockZOrder clearAllSignatures clearDocumentHistory closeFile copyContentElement copyTextBlock createAnnotation createClip createFillSign createMeasurementCalibration createTextBlock cropImage deleteAnnotations deleteAttachment deleteBatesNumbering deleteBookmark deleteBookmarkAll deleteClip deleteContentElements deleteFillSign deleteHeader deletePageNumber deleteText deleteTextBlocks deleteWatermark deskew doWhiteout downloadSignedVersion drawPage editPageText editTextParagraphs endTransaction exportAcroformsFdfData exportComments exportFile exportFillSignSignAsset exportStampAppearance extractAllAttachments extractAttachment extractImage extractImages extractPages findArtifacts flattenAnnotation forgetContentElement getAcroforms getContent getDocumentAnnotations getDocumentHistory getDocumentInfo getDocumentPermissions getDocumentSecurity getMeasurementViewports getPageAnnotations getPageContent getPageFillSign getPageText getTextAsTable importAcroformsFdfData insertBatesNumbering insertChar insertHeader insertImage insertPageNumber insertWatermark listAttachments listDocumentClaims listFonts loadCustomSystemFont mergeTextBlocks moveBookmark openBlank openByFile orderAnnotation pasteContentElement pasteTextBlock patchBookmark patchFillSign previewBatesNumbering previewHeader previewWatermark registerUserFonts replaceDocument replacePagesWorker replaceText resetAcroformsFdfData resizePages reversePage rotatePages saveAttachment saveOptimized securityApplyRedactions securityOwnerAuthorization securitySaveSettings setBackground transformClip transformTextBlock

    Methods

    • Adds multiple custom system fonts

      Parameters

      • documentId: string

        The document ID

      • data: readonly ICustomSystemFonts[]

        Array of custom system font configurations

      Returns Promise<Uint8Array<ArrayBufferLike>>

      Response indicating the operation result

    • Removes all signatures from the specified document

      Parameters

      • params: Readonly<{ documentId: string }>

        Object containing the document ID to clear signatures from

      Returns ResponseBase<Uint8Array<ArrayBufferLike>>

      Response with information about the cleared signatures

    • Clears the document history (undo/redo stack)

      Parameters

      • documentId: string

        The document ID

      Returns ResponseBase<string>

      Response with "OK" status

    • Exports AcroForms data in FDF format

      Parameters

      • documentId: string

        The document ID

      Returns ResponseBase<Uint8Array<ArrayBufferLike>>

      Response with the exported FDF data

    • Exports comments from the document

      Parameters

      • documentId: string

        The document ID

      Returns ResponseBase<Uint8Array<ArrayBufferLike>>

      Response with the exported comments

    • Exports a signature asset for fill and sign

      Parameters

      Returns ResponseBase<Blob>

      Response with the exported signature as a Blob

    • Extracts all attachments from the document

      Parameters

      • documentId: string

        The document ID

      Returns ResponseBase<{ data: Uint8Array; filename: string }[]>

      Response with all extracted attachment data

    • Extracts an attachment from the document

      Parameters

      • documentId: string

        The document ID

      • data: Readonly<IExtractAttachmentData>

        Data specifying which attachment to extract

      Returns ResponseBase<Uint8Array<ArrayBufferLike>>

      Response with the extracted attachment data

    • Extracts a single image from the document

      Parameters

      • documentId: string

        The document ID

      • data: Readonly<IExtractImageData>

        Data specifying which image to extract

      Returns ResponseBase<Uint8Array<ArrayBufferLike>>

      Response indicating the extraction result

    • Extracts multiple images from the document

      Parameters

      • documentId: string

        The document ID

      • data: Readonly<IExtractImagesData>

        Data specifying which images to extract

      Returns ResponseBase<Uint8Array<ArrayBufferLike>>

      Response indicating the extraction result

    • Extracts pages from the document

      Parameters

      • documentId: string

        The document ID

      • data: Readonly<IExtractData>

        Data specifying which pages to extract

      Returns ResponseBase<Uint8Array<ArrayBufferLike>>

      Response with the extracted pages data

    • Removes content element data from memory (clipboard)

      Parameters

      Returns ResponseBase<string>

      Response with the operation result

    • Get the permissions for a document

      Parameters

      • params: Readonly<{ documentId: string }>

        Data specifying which document to get permissions for

      Returns ResponseBase<{ permissions: string }>

      Response with the permissions

    • Retrieves the security settings of a document

      Parameters

      • params: Readonly<{ documentId: string }>

        Data specifying which document to get security settings for

      Returns ResponseBase<IDocumentSecurity>

      Response with the document security settings

    • Imports AcroForms data from FDF format

      documentId: string;

      Parameters

      • documentId: string
      • file: File

        The FDF file to import

      Returns ResponseBase<IUndoResponse>

      Response with the import operation result

    • Lists all claims used in the current editing session

      Parameters

      • documentId: string

        The document ID

      Returns Promise<string[]>

      Response with an array of claim strings

    • Gets all system fonts available

      Parameters

      • OptionaldocumentId: string

        The ID of the document to get system fonts for

      Returns Promise<IFontMini[]>

      Response with the system fonts data

    • Generates a preview of a header

      Parameters

      Returns ResponseBase<Uint8Array<ArrayBufferLike>>

      Response with the header preview data

    • Registers user-defined fonts for use in text editing

      Parameters

      • fonts: IUserFontData

        Array of user font configurations to register

      Returns void

    • Replaces the current document with new PDF data by closing the old worker and creating a new one. This method performs an in-place document replacement without creating new tabs or views.

      Parameters

      • documentId: string

        The document ID

      • file: File

        The new PDF binary data as File

      Returns Promise<void>

      Promise that resolves when the document has been replaced

    • Saves optimized data to a file

      Parameters

      • documentId: string

        The document ID

      • data: Readonly<ISaveOptimizedData>

        Data containing the document ID and optimization settings

      Returns Promise<Uint8Array<ArrayBufferLike>>

      Promise resolving to the optimized file as a Uint8Array