TX Sheet Control

MailMergeTemplate.save Method

Method

Saves the captured template through the same format dispatcher as a workbook.

Owner: MailMergeTemplate. Package: @txtextcontrol/tx-sheet-control-server. Version: 2.0.0.

Syntax

save(streamType: StreamType, options?: SaveOptions): Promise<Uint8Array>

Parameters

ParameterTypeOptionalDescription
streamTypeStreamTypeNoThe supported input or output format. PDF is output-only.
optionsSaveOptions | undefinedYesSupported settings for this operation; omitted settings retain documented defaults.

Return Value

Promise<Uint8Array<ArrayBufferLike>>.

Examples

Pass an existing MailMergeTemplate from the owning document. Related handles and input bytes must belong to the intended document and application; the function applies the operation and inspects its result.

import type { ServerSheetControl } from '@txtextcontrol/tx-sheet-control-server';
import { StreamType } from '@txtextcontrol/tx-sheet-control-server';

async function applyMailMergeTemplateSave(
    mailMergeTemplate: Awaited<ReturnType<ServerSheetControl['workbook']['createMailMergeTemplate']>>,
) {
    const result = await mailMergeTemplate['save'](StreamType.InternalWorkbookFormat, {
        pdf: { title: 'Invoice', locale: 'de-DE' },
    });

    console.log(result);
}

Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

See Also