API / geotoolkit / pdf / PdfExport / PdfExport
Utility class to export node
Constructors
Methods
Methods
▸ documentExportToPdf(document, printSettings): string | Uint8Array
Export document to PDF
Throws
if memory is not enough
| Name | Type | Description |
|---|---|---|
document | Document | document to be exported |
printSettings | DocumentExportSettings | info about print settings |
string | Uint8Array
PDF in string
▸ documentExportToPdfStream(document, printSettings, pdfStream?): IWritable
Export document to PDF stream
Throws
if memory is not enough
| Name | Type | Description |
|---|---|---|
document | Document | document to export |
printSettings | DocumentExportSettings | info about print settings |
Optional pdfStream | IWritable | output stream for pdf |
PDF stream
▸ documentExportToPdfStreamAsync(document, printSettings, pdfStream?, progress?): Promise<IWritable>
Export document to PDF stream asynchronously
| Name | Type | Description |
|---|---|---|
document | Document | document to export |
printSettings | DocumentExportSettings | info about print settings |
Optional pdfStream | IWritable | output stream for pdf |
Optional progress | (currentPage: number, totalPages: number) => void |
Promise<IWritable>
▸ embedFont(subType, fontName, fontWeight, fontStyle, fontBase64EncodedFile, encoding): void
Embeds font into PDF
| Name | Type | Description |
|---|---|---|
subType | FontSubType | sub type |
fontName | string | font name |
fontWeight | string | font weight |
fontStyle | string | font style |
fontBase64EncodedFile | string | base64 encoded True Type Font file (TTF) |
encoding | string | encoding Identity-H |
void
▸ exportToPdf(root, imageWidth, imageHeight, modelLimits): IWritable
Export group to PDF
Throws
if memory is not enough
| Name | Type | Description |
|---|---|---|
root | Group<Node> | root node to be used for export. |
imageWidth | number | image width(Optional) |
imageHeight | number | image height (Optional) |
modelLimits | Rect | modellimits (Optional) |
PDF Content
▸ getStreamCompression(): boolean
Return status of stream compression if it is enable or disable
boolean
▸ setImageCompression(method, quality?, speed?): PdfExport
set image compression settings for the pdf export. right now three methods are available ImageCompression, if you select the PNG method, then you could pass a SpeedCompression speed parameter if you select the JPEG method, then you could pass a number ranged from 0 to 1 to specify the quality of the image if you select the NONE method, all parameters will be ignored. WARNING! if you select the NONE method and memory is not enough, the PNG method will be selected
| Name | Type | Description |
|---|---|---|
method | ImageCompression | method |
Optional quality | number | level of quality |
Optional speed | SpeedCompression | compression speed |
▸ setStreamCompression(enable): PdfExport
Enable or disable stream compression. By default it is enable
| Name | Type | Description |
|---|---|---|
enable | boolean | enable or disable image compression |
▸ Static enableClipping(textClippingEnabled, imageClippingEnabled): void
Static method to Enable/Disable Text and Image Clipping in Pdf
| Name | Type | Description |
|---|---|---|
textClippingEnabled | boolean | Text Shape Clipping (default: true) |
imageClippingEnabled | boolean | Image Shape Clipping (default: true) |
void
▸ Static isSupported(): boolean
Returns true if exporting a PDF is supported by this browser
boolean
▸ Static setMaximumImageSize(maximumImageSize): void
Sets maximum image size (in bytes)
| Name | Type | Description |
|---|---|---|
maximumImageSize | number | image size for forced selecting PNG compression method |
void