ASP.NET MVC コントロールヘルプ
FlexGridPdfConverter クラス
ファイル
wijmo.grid.pdf.js
モジュール
wijmo.grid.pdf

FlexGrid をPDFにエクスポートする機能を提供します。

次の例では、FlexGridPdfConverter を使用して FlexGrid をPDFにエクスポートする方法を示しています。

{@sample Grid/ImportExportPrint/PDF/ExportToFile/purejs デモ}

メソッド

メソッド

Static draw

draw(flex: any, doc: PdfDocument, width?: number, height?: number, settings?: IFlexGridDrawSettings): void

FlexGrid を既存のPdfDocument の座標 (0, @wijmo.pdf.PdfDocument.y)に描画します。

**幅**と**高さ**の両方が決定される場合、 グリッドは改ページなしで、指定された四角形に合うように拡大縮小されます。 **幅**のみが指定されている場合、グリッドは幅に合わせて拡大縮小され、必要に応じて垂直方向に改ページされます。それ以外の場合、グリッドは実際のサイズでレンダリングされ、必要に応じて改ページされます。

var doc = new wijmo.pdf.PdfDocument({
   ended: function (sender, args) {
      wijmo.pdf.saveBlob(args.blob, 'FlexGrid.pdf');
   }
});

wijmo.grid.pdf.FlexGridPdfConverter.draw(grid, doc, null, null, {
   maxPages: 10,
   styles: {
      cellStyle: {
         backgroundColor: '#ffffff',
         borderColor: '#c6c6c6'
      },
      headerCellStyle: {
         backgroundColor: '#eaeaea'
      }
   }
});
パラメーター
  • flex: any

    The FlexGrid instance to export.

  • doc: wijmo.pdf.PdfDocument

    The PdfDocument instance to draw in.

  • width: number Optional

    The width of the drawing area in points.

  • height: number Optional

    The height of the drawing area in points.

  • settings: IFlexGridDrawSettings Optional

    The draw settings.

戻り値
void

Static drawToPosition

drawToPosition(flex: any, doc: wijmo.pdf.PdfDocument, point: Point, width?: number, height?: number, settings?: IFlexGridDrawSettings): void

FlexGrid を既存のPdfDocument インスタンスの指定された座標に描画します。

**幅**と**高さ**の両方が決定される場合、 グリッドは改ページなしで、指定された四角形に合うように拡大縮小されます。 **幅**のみが指定されている場合、グリッドは改ページなしで幅に合うように拡大縮小されます。 それ以外の場合、グリッドは改ページなしで実際のサイズでレンダリングされます。

var doc = new wijmo.pdf.PdfDocument({
   ended: function (sender, args) {
      wijmo.pdf.saveBlob(args.blob, 'FlexGrid.pdf');
   }
});

wijmo.grid.pdf.FlexGridPdfConverter.drawToPosition(grid, doc, new wijmo.Point(0, 0), null, null, {
   maxPages: 10,
   styles: {
      cellStyle: {
         backgroundColor: '#ffffff',
         borderColor: '#c6c6c6'
      },
      headerCellStyle: {
         backgroundColor: '#eaeaea'
      }
   }
});
パラメーター
  • flex: any

    The FlexGrid instance to export.

  • doc: wijmo.pdf.PdfDocument

    The PdfDocument instance to draw in.

  • point: Point

    The position to draw at, in points.

  • width: number Optional

    The width of the drawing area in points.

  • height: number Optional

    The height of the drawing area in points.

  • settings: IFlexGridDrawSettings Optional

    The draw settings.

戻り値
void

Static export

export(flex: FlexGrid, fileName: string, settings?: IFlexGridExportSettings): void

FlexGridをPDFにエクスポートします。

wijmo.grid.pdf.FlexGridPdfConverter.export(grid, 'FlexGrid.pdf', {
   scaleMode: wijmo.grid.pdf.ScaleMode.PageWidth,
   maxPages: 10,
   styles: {
      cellStyle: {
         backgroundColor: '#ffffff',
         borderColor: '#c6c6c6'
      },
      headerCellStyle: {
         backgroundColor: '#eaeaea'
      }
   },
   documentOptions: {
      info: {
         title: 'Sample'
      }
   }
});
パラメーター
戻り値
void