v5.20192.624
|

PdfWebWorkerClient Class

Represents client-side methods for exporting FlexGrid to PDF/generating PDF, for use with Web Worker.

Hierarchy

  • PdfWebWorkerClient

Methods

Static addGrid

  • Adds named FlexGrid with settings, which will be used in a Web Worker to generate a PDF document. This method should be used in conjunction with the PdfWebWorkerClient.export method.

    Parameters

    • worker: Worker

      The Web Worker instance to send the data to.

    • grid: grid.FlexGrid

      The grid

    • name: string

      The name associated with the grid.

    • settings: IFlexGridDrawSettings

      The draw settings.

    Returns void

Static addImage

  • addImage(worker: Worker, image: string, name: string, settings: pdf.IPdfImageDrawSettings): void
  • Adds named image with settings, which will be used in a Web Worker to generate a PDF document. This method should be used in conjunction with the PdfWebWorkerClient.export method.

    Parameters

    • worker: Worker

      The Web Worker instance to send the data to.

    • image: string

      A string containing the URL to get the image from or the data URI containing a base64 encoded image.

    • name: string

      The name associated with the image.

    • settings: pdf.IPdfImageDrawSettings

      The image drawing settings.

    Returns void

Static addString

  • addString(worker: Worker, value: string, name: string): void
  • Adds named string which will be used in a Web Worker code to generate a PDF document. This method should be used in conjunction with the PdfWebWorkerClient.export method.

    Parameters

    • worker: Worker

      The Web Worker instance to send the data to.

    • value: string

      The value.

    • name: string

      The name associated with the string.

    Returns void

Static export

  • export(worker: Worker, settings: any, done: Function, progress?: Function): void
  • Exports PDF in a background thread.

    Parameters

    • worker: Worker

      The Web Worker instance to run the exporting code in.

    • settings: any

      An object containing PdfDocument's initialization settings.

    • done: Function

      The callback function to call when drawing is done. The function takes a single parameter, an instance of the PdfWebWorkerExportDoneEventArgs class.

    • Optional progress: Function

      An optional function that gives feedback about the progress of the export. The function takes a single parameter, a number changing from 0.0 to 1.0, where the value of 0.0 indicates that the operation has just begun and the value of 1.0 indicates that the operation has completed.

    Returns void

Static exportGrid

  • exportGrid(worker: Worker, grid: grid.FlexGrid, fileName: string, settings: IFlexGridExportSettings, done?: Function, progress?: Function): void
  • Exports the FlexGrid to PDF in a background thread.

    Parameters

    • worker: Worker

      The Web Worker instance to run the exporting code in.

    • grid: grid.FlexGrid

      The FlexGrid instance to export.

    • fileName: string

      The name of the file to export.

    • settings: IFlexGridExportSettings

      The export settings.

    • Optional done: Function

      An optional callback function to call when exporting is done. The function takes a single parameter, an instance of the PdfWebWorkerExportDoneEventArgs class.

    • Optional progress: Function

      An optional function that gives feedback about the progress of the export. The function takes a single parameter, a number changing from 0.0 to 1.0, where the value of 0.0 indicates that the operation has just begun and the value of 1.0 indicates that the operation has completed.

    Returns void

Static serializeGrid

  • Serializes the FlexGrid to ArrayBuffer. The serialized data can be send to a Web Worker using the postMessage method.

    Parameters

    Returns ArrayBuffer