UNPKG

@syncfusion/ej2-pdfviewer

Version:
161 lines (160 loc) 6.37 kB
import { PointModel } from './../primitives/point-model'; import { ImageAttributes } from './canvas-interface'; import { RectAttributes, PathAttributes, TextAttributes, SubTextElement, TextBounds, ImageEntry } from './canvas-interface'; import { DrawingElement } from '../core/elements/drawing-element'; import { DrawingRenderer } from './renderer'; /** * @hidden * Canvas Renderer */ export declare class CanvasRenderer { /** @private */ imageList: Record<string, ImageEntry[]>; private rectWidth; /** * @param {HTMLCanvasElement} canvas - canvas * @private * @returns {CanvasRenderingContext2D} - CanvasRenderingContext2D */ static getContext(canvas: HTMLCanvasElement): CanvasRenderingContext2D; private setStyle; private setStyleFreetextEJ2; private rotateContext; private setFontStyle; /** * @param {string} dashArray - dashArray * @private * @returns {number[]} - array of number */ parseDashArray(dashArray: string): number[]; /** * @param {HTMLCanvasElement} canvas - canvas * @param {RectAttributes} options - options * @private * @returns {void} - void */ drawRectangle(canvas: HTMLCanvasElement, options: RectAttributes): void; /** * @param {HTMLCanvasElement} canvas - canvas * @param {RectAttributes} options - options * @private * @returns {void} - void */ drawRectangleFreetextEJ2(canvas: HTMLCanvasElement, options: RectAttributes): void; /** * @param {HTMLCanvasElement} canvas - canvas * @param {PathAttributes} options - options * @private * @returns {void} - void */ drawPath(canvas: HTMLCanvasElement, options: PathAttributes): void; private drawPathWithMask; /** * @param {HTMLCanvasElement} canvas - canvas * @param {PathAttributes} options - options * @param {Object[]} collection - collection * @private * @returns {void} - void */ renderPath(canvas: HTMLCanvasElement, options: PathAttributes, collection: Object[]): void; /** * @param {HTMLCanvasElement} canvas - canvas * @param {TextAttributes} options - options * @param {boolean} isFreeTextAnnotation - isFreeTextAnnotation * @param {number} rectHeight - rectHeight * @private * @returns {void} - void */ drawTextFreetextEJ2(canvas: HTMLCanvasElement, options: TextAttributes, isFreeTextAnnotation: boolean, rectHeight: number): void; /** * @param {HTMLCanvasElement} canvas - canvas * @param {TextAttributes} options - options * @param {boolean} isStampAnnotation - isStampAnnotation * @private * @returns {void} - void */ drawTextEJ2(canvas: HTMLCanvasElement, options: TextAttributes, isStampAnnotation?: boolean): void; /** * @param {HTMLCanvasElement} canvas - canvas * @param {TextAttributes} options - options * @param {number} maxHeight - maxHeight * @param {boolean} isFreeTextAnnotation - isFreeTextAnnotation * @param {number} zoomFactor - zoomFactor * @private * @returns {void} - void */ drawFreeTextBlazor(canvas: HTMLCanvasElement, options: TextAttributes, maxHeight: number, isFreeTextAnnotation: boolean, zoomFactor: number): void; /** * @param {HTMLCanvasElement} canvas - canvas * @param {TextAttributes} options - options * @param {number} maxHeight - maxHeight * @param {boolean} isFreeTextAnnotation - isFreeTextAnnotation * @param {number} zoomFactor - zoomFactor * @private * @returns {void} - void */ drawText(canvas: HTMLCanvasElement, options: TextAttributes, maxHeight: number, isFreeTextAnnotation: boolean, zoomFactor: number): void; /** * @param {HTMLCanvasElement} canvas - canvas * @param {TextAttributes} options - options * @param {number} maxHeight - maxHeight * @param {boolean} isFreeTextAnnotation - isFreeTextAnnotation * @param {number} zoomFactor - zoomFactor * @private * @returns {void} - void */ drawTextBlazor(canvas: HTMLCanvasElement, options: TextAttributes, maxHeight: number, isFreeTextAnnotation: boolean, zoomFactor: number): void; /** * Draw Line and Line Through * * @param {CanvasRenderingContext2D} ctx - ctx * @param {number} startPointX - startPointX * @param {number} startPointY - startPointY * @param {number} endPointX - endPointX * @param {number} endPointY - endPointY * @param {TextAttributes} options - endPointY * @private * @returns {void} - void */ private drawLine; private m; private r; private a; private getMeetOffset; private getSliceOffset; private image; private isExistingImage; private updateImageList; private updateCanvasList; private loadImage; /** * @param {HTMLCanvasElement} canvas - canvas * @param {ImageAttributes} obj - obj * @param {SVGSVGElement} parentSvg - parentSvg * @param {boolean} fromPalette - fromPalette * @param {boolean} annotationCallback - annotationCallback * @param {string} annotationType - annotationType * @private * @returns {void} - void */ drawImage(canvas: HTMLCanvasElement, obj: ImageAttributes, parentSvg?: SVGSVGElement, fromPalette?: boolean, annotationCallback?: (annotationID: string) => boolean, annotationType?: string): void; /** * @param {TextAttributes} text - text * @param {TextBounds} wrapBounds - wrapBounds * @param {SubTextElement[]} childNodes - childNodes * @param {number} lineHeight - lineHeight * @private * @returns {PointModel} - PointModel */ labelAlign(text: TextAttributes, wrapBounds: TextBounds, childNodes: SubTextElement[], lineHeight: number): PointModel; } /** * @param {HTMLCanvasElement} canvas - canvas * @param {DrawingElement[]} drawingObjects - drawingObjects * @param {DrawingRenderer} renderer - renderer * @param {boolean} annotationCallback - annotationCallback * @param {string} annotationType - annotationType * @private * @returns {void} - void */ export declare function refreshDiagramElements(canvas: HTMLCanvasElement, drawingObjects: DrawingElement[], renderer: DrawingRenderer, annotationCallback?: (annotationID: string) => boolean, annotationType?: string): void;