API / geotoolkit / scene / exports / NodeExport / NodeExport
exports.NodeExport.NodeExport
Utility class to export nodes of various types for PDF output.
Constructors
Methods
▸ Static exportToImage(node, imageWidth?, imageHeight?, horizontalFlip?, verticalFlip?, modelLimits?, handler?): HTMLElement
Exports node to image.
| Name | Type | Description |
|---|---|---|
node | Node | IExportable | AbstractDocumentElement | node |
Optional imageWidth | number | width |
Optional imageHeight | number | height |
Optional horizontalFlip | boolean | flag to set horizontal flip |
Optional verticalFlip | boolean | flag to set vertical flip |
Optional modelLimits | Rect | model limits. if it is not specified then node model limits is used. |
Optional handler | (ev: Event) => void | called when image is ready |
HTMLElement
image
▸ Static exportToImage(options): HTMLElement
Exports node to image.
| Name | Type | Description |
|---|---|---|
options | ToImageOptions | options |
HTMLElement
image
▸ Static exportToImageUrl(node, imageWidth?, imageHeight?, horizontalFlip?, verticalFlip?, modelLimits?): string
Exports node to image Url
| Name | Type | Description |
|---|---|---|
node | Node | IExportable | AbstractDocumentElement | node |
Optional imageWidth | number | width |
Optional imageHeight | number | height |
Optional horizontalFlip | boolean | flag to set horizontal flip |
Optional verticalFlip | boolean | flag to set vertical flip |
Optional modelLimits | Rect | model limits. if it is not specified then node model limits is used. |
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
}
}
})| Name | Type | Description |
|---|---|---|
options | ToImageUrlOptions | options |
string
64bit encoded url for the rendered image
▸ Static exportToImageUrlAsync(node, imageWidth, imageHeight, horizontalFlip, verticalFlip, modelLimits?): Promise<string>
Exports node imageUrl
| Name | Type | Description |
|---|---|---|
node | Node | IExportable | AbstractDocumentElement | ToImageUrlOptions | node |
imageWidth | number | width |
imageHeight | number | height |
horizontalFlip | boolean | flag to set horizontal flip |
verticalFlip | boolean | flag to set vertical flip |
Optional modelLimits | Rect | model limits. if it is not specified then node model limits is used. |
Promise<string>
promise
▸ 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
| Name | Type | Description |
|---|---|---|
node | Node | node to export |
imageWidth | number | image width |
imageHeight | number | image height |
horizontalFlip | boolean | flag to set horizontal flip |
verticalFlip | boolean | flag to set vertical flip |
Optional modelLimits | Rect | model limits. model limits. if it is not specified then node model limits is used. |
canvas
▸ 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
| Name | Type | Description |
|---|---|---|
context | DocumentRenderingContext | rendering context |
document | Document | Document class representing a pdf document |
printSettings | PrintDocumentSettings | print settings |
void
▸ 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
| Name | Type | Description |
|---|---|---|
context | DocumentRenderingContext | rendering context |
document | Document | Document class representing a pdf document |
printSettings | PrintDocumentSettings | print settings |
Optional progress | (currentPage: number, totalPages: number) => void |
Promise<void>
return a promise