Last updated

API / geotoolkit / scene / exports / NodeExport / NodeExport

Class: NodeExport

exports.NodeExport.NodeExport

Utility class to export nodes of various types for PDF output.

Table of contents

Constructors
Methods

Contents

Constructors

new NodeExport()

new NodeExport()

Methods

exportToImage

Static exportToImage(node, imageWidth?, imageHeight?, horizontalFlip?, verticalFlip?, modelLimits?, handler?): HTMLElement

Exports node to image.

Parameters

Name Type Description
nodeNode | IExportable | AbstractDocumentElementnode
Optional imageWidthnumberwidth
Optional imageHeightnumberheight
Optional horizontalFlipbooleanflag to set horizontal flip
Optional verticalFlipbooleanflag to set vertical flip
Optional modelLimitsRectmodel limits. if it is not specified then node model limits is used.
Optional handler(ev: Event) => voidcalled when image is ready

Returns

HTMLElement

image

Static exportToImage(options): HTMLElement

Exports node to image.

Parameters

Name Type Description
optionsToImageOptionsoptions

Returns

HTMLElement

image


exportToImageUrl

Static exportToImageUrl(node, imageWidth?, imageHeight?, horizontalFlip?, verticalFlip?, modelLimits?): string

Exports node to image Url

Parameters

Name Type Description
nodeNode | IExportable | AbstractDocumentElementnode
Optional imageWidthnumberwidth
Optional imageHeightnumberheight
Optional horizontalFlipbooleanflag to set horizontal flip
Optional verticalFlipbooleanflag to set vertical flip
Optional modelLimitsRectmodel limits. if it is not specified then node model limits is used.

Returns

string

64bit encoded url for the rendered image

Static exportToImageUrl(options): string

Exports node to image Url

Example

// Export of widget
let url = NodeExport.exportToImageUrl({
'node': widget,
'exportoptions': {
'limits': {
'start': 4600,
'end': 4700
}
}
})

Parameters

Name Type Description
optionsToImageUrlOptionsoptions

Returns

string

64bit encoded url for the rendered image


exportToImageUrlAsync

Static exportToImageUrlAsync(node, imageWidth, imageHeight, horizontalFlip, verticalFlip, modelLimits?): Promise<string>

Exports node imageUrl

Parameters

Name Type Description
nodeNode | IExportable | AbstractDocumentElement | ToImageUrlOptionsnode
imageWidthnumberwidth
imageHeightnumberheight
horizontalFlipbooleanflag to set horizontal flip
verticalFlipbooleanflag to set vertical flip
Optional modelLimitsRectmodel limits. if it is not specified then node model limits is used.

Returns

Promise<string>

promise


exportToSurface

Static exportToSurface(node, imageWidth, imageHeight, horizontalFlip, verticalFlip, modelLimits?): Surface

Export to surface

Throws

if model limits are not specified and Node has not got it

Parameters

Name Type Description
nodeNodenode to export
imageWidthnumberimage width
imageHeightnumberimage height
horizontalFlipbooleanflag to set horizontal flip
verticalFlipbooleanflag to set vertical flip
Optional modelLimitsRectmodel limits. model limits. if it is not specified then node model limits is used.

Returns

Surface

canvas


render

Static render(context, document, printSettings): void

Export the node using a given context. This will separate the scene into pages using print settings, header and footer information

Parameters

Name Type Description
contextDocumentRenderingContextrendering context
documentDocumentDocument class representing a pdf document
printSettingsPrintDocumentSettingsprint settings

Returns

void


renderAsync

Static renderAsync(context, document, printSettings, progress?): Promise<void>

Export the node using a given context in asynchronous mode This will separate the scene into pages using print settings, header and footer information

Parameters

Name Type Description
contextDocumentRenderingContextrendering context
documentDocumentDocument class representing a pdf document
printSettingsPrintDocumentSettingsprint settings
Optional progress(currentPage: number, totalPages: number) => void

Returns

Promise<void>

return a promise