맥스그리드 API 레퍼런스
    Preparing search index...

    Interface PdfOptions<TRow>

    xlsx·PDF 공통 스타일 옵션.

    interface PdfOptions<TRow = unknown> {
        applyFormatValue?: boolean;
        applyGetValue?: boolean;
        author?: string;
        cellImage?: (context: CellStyleContext) => ImageInput | null | undefined;
        cellStyle?: CellStyleFn<TRow>;
        chunkSize?: number;
        compress?: boolean;
        errorPolicy?: "abort" | "blank";
        font?: false | PdfFontInput | readonly PdfFontInput[];
        fontSize?: number;
        header?: boolean;
        headerStyle?: CellStyle;
        hierarchy?: boolean | HierarchyOptions;
        imageHeight?: number;
        includeHidden?: boolean;
        locale?: GridLocale;
        margin?: number;
        maxCellLines?: number;
        maxImageBytes?: number;
        maxImages?: number;
        maxRows?: number;
        merges?: readonly ExportMerge[];
        onError?: (error: CsvCellError) => void;
        onWarning?: (warning: PdfWarning) => void;
        orientation?: "portrait" | "landscape";
        overflow?: "wrap" | "ellipsis";
        pageNumbers?: boolean;
        pageSize?: "A4" | "Letter";
        rowScope?: "visible" | "all" | "selected";
        signal?: AbortSignal;
        texts?: Partial<
            Pick<
                RendererTexts,
                "summaryTotal"
                | "summarySubtotal"
                | "summaryEmpty",
            >,
        >;
        title?: string;
    }

    Type Parameters

    • TRow = unknown

    Hierarchy (View Summary)

    Index
    applyFormatValue?: boolean

    formatValue를 반영한다. false면 원시 값을 기본 규칙으로 문자열화한다. (true)

    applyGetValue?: boolean

    getValue(계산 컬럼)를 반영한다. false면 key/id 속성을 직접 읽는다. (true)

    author?: string

    문서 정보의 작성자.

    cellImage?: (context: CellStyleContext) => ImageInput | null | undefined

    셀마다 이미지를 정한다. 이미지를 주면 그 셀 안에 그리고(글자도 그대로 나가므로 보통 값을 비운다), 없으면 건너뛴다. 외부 주소는 받지 않는다: 호출자가 바이트를 준다. 던지거나 잘못된 이미지를 주면 errorPolicy를 따른다.

    cellStyle?: CellStyleFn<TRow>

    셀마다 모양을 정하는 함수. 던지면 errorPolicy를 따른다.

    chunkSize?: number

    한 번에 동기로 처리할 행 수. 청크 사이에 메인 스레드를 양보한다. (2000)

    compress?: boolean

    스트림을 deflate로 압축한다. 지원하지 않는 환경에서는 압축 없이 쓴다. (true)

    errorPolicy?: "abort" | "blank"

    사용자 콜백 오류 처리. 'blank'는 그 셀만 빈 값으로 두고 계속하며, 'abort'는 원래 오류를 그대로 던져 전체를 중단한다. ('blank')

    font?: false | PdfFontInput | readonly PdfFontInput[]

    폰트. TrueType(.ttf) 바이트나 폰트 원본(koreanFont). OpenType CFF·TTC·WOFF는 RangeError. 가변 폰트(wght)면 400을 보통, 700을 굵게로 쓴다. 생략하면 Helvetica로 만들고, Latin-1 밖의 글자가 있으면 한글·간체 폰트 패키지를 자동으로 찾아 한 번 더 만든다. false면 자동 감지를 끈다. 배열이면 앞에서부터 쓰는 폰트 사슬이다: 글자마다 그 글자가 있는 첫 폰트를 쓰고(예: [koreanFont, simplifiedChineseFont]), 어느 폰트에도 없는 글자는 ?로 바꾸고 경고한다. 빈 배열과 배열 안의 false는 RangeError다.

    fontSize?: number

    본문 글자 크기(pt). (9)

    header?: boolean

    첫 줄에 컬럼 제목을 쓴다. (true)

    headerStyle?: CellStyle

    머리글 줄의 모양. 기본 머리글 모양(굵게, 옅은 회색 배경) 위에 덮어쓴다.

    hierarchy?: boolean | HierarchyOptions

    트리·그룹을 화면의 줄 그대로 내보낸다(들여쓰기, 그룹 행, 합계 행). rowScope: 'visible'이고 원본에 getDisplayRow가 있을 때만 동작한다. 접힌 가지는 빠진다. (꺼짐)

    imageHeight?: number

    이미지 칸의 높이(pt). 이미지는 칸 폭과 이 높이 안에 비율을 지켜 맞추고 행 높이도 이에 맞춘다. (48)

    includeHidden?: boolean

    hidden 컬럼도 포함한다. (false)

    locale?: GridLocale

    오류·경고 문구와 합계·소계 줄 이름의 언어. 생략하면 그리드(getOptions().locale)를 따르고, 그리드에 없으면 'ko'. 언어팩 언어('ja')는 그리드의 localePacks에 있으면 그 문구를, 없으면 영어를 쓴다.

    margin?: number

    네 변 여백(pt). (36)

    maxCellLines?: number

    셀 하나의 최대 줄 수. 넘으면 ...로 자른다. (6)

    maxImageBytes?: number

    이미지 하나의 최대 바이트. (5,000,000)

    maxImages?: number

    한 파일에 넣는 이미지 최대 개수(같은 바이트는 한 번만 센다). (500)

    maxRows?: number

    행 상한. 넘으면 RangeError. 절대 상한은 1,000,000이다. (100000)

    merges?: readonly ExportMerge[]

    병합할 셀 범위. 범위 밖이거나 겹치면 RangeError.

    onError?: (error: CsvCellError) => void

    'blank' 정책에서 셀 오류를 알리는 콜백. 없으면 내보내기 한 번당 첫 오류를 console.warn으로 알린다. 이 콜백이 던지면 그대로 전파된다.

    onWarning?: (warning: PdfWarning) => void

    경고 콜백. 없으면 내보내기 한 번당 첫 경고를 console.warn으로 알린다. 던지면 전파된다.

    orientation?: "portrait" | "landscape"

    방향. ('portrait')

    overflow?: "wrap" | "ellipsis"

    긴 문자열 처리. wrap은 줄바꿈, ellipsis는 한 줄 말줄임. ('wrap')

    pageNumbers?: boolean

    아래에 n / N 쪽 번호를 쓴다. (true)

    pageSize?: "A4" | "Letter"

    용지. ('A4')

    rowScope?: "visible" | "all" | "selected"

    내보낼 행 범위. visible은 원본의 getVisibleRows()(정렬·필터 적용 결과)를 쓰고, 원본에 없으면 all과 같다. selected는 선택된 행만 화면 순서로 쓴다. ('visible')

    signal?: AbortSignal

    취소 신호. 청크 경계에서 확인하고 signal.reason으로 reject한다.

    texts?: Partial<
        Pick<RendererTexts, "summaryTotal" | "summarySubtotal" | "summaryEmpty">,
    >

    합계·소계 줄 이름을 직접 정한다(언어보다 우선). summarySubtotal은 {label}(그룹 이름)을 쓴다.

    title?: string

    첫 쪽 위에 쓰는 제목이자 문서 정보의 제목.