Socket
Socket
Sign inDemoInstall

@syncfusion/ej2-pdfviewer

Package Overview
Dependencies
Maintainers
3
Versions
291
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-pdfviewer - npm Package Compare versions

Comparing version 17.3.30 to 17.3.31

dist/ts/diagram/action.ts

191

CHANGELOG.md

@@ -5,2 +5,4 @@ # Changelog

## 18.1.44 (2020-04-14)
### PDF Viewer

@@ -10,5 +12,189 @@

- `#263306` - Provided the support for Meter Calibration ratio in PDF Viewer.
- `#271053` - Provided the support to enable and disable the multiline annotations in overlapping collections.
#### Bug Fixes
- `#271180` - Free Text Annotation and annotation label text position updated properly in downloaded rotational documents.
- `#F153036` - Now, Annotation toolbar separator shown properly when hiding some annotation toolbar items.
## 18.1.43 (2020-04-07)
### PDF Viewer
#### New Features
- `#267524` - Provided the support for feet inch Calibration ratio in PDF Viewer.
- `#269003` - Exposed the non filled form fields value in the fireValidatedFailed event arguments.
- `#268276` - Provided the support to customize the annotation resize cursor type in PDF Viewer.
- `#268715` - Exposed the 'Not Approved' stamp annotation under dynamic stamp type.
#### Bug Fixes
- `#271163` - Errors will no longer occur when the print module in disabled state.
- `#268829` - Now, the deleted annotations are removed properly from the PDF document.
## 18.1.42 (2020-04-01)
### PDF Viewer
#### New Features
- `#268975` - Exposed the event for notifying page mouse over action.
- `#264529` - Exposed the volume calibrate annotation depth value in annotationSelect event arguments and provide options to edit the depth value.
- `#263297`, `#268677` - Provided the options to enable and disable the tile rendering mode.
- `#263473` - Provided the isLock options to individual annotation object level.
#### Bug Fixes
- `#269004` – The typo errors in PDF Viewer JSON objects has been resolved.
- `#266218`, `#266559` - The import/export form fields are now working properly for the form fields data contains special characters.
- `#268505` - Download is now working properly for different culture settings.
- `#268109` - The updated label content is now preserved properly in the exported annotation data.
## 18.1.36-beta (2020-03-19)
### PDF Viewer
#### New Features
- `#235592` - Provided the support for setting the lower zoomfactor value to the PDF Viewer control.
- `#259521` - Provided the support for importing the form fields data from JSON object.
- `#261558` - Provided the support for customizing the distance measurement annotation leader length property.
- `#256687` - Provided the support for setting the custom data for annotation objects.
- `#252340` - Provided the support for setting the minimum or maximum size and isLock properties at individual annotation level.
- `#262008` - Exposed the event for notifying annotation mouse over action.
- `#F149148` - Provided the binding support for the enableFormFields property.
- `#258769` - Provided the option to suppress the error dialog in PDF Viewer.
- `#261269` - Provided the support to allow credential for XMLHttpRequest in PDF Viewer.
- `#262787` - Exposed the event to notify the getPDFDocumentTexts method completed for all the pages.
#### Bug Fixes
- `#262525` – The render PDF pages method triggers properly for the provided PDF document.
- `#262692` - The text markup resizer position is now updated properly for the provided document.
- `#262692` - The text content bounds are now rendered properly for the provided document.
## 17.4.50 (2020-02-18)
### PDF Viewer
#### New Features
- `#262787` - Exposed the event to notify the getPDFDocumentTexts method completed for all the pages.
## 17.4.49 (2020-02-11)
### PDF Viewer
#### New Features
- `#235592` - Provided the support for setting the lower zoomfactor value to the PDF Viewer control.
- `#259521` - Provided the support for importing the form fields data from JSON object.
- `#261558` - Provided the support for customizing the distance measurement annotation leader length property.
- `#256687` - Provided the support for setting the custom data for annotation objects.
- `#252340` - Provided the support for setting the minimum or maximum size and isLock properties at individual annotation level.
- `#262008` - Exposed the event for notifying annotation mouse over action.
- `#F149148` - Provided the binding support for the enableFormFields property.
#### Bug Fixes
- `#262525` – The render PDF pages method triggers properly for the provided PDF document.
- `#262692` - The text markup resizer position is now updated properly for the provided document.
- `#262692` - The text content bounds are now rendered properly for the provided document.
### PDF Viewer
#### New Features
- `258769` - Provided the option to suppress the error dialog in PDF Viewer.
- `261269` - Provided the support to allow credential for XMLHttpRequest in PDF Viewer.
## 17.4.46 (2020-01-30)
### PDF Viewer
#### New Features
- `258172` - Provided the support to open the command panel while loading the PDF document if the isCommandPanelOpen property is set to true.
- `259159` - Provided the support to open the thumbnail view panel while loading the PDF document if the isThumbnailViewOpen property is set to true.
- `259961` - Exposed the annotation label settings value in the annotationAdd event arguments.
- `259615` - Exposed the annotation label settings value in import/export JSON data.
- `256596` - Exposed the annotation selector settings value for individual annotation objects and import/export JSON data.
## 17.4.44 (2021-01-21)
### PDF Viewer
#### New Features
- `#257519` - Provided Support to edit the free Text annotation value in code behind.
#### Bug Fixes
- `#259848` – Now, the deleted annotations are removed properly from the PDF document.
- `#259734` - Custom Stamp annotations are drawn properly while importing the annotations.
- `#260512` - Errors will no longer occur while importing the annotations in the documentLoad event.
- `#260575` - The download file name is now set properly if we provide during the control initialization.
## 17.4.43 (2020-01-14)
### PDF Viewer
#### New Features
- `#255057` – Provided the support for validating the form fields value whether it is filled or not in the loaded PDF document.
- `#258786`, `#259327` – Provided the support for exporting and importing the handwritten signature.
#### Bug Fixes
- `#149882` – The downloadEnd event triggers properly if we save the document in server side.
- `#257630` – The importSuccess event triggers properly if we save the document in server side.
- `#260295` – The distance calibrate annotation now resized properly.
- `#260128` – The volume and area calibrate annotation fill color is updated correctly on importing the annotations.
## 17.4.41 (2020-01-07)
### PDF Viewer
#### New Features
- `#257514` – Provided the support for import/export the custom stamp annotations.
- `#257231` – Exposed the property to access the search count value.
- `#258386` – Exposed the API to retrieve the text content and bounds along with page size details.
#### Bug Fixes
- `#259524` – Annotations are rendered properly in the large page size document if the page rendered in fitToPage mode initially.
- `#259523` – Errors will no longer occur while exporting the annotation if the document contains text web link annotation.
- `#259134` – The annotationSelect event now triggers properly if we add the multiple annotations to a page.
- `#258949` – The opacity value is now applied properly if set it on annotation during initialization.
- `#259383` – The errors will no longer occur if we import the annotations after deleting the added annotations.
-`#259166` – The text content will be selected properly at the end of the page.
- `#259078` – The annotations will now be created if we resize the annotation through multipage.
- `#259564` – The Null reference error will no longer occur while loading the provided PDF document.
## 17.4.40 (2019-12-24)
### PDF Viewer
#### New Features
- `#256131` – Improved the rendering quality and performance for the large size PDF document.
#### Bug Fixes
- `#258250` – The imported annotations are rendered properly if we import the annotation details in the documentLoad event.
## 17.4.39 (2019-12-17)
### PDF Viewer
#### New Features
- `#251150` – Provided the support to find the interlinked annotations while selecting the annotations.
- `#243077` , `#241487`, `#244802`, `#252340` – Provided the support for setting the annotation UI properties.
- `#254634` – Provided the support to maintain the aspect ratio for custom stamp annotation.
- `#253745`, `#256518` – Exposed the event to notify the annotation object being moved.
- `#254275` – Exposed the event to notify the download process in the PDF Viewer control.

@@ -27,2 +213,7 @@ #### Bug Fixes

- `#255124` – The text markup annotations are now added properly if the PDF Viewer element ID contains characters.
- `#256220` – The context menu will now be shown/hidden properly if we disable the default toolbar.
- `#256131` – The annotation toolbar will now be shown/hidden properly if we disable the annotation toolbar.
- `#256932` - Errors will no longer occur while resizing the text markup annotations.
- `#252805` – The annotationId value is now preserved properly for all annotation events.
- `#255647` - The form fields contents are rendered properly in the printed document, which has been printed in IE browser.

@@ -29,0 +220,0 @@ ## 17.3.28 (2019-11-19)

9

dist/global/index.d.ts

@@ -1,10 +0,1 @@

/*!
* filename: index.d.ts
* version : 17.3.30
* Copyright Syncfusion Inc. 2001 - 2019. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
import * as _pdfviewer from '@syncfusion/ej2-pdfviewer';

@@ -11,0 +2,0 @@

152

package.json
{
"_from": "@syncfusion/ej2-pdfviewer@*",
"_id": "@syncfusion/ej2-pdfviewer@17.3.28",
"_inBundle": false,
"_integrity": "sha512-GB2g18v480x9bNxtVGzOBRG2rb3V18RXrm2J26rspTAtzq5K5n0gcDgSTwuzteqgLNdTh98HMppa9gJKVScYPQ==",
"_location": "/@syncfusion/ej2-pdfviewer",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@syncfusion/ej2-pdfviewer@*",
"_from": "@syncfusion/ej2-pdfviewer@*",
"_id": "@syncfusion/ej2-pdfviewer@17.3.31",
"_inBundle": false,
"_integrity": "sha512-GB2g18v480x9bNxtVGzOBRG2rb3V18RXrm2J26rspTAtzq5K5n0gcDgSTwuzteqgLNdTh98HMppa9gJKVScYPQ==",
"_location": "/@syncfusion/ej2-pdfviewer",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@syncfusion/ej2-pdfviewer@*",
"name": "@syncfusion/ej2-pdfviewer",
"escapedName": "@syncfusion%2fej2-pdfviewer",
"scope": "@syncfusion",
"rawSpec": "*",
"saveSpec": null,
"fetchSpec": "*"
},
"_requiredBy": [
"/",
"/@syncfusion/ej2",
"/@syncfusion/ej2-angular-pdfviewer",
"/@syncfusion/ej2-react-pdfviewer",
"/@syncfusion/ej2-vue-pdfviewer"
],
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-pdfviewer/-/ej2-pdfviewer-17.3.28.tgz",
"_shasum": "30e9dd4e17ce6a70ec6c45186713e4cd4a745548",
"_spec": "@syncfusion/ej2-pdfviewer@*",
"_where": "/jenkins/workspace/ation_hotfix_17.2.0.34_Vol2-DDPJ6C2YEWTWLLKKNA7AG2JBE6DYTCTNGMHGORWGAYAVCL6L7OLQ/packages/included",
"author": {
"name": "Syncfusion Inc."
},
"bugs": {
"url": "https://github.com/syncfusion/ej2-pdfviewer/issues"
},
"bundleDependencies": false,
"dependencies": {
"@syncfusion/ej2-base": "~17.3.27",
"@syncfusion/ej2-buttons": "~17.3.27",
"@syncfusion/ej2-calendars": "~17.3.28",
"@syncfusion/ej2-data": "~17.3.30",
"@syncfusion/ej2-drawings": "~17.3.27",
"@syncfusion/ej2-dropdowns": "~17.3.30",
"@syncfusion/ej2-inplace-editor": "~17.3.29",
"@syncfusion/ej2-inputs": "~17.3.29",
"@syncfusion/ej2-lists": "~17.3.27",
"@syncfusion/ej2-navigations": "~17.3.27",
"@syncfusion/ej2-notifications": "~17.3.30",
"@syncfusion/ej2-popups": "~17.3.29",
"@syncfusion/ej2-richtexteditor": "~17.3.29"
},
"deprecated": false,
"description": "Essential JS 2 PDF viewer Component",
"devDependencies": {},
"es2015": "./dist/es6/ej2-pdfviewer.es2015.js",
"homepage": "https://github.com/syncfusion/ej2-pdfviewer#readme",
"keywords": [
"ej2",
"syncfusion",
"ej2-pdfviewer",
"web-components",
"JavaScript",
"TypeScript",
"viewer",
"annotation"
],
"license": "SEE LICENSE IN license",
"main": "./dist/ej2-pdfviewer.umd.min.js",
"module": "./index.js",
"name": "@syncfusion/ej2-pdfviewer",
"escapedName": "@syncfusion%2fej2-pdfviewer",
"scope": "@syncfusion",
"rawSpec": "*",
"saveSpec": null,
"fetchSpec": "*"
},
"_requiredBy": [
"/",
"/@syncfusion/ej2",
"/@syncfusion/ej2-angular-pdfviewer",
"/@syncfusion/ej2-react-pdfviewer",
"/@syncfusion/ej2-vue-pdfviewer"
],
"_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix/@syncfusion/ej2-pdfviewer/-/ej2-pdfviewer-17.3.28.tgz",
"_shasum": "30e9dd4e17ce6a70ec6c45186713e4cd4a745548",
"_spec": "@syncfusion/ej2-pdfviewer@*",
"_where": "/jenkins/workspace/ation_hotfix_17.2.0.34_Vol2-DDPJ6C2YEWTWLLKKNA7AG2JBE6DYTCTNGMHGORWGAYAVCL6L7OLQ/packages/included",
"author": {
"name": "Syncfusion Inc."
},
"bugs": {
"url": "https://github.com/syncfusion/ej2-pdfviewer/issues"
},
"bundleDependencies": false,
"dependencies": {
"@syncfusion/ej2-base": "~17.3.27",
"@syncfusion/ej2-buttons": "~17.3.27",
"@syncfusion/ej2-calendars": "~17.3.28",
"@syncfusion/ej2-data": "~17.3.30",
"@syncfusion/ej2-drawings": "~17.3.27",
"@syncfusion/ej2-dropdowns": "~17.3.30",
"@syncfusion/ej2-inplace-editor": "~17.3.29",
"@syncfusion/ej2-inputs": "~17.3.29",
"@syncfusion/ej2-lists": "~17.3.27",
"@syncfusion/ej2-navigations": "~17.3.27",
"@syncfusion/ej2-notifications": "~17.3.30",
"@syncfusion/ej2-popups": "~17.3.29",
"@syncfusion/ej2-richtexteditor": "~17.3.29"
},
"deprecated": false,
"description": "Essential JS 2 PDF viewer Component",
"devDependencies": {},
"es2015": "./dist/es6/ej2-pdfviewer.es2015.js",
"homepage": "https://github.com/syncfusion/ej2-pdfviewer#readme",
"keywords": [
"ej2",
"syncfusion",
"ej2-pdfviewer",
"web-components",
"JavaScript",
"TypeScript",
"viewer",
"annotation"
],
"license": "SEE LICENSE IN license",
"main": "./dist/ej2-pdfviewer.umd.min.js",
"module": "./index.js",
"name": "@syncfusion/ej2-pdfviewer",
"repository": {
"type": "git",
"url": "git+https://github.com/syncfusion/ej2-pdfviewer.git"
},
"typings": "index.d.ts",
"version": "17.3.30",
"sideEffects": false
}
"repository": {
"type": "git",
"url": "git+https://github.com/syncfusion/ej2-pdfviewer.git"
},
"typings": "index.d.ts",
"version": "17.3.31",
"sideEffects": false
}

@@ -0,0 +0,0 @@ # ej2-pdfviewer

@@ -14,2 +14,4 @@ import { IElement } from '@syncfusion/ej2-drawings';

/** @private */
export declare function CalculateLeaderPoints(selector: any, currentobject: any): any;
/** @private */
export declare function findElementUnderMouse(obj: IElement, position: PointModel, padding?: number): DrawingElement;

@@ -16,0 +18,0 @@ /** @private */

@@ -1,3 +0,6 @@

import { Container } from '@syncfusion/ej2-drawings';
import { Rect } from '@syncfusion/ej2-drawings';
import { Point, identityMatrix, rotateMatrix } from '@syncfusion/ej2-drawings';
import { Container, transformPointByMatrix } from '@syncfusion/ej2-drawings';
import { isPointOverConnector } from './connector-util';
import { LineTool, NodeDrawingTool } from './tools';
/** @private */

@@ -47,5 +50,6 @@ export function findActiveElement(event, pdfBase, pdfViewer) {

var offsetForSelector = 5;
var boundsDiff = 0;
for (var i = 0; i < objects.length; i++) {
// tslint:disable-next-line:max-line-length
if (!(objects[i].shapeAnnotationType === 'Distance' || objects[i].shapeAnnotationType === 'Line' || objects[i].shapeAnnotationType === 'LineWidthArrowHead')) {
if (!(objects[i].shapeAnnotationType === 'Distance' || objects[i].shapeAnnotationType === 'Line' || objects[i].shapeAnnotationType === 'LineWidthArrowHead' || pdfBase.tool instanceof LineTool)) {
var bounds = objects[i].wrapper.bounds;

@@ -59,4 +63,22 @@ var rotationValue = 0;

(((bounds.y - offsetForSelector - rotationValue) * pdfBase.getZoomFactor()) < offsetY) && (((bounds.y + bounds.height + offsetForSelector) * pdfBase.getZoomFactor()) > offsetY)) {
actualTarget = objects[i];
break;
if (pdfBase.tool instanceof NodeDrawingTool) {
actualTarget = objects[i];
}
else {
if (!boundsDiff) {
actualTarget = objects[i];
// tslint:disable-next-line:max-line-length
boundsDiff = (offsetX - ((bounds.x - offsetForSelector) * pdfBase.getZoomFactor())) + (((bounds.x + bounds.width + offsetForSelector) * pdfBase.getZoomFactor()) - offsetX) +
(offsetY - ((bounds.y - offsetForSelector - rotationValue) * pdfBase.getZoomFactor())) + (((bounds.y + bounds.height + offsetForSelector) * pdfBase.getZoomFactor()) - offsetY);
}
else {
// tslint:disable-next-line:max-line-length
var objectBounds = (offsetX - ((bounds.x - offsetForSelector) * pdfBase.getZoomFactor())) + (((bounds.x + bounds.width + offsetForSelector) * pdfBase.getZoomFactor()) - offsetX) +
(offsetY - ((bounds.y - offsetForSelector - rotationValue) * pdfBase.getZoomFactor())) + (((bounds.y + bounds.height + offsetForSelector) * pdfBase.getZoomFactor()) - offsetY);
if (boundsDiff > objectBounds) {
actualTarget = objects[i];
boundsDiff = objectBounds;
}
}
}
}

@@ -68,5 +90,14 @@ }

var isOver = isPointOverConnector(objects[i], pt);
if (obj && !isOver) {
var newpoint = CalculateLeaderPoints(objects[i], obj);
if (newpoint) {
var rect = Rect.toBounds([newpoint, newpoint]);
rect.Inflate(10);
if (rect.containsPoint(pt)) {
isOver = true;
}
}
}
if (obj && isOver) {
actualTarget = objects[i];
break;
}

@@ -78,2 +109,29 @@ }

/** @private */
// tslint:disable-next-line
export function CalculateLeaderPoints(selector, currentobject) {
var leaderCount = 0;
var sourcePoint = selector.sourcePoint;
var targetPoint = selector.targetPoint;
if (selector.shapeAnnotationType === 'Distance') {
var segment = currentobject;
var newPoint1 = void 0;
var angle = Point.findAngle(selector.sourcePoint, selector.targetPoint);
if (segment.id.indexOf('leader') > -1) {
var center = selector.wrapper.children[0].bounds.center;
if (leaderCount === 0 && segment.id.indexOf('leader1') > -1) {
newPoint1 = { x: selector.sourcePoint.x, y: selector.sourcePoint.y - selector.leaderHeight };
center = sourcePoint;
}
else {
newPoint1 = { x: selector.targetPoint.x, y: selector.targetPoint.y - selector.leaderHeight };
center = targetPoint;
}
var matrix = identityMatrix();
rotateMatrix(matrix, angle, center.x, center.y);
var rotatedPoint = transformPointByMatrix(matrix, { x: newPoint1.x, y: newPoint1.y });
return rotatedPoint;
}
}
}
/** @private */
export function findElementUnderMouse(obj, position, padding) {

@@ -144,3 +202,3 @@ return findTargetShapeElement(obj.wrapper, position, padding);

}
if (container.bounds.containsPoint(position, padding) && container.style.fill !== 'none') {
if (container && container.bounds.containsPoint(position, padding) && container.style.fill !== 'none') {
return container;

@@ -157,3 +215,3 @@ }

(obj.shapeAnnotationType === 'Stamp' && findElementUnderMouse(obj, region, 40))) {
insertObject(obj, 'Zindex', objects);
insertObject(obj, 'zIndex', objects);
}

@@ -160,0 +218,0 @@ }

@@ -166,7 +166,3 @@ // tslint:disable-next-line:max-line-length

if (textElement_2 && !isNullOrUndefined(textElement_2.content)) {
var length_1 = findPointsLength([
{ x: obj.bounds.x, y: obj.bounds.y },
{ x: obj.bounds.x + obj.bounds.width, y: obj.bounds.y + obj.bounds.height }
]);
radius = measure.setConversion((length_1 / 2) * measure.pixelToPointFactor, obj);
radius = measure.setConversion((obj.bounds.width / 2) * measure.pixelToPointFactor, obj);
textElement_2.content = radius;

@@ -173,0 +169,0 @@ if (textElement_2.childNodes.length === 2) {

@@ -24,2 +24,3 @@ import { createHtmlElement, getDiagramElement } from '@syncfusion/ej2-drawings';

}
pdfViewer.viewerBase.applyElementStyles(divElement, index);
}

@@ -26,0 +27,0 @@ /**

import { PdfViewer } from '../pdfviewer/pdfviewer';
import { PdfAnnotationBaseModel } from './pdf-annotation-model';
import { ZOrderPageTable } from './pdf-annotation';
import { Container, Rect, PointModel, ThumbsConstraints, IElement, SelectorConstraints } from '@syncfusion/ej2-drawings';
import { Container, Rect, PointModel, ThumbsConstraints, BaseAttributes, CircleAttributes, IElement, SelectorConstraints } from '@syncfusion/ej2-drawings';
import { DrawingElement } from '@syncfusion/ej2-drawings';
import { Canvas } from '@syncfusion/ej2-drawings';
import { SelectorModel } from './selector-model';
import { AnnotationResizerLocation, AnnotationSelectorSettingsModel } from '../pdfviewer/index';
/**

@@ -91,3 +92,3 @@ * Renderer module is used to render basic diagram elements

*/
renderSelector(select?: number, helper?: PdfAnnotationBaseModel): void;
renderSelector(select?: number, currentSelector?: AnnotationSelectorSettingsModel, helper?: PdfAnnotationBaseModel, isSelect?: boolean): void;
/**

@@ -102,7 +103,7 @@ * Rotates the given nodes/connectors by the given angle

*/
rotate(obj: PdfAnnotationBaseModel | SelectorModel, angle: number, pivot?: PointModel): boolean;
rotate(obj: PdfAnnotationBaseModel | SelectorModel, angle: number, pivot?: PointModel, currentSelector?: AnnotationSelectorSettingsModel): boolean;
/**
* @private
*/
rotateObjects(parent: PdfAnnotationBaseModel | SelectorModel, objects: PdfAnnotationBaseModel[], angle: number, pivot?: PointModel, includeParent?: boolean): void;
rotateObjects(parent: PdfAnnotationBaseModel | SelectorModel, objects: PdfAnnotationBaseModel[], angle: number, pivot?: PointModel, includeParent?: boolean, currentSelector?: AnnotationSelectorSettingsModel): void;
private getParentSvg;

@@ -112,10 +113,30 @@ /**

*/
renderBorder(selector: DrawingElement, canvas: HTMLCanvasElement | SVGElement, transform?: Transforms, enableNode?: number, isBorderTickness?: boolean, isSwimlane?: boolean, isSticky?: boolean): void;
renderBorder(selector: DrawingElement, canvas: HTMLCanvasElement | SVGElement, currentSelector?: any, transform?: Transforms, enableNode?: number, isBorderTickness?: boolean, isSwimlane?: boolean, isSticky?: boolean): void;
/**
* @private
*/
renderCircularHandle(id: string, selector: DrawingElement, cx: number, cy: number, canvas: HTMLCanvasElement | SVGElement, visible: boolean, enableSelector?: number, t?: Transforms, connected?: boolean, canMask?: boolean, ariaLabel?: Object, count?: number, className?: string): void;
getSignBorder(type: PdfAnnotationBaseModel, options: BaseAttributes): void;
/**
* @private
*/
getBorderSelector(type: PdfAnnotationBaseModel, options: BaseAttributes): void;
/**
* @private
*/
renderCircularHandle(id: string, selector: DrawingElement, cx: number, cy: number, canvas: HTMLCanvasElement | SVGElement, visible: boolean, enableSelector?: number, t?: Transforms, connected?: boolean, canMask?: boolean, ariaLabel?: Object, count?: number, className?: string, currentSelector?: AnnotationSelectorSettingsModel): void;
/**
* @private
*/
getShapeSize(type: PdfAnnotationBaseModel, options: CircleAttributes, currentSelector: any, t?: Transforms): void;
/**
* @private
*/
getShape(type: PdfAnnotationBaseModel, currentSelector?: any): AnnotationSelectorSettingsModel;
/**
* @private
*/
getResizerColors(type: PdfAnnotationBaseModel, options: CircleAttributes, currentSelector?: any, t?: Transforms): void;
/**
* @private
*/
renderRotateThumb(wrapper: DrawingElement, canvas: HTMLCanvasElement | SVGElement, transform?: Transforms, selectorConstraints?: SelectorConstraints, canMask?: boolean): void;

@@ -125,6 +146,10 @@ /**

*/
renderResizeHandle(element: DrawingElement, canvas: HTMLCanvasElement | SVGElement, constraints: ThumbsConstraints, currentZoom: number, canMask?: boolean, enableNode?: number, nodeConstraints?: boolean, isStamp?: boolean, isSticky?: boolean, isPath?: boolean, isFreeText?: boolean): void;
renderResizeHandle(element: DrawingElement, canvas: HTMLCanvasElement | SVGElement, constraints: ThumbsConstraints, currentZoom: number, canMask?: boolean, enableNode?: number, nodeConstraints?: boolean, isStamp?: boolean, isSticky?: boolean, isPath?: boolean, isFreeText?: boolean, currentSelector?: AnnotationSelectorSettingsModel): void;
/**
* @private
*/
getResizerLocation(type: PdfAnnotationBaseModel, currentSelector?: any): AnnotationResizerLocation;
/**
* @private
*/
renderPivotLine(element: DrawingElement, canvas: HTMLCanvasElement | SVGElement, transform?: Transforms, selectorConstraints?: SelectorConstraints, canMask?: boolean): void;

@@ -134,3 +159,3 @@ /**

*/
renderEndPointHandle(selector: PdfAnnotationBaseModel, canvas: HTMLCanvasElement | SVGElement, constraints: ThumbsConstraints, transform: Transforms, connectedSource: boolean, connectedTarget?: boolean, isSegmentEditing?: boolean): void;
renderEndPointHandle(selector: PdfAnnotationBaseModel, canvas: HTMLCanvasElement | SVGElement, constraints: ThumbsConstraints, transform: Transforms, connectedSource: boolean, connectedTarget?: boolean, isSegmentEditing?: boolean, currentSelector?: AnnotationSelectorSettingsModel): void;
/**

@@ -143,11 +168,11 @@ * @private

*/
select(objArray: string[], multipleSelection?: boolean, preventUpdate?: boolean): void;
select(objArray: string[], currentSelector?: any, multipleSelection?: boolean, preventUpdate?: boolean): void;
/**
* @private
*/
dragSelectedObjects(tx: number, ty: number, pageIndex: number, helper: PdfAnnotationBaseModel): boolean;
dragSelectedObjects(tx: number, ty: number, pageIndex: number, currentSelector: any, helper: PdfAnnotationBaseModel): boolean;
/**
* @private
*/
drag(obj: PdfAnnotationBaseModel | SelectorModel, tx: number, ty: number, helper: PdfAnnotationBaseModel): void;
drag(obj: PdfAnnotationBaseModel | SelectorModel, tx: number, ty: number, currentSelector: any, helper: PdfAnnotationBaseModel): void;
/**

@@ -202,3 +227,3 @@ * @private

*/
dragConnectorEnds(endPoint: string, obj: IElement, point: PointModel, segment: PointModel, target?: IElement, targetPortId?: string): boolean;
dragConnectorEnds(endPoint: string, obj: IElement, point: PointModel, segment: PointModel, target?: IElement, targetPortId?: string, currentSelector?: any): boolean;
/**

@@ -225,2 +250,3 @@ * @private

paste(obj: PdfAnnotationBaseModel[], index: number): void;
private calculateCopyPosition;
/**

@@ -227,0 +253,0 @@ * @private

@@ -1,2 +0,2 @@

import { ChildProperty, Property, Complex } from '@syncfusion/ej2-base';import { PointModel, DecoratorShapes } from '@syncfusion/ej2-drawings';import { Point } from '@syncfusion/ej2-drawings';import { Size } from '@syncfusion/ej2-drawings';import { Container } from '@syncfusion/ej2-drawings';import { PdfAnnotationType } from './enum';import { ICommentsCollection, IReviewCollection } from '../pdfviewer';
import { ChildProperty, Property, Complex } from '@syncfusion/ej2-base'; import { PointModel, DecoratorShapes } from '@syncfusion/ej2-drawings'; import { Point } from '@syncfusion/ej2-drawings'; import { Size } from '@syncfusion/ej2-drawings'; import { Container } from '@syncfusion/ej2-drawings'; import { PdfAnnotationType } from './enum'; import { ICommentsCollection, IReviewCollection, AnnotationSelectorSettingsModel } from '../pdfviewer';

@@ -125,3 +125,3 @@ /**

/**
* Represents the auther value of the annotation
* Represents the auther value of the annotation
* @default ''

@@ -132,3 +132,3 @@ */

/**
* Represents the modified date of the annotation
* Represents the modified date of the annotation
* @default ''

@@ -139,3 +139,3 @@ */

/**
* Represents the subject of the annotation
* Represents the subject of the annotation
* @default ''

@@ -146,3 +146,3 @@ */

/**
* Represents the notes of the annotation
* Represents the notes of the annotation
* @default ''

@@ -153,3 +153,3 @@ */

/**
* Represents the stroke color of the annotation
* Represents the stroke color of the annotation
* @default 'black'

@@ -160,3 +160,3 @@ */

/**
* Represents the fill color of the annotation
* Represents the fill color of the annotation
* @default 'tranparent'

@@ -167,3 +167,3 @@ */

/**
* Represents the fill color of the annotation
* Represents the fill color of the annotation
* @default 'tranparent'

@@ -174,3 +174,3 @@ */

/**
* Represents the stroke color of the annotation
* Represents the stroke color of the annotation
* @default 'black'

@@ -181,3 +181,3 @@ */

/**
* Represents the path data of the annotation
* Represents the path data of the annotation
* @default ''

@@ -188,3 +188,3 @@ */

/**
* Represents the opecity value of the annotation
* Represents the opecity value of the annotation
* @default 1

@@ -322,3 +322,3 @@ */

/**
* Represents the unique annotName of the annotation
* Represents the unique annotName of the annotation
* @default ''

@@ -329,3 +329,3 @@ */

/**
* Represents the review collection of the annotation
* Represents the review collection of the annotation
* @default ''

@@ -336,3 +336,3 @@ */

/**
* Represents the comments collection of the annotation
* Represents the comments collection of the annotation
* @default []

@@ -343,3 +343,3 @@ */

/**
* Represents the comments collection of the annotation
* Represents the comments collection of the annotation
* @default '#000'

@@ -386,3 +386,3 @@ */

/**
* Represents the opecity value of the annotation
* Represents the opecity value of the annotation
* @default 1

@@ -393,2 +393,8 @@ */

/**
* Represents the selection settings of the annotation
* @default ''
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* Represents the shape annotation label content border color

@@ -406,2 +412,56 @@ * @default '#ffffff00'

/**
* Represents the unique Name of the annotation
* @default ''
*/
signatureName?: string;
/**
* specifies the minHeight of the annotation.
* @default 0
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
* @default 0
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
* @default 0
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
* @default 0
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
* @default 'false'
*/
isLock?: boolean;
/**
* specifies the particular annotation mode.
* @default 'UI Drawn Annotation'
*/
annotationAddMode?: string;
/**
* specifies the default settings of the annotation.
* @default ''
*/
annotationSettings?: object;
/**
* specifies the previous font size of the annotation.
* @default '16'
*/
previousFontSize?: number;
/**
* Represents the text style of annotation

@@ -418,2 +478,7 @@ * @default ''

/**
* specifies the custom data of the annotation.
*/
customData?: object;
}

@@ -420,0 +485,0 @@

@@ -7,3 +7,3 @@ import { ChildProperty } from '@syncfusion/ej2-base';

import { PdfAnnotationType } from './enum';
import { ICommentsCollection, IReviewCollection } from '../pdfviewer';
import { ICommentsCollection, IReviewCollection, AnnotationSelectorSettingsModel } from '../pdfviewer';
/**

@@ -322,2 +322,7 @@ * The `PdfBounds` is base for annotation bounds.

/**
* Represents the selection settings of the annotation
* @default ''
*/
annotationSelectorSettings: AnnotationSelectorSettingsModel;
/**
* Represents the shape annotation label content border color

@@ -333,2 +338,47 @@ * @default '#ffffff00'

/**
* Represents the unique Name of the annotation
* @default ''
*/
signatureName: string;
/**
* specifies the minHeight of the annotation.
* @default 0
*/
minHeight: number;
/**
* specifies the minWidth of the annotation.
* @default 0
*/
minWidth: number;
/**
* specifies the minHeight of the annotation.
* @default 0
*/
maxHeight: number;
/**
* specifies the maxWidth of the annotation.
* @default 0
*/
maxWidth: number;
/**
* specifies the locked action of the annotation.
* @default 'false'
*/
isLock: boolean;
/**
* specifies the particular annotation mode.
* @default 'UI Drawn Annotation'
*/
annotationAddMode: string;
/**
* specifies the default settings of the annotation.
* @default ''
*/
annotationSettings: object;
/**
* specifies the previous font size of the annotation.
* @default '16'
*/
previousFontSize: number;
/**
* Represents the text style of annotation

@@ -343,2 +393,6 @@ * @default ''

labelBounds: PdfBoundsModel;
/**
* specifies the custom data of the annotation.
*/
customData: object;
constructor(parent: any, propName: string, defaultValue: Object, isArray?: boolean);

@@ -345,0 +399,0 @@ }

@@ -235,2 +235,5 @@ var __extends = (this && this.__extends) || (function () {

__decorate([
Property('')
], PdfAnnotationBase.prototype, "annotationSelectorSettings", void 0);
__decorate([
Property('#ffffff00')

@@ -242,2 +245,29 @@ ], PdfAnnotationBase.prototype, "labelBorderColor", void 0);

__decorate([
Property('')
], PdfAnnotationBase.prototype, "signatureName", void 0);
__decorate([
Property(0)
], PdfAnnotationBase.prototype, "minHeight", void 0);
__decorate([
Property(0)
], PdfAnnotationBase.prototype, "minWidth", void 0);
__decorate([
Property(0)
], PdfAnnotationBase.prototype, "maxHeight", void 0);
__decorate([
Property(0)
], PdfAnnotationBase.prototype, "maxWidth", void 0);
__decorate([
Property(false)
], PdfAnnotationBase.prototype, "isLock", void 0);
__decorate([
Property('UI Drawn Annotation')
], PdfAnnotationBase.prototype, "annotationAddMode", void 0);
__decorate([
Property('')
], PdfAnnotationBase.prototype, "annotationSettings", void 0);
__decorate([
Property(16)
], PdfAnnotationBase.prototype, "previousFontSize", void 0);
__decorate([
Complex({ isBold: false, isItalic: false, isStrikeout: false, isUnderline: false }, PdfFont)

@@ -248,2 +278,5 @@ ], PdfAnnotationBase.prototype, "font", void 0);

], PdfAnnotationBase.prototype, "labelBounds", void 0);
__decorate([
Property(null)
], PdfAnnotationBase.prototype, "customData", void 0);
return PdfAnnotationBase;

@@ -250,0 +283,0 @@ }(ChildProperty));

@@ -1,2 +0,2 @@

import { Property, ChildProperty, Collection, Complex } from '@syncfusion/ej2-base';import { IElement, ThumbsConstraints } from '@syncfusion/ej2-drawings';import { Container } from '@syncfusion/ej2-drawings';import { PointModel } from '@syncfusion/ej2-drawings';import { Point } from '@syncfusion/ej2-drawings';import { Size } from '@syncfusion/ej2-drawings';import { PdfAnnotationBaseModel } from './pdf-annotation-model';import { PdfAnnotationBase } from './pdf-annotation';
import { Property, ChildProperty, Collection, Complex } from '@syncfusion/ej2-base'; import { IElement, ThumbsConstraints } from '@syncfusion/ej2-drawings'; import { Container } from '@syncfusion/ej2-drawings'; import { PointModel } from '@syncfusion/ej2-drawings'; import { Point } from '@syncfusion/ej2-drawings'; import { Size } from '@syncfusion/ej2-drawings'; import { PdfAnnotationBaseModel } from './pdf-annotation-model'; import { PdfAnnotationBase } from './pdf-annotation';

@@ -3,0 +3,0 @@ /**

@@ -74,3 +74,3 @@ import { PointModel } from '@syncfusion/ej2-drawings';

mouseLeave(args: MouseEventArgs): void;
protected updateSize(shape: SelectorModel | PdfAnnotationBaseModel, startPoint: PointModel, endPoint: PointModel, corner: string, initialBounds: Rect, angle?: number, isMouseUp?: boolean): Rect;
protected updateSize(shape: any, startPoint: PointModel, endPoint: PointModel, corner: string, initialBounds: Rect, angle?: number, isMouseUp?: boolean): Rect;
protected getPivot(corner: string): PointModel;

@@ -142,4 +142,5 @@ protected getPositions(corner: string, x: number, y: number): PointModel;

export declare class ConnectTool extends ToolBase {
protected endPoint: string;
/** @private */
endPoint: string;
/** @private */
selectedSegment: PointModel;

@@ -146,0 +147,0 @@ /** @private */

@@ -132,2 +132,3 @@ import { PdfViewer, PdfViewerBase, AnnotationType, TextMarkupAnnotation, ShapeAnnotation, StampAnnotation, StickyNotesAnnotation, IPopupAnnotation, MeasureAnnotation } from '../index';

private previousIndex;
private overlappedAnnotations;
/**

@@ -152,2 +153,18 @@ * @private

*/
getCustomData(annotation: any): object;
/**
* @private
*/
getShapeData(type: string, subject: string): object;
/**
* @private
*/
getMeasureData(type: string): object;
/**
* @private
*/
getTextMarkupData(type: string): object;
/**
* @private
*/
clearAnnotationStorage(): void;

@@ -391,2 +408,6 @@ /**

*/
triggerAnnotationAdd(pdfAnnotationBase: PdfAnnotationBaseModel): void;
/**
* @private
*/
triggerAnnotationResize(pdfAnnotationBase: PdfAnnotationBaseModel): void;

@@ -400,3 +421,3 @@ /**

*/
annotationSelect(annotationId: any, pageNumber: number, annotation: any, annotationCollection?: any): void;
annotationSelect(annotationId: any, pageNumber: number, annotation: any, annotationCollection?: any, isDblClick?: boolean, isSelected?: boolean): void;
editAnnotation(annotation: any): void;

@@ -407,2 +428,3 @@ /**

updateFreeTextProperties(annotation: any): void;
private updateAnnotationComments;
/**

@@ -422,3 +444,32 @@ * @private

*/
nameToHash(colour: string): string;
private updateFreeTextFontStyle;
private setFreeTextFontStyle;
/**
* @private
*/
findAnnotationSettings(annotation: any, isSettings?: boolean): any;
/**
* @private
*/
updateAnnotationSettings(annotation: any): any;
/**
* @private
*/
updateSettings(annotationSettings: any): any;
private getOverlappedAnnotations;
private getPageShapeAnnotations;
private findOverlappedAnnotations;
private calculateOverlappedAnnotationBounds;
/**
* @private
*/
findAnnotationMode(annotation: any, pageNumber: number, type: string): string;
private checkOverlappedCollections;
private orderTextMarkupBounds;
/**
* @private
*/
clear(): void;
retrieveAnnotationCollection(): any[];
/**

@@ -425,0 +476,0 @@ * @private

import { PdfViewer, PdfViewerBase, AnnotationType as AnnotType, ICommentsCollection, IReviewCollection } from '../..';
import { PointModel } from '@syncfusion/ej2-drawings';
import { PdfAnnotationBaseModel } from '../../diagram/pdf-annotation-model';
import { AnnotationSelectorSettingsModel } from '../pdfviewer-model';
/**

@@ -33,2 +34,4 @@ * @hidden

review: IReviewCollection;
annotationSelectorSettings: AnnotationSelectorSettingsModel;
annotationSettings?: any;
}

@@ -139,13 +142,31 @@ /**

private selectionEnd;
private isBold;
private isItalic;
private isUnderline;
private isStrikethrough;
private textAlign;
/**
* @private
*/
isBold: boolean;
/**
* @private
*/
isItalic: boolean;
/**
* @private
*/
isUnderline: boolean;
/**
* @private
*/
isStrikethrough: boolean;
/**
* @private
*/
textAlign: string;
private defaultText;
constructor(pdfviewer: PdfViewer, pdfViewerBase: PdfViewerBase);
private updateTextProperties;
/**
* @private
*/
updateTextProperties(): void;
/**
* @private
*/
renderFreeTextAnnotations(shapeAnnotations: any, pageNumber: number, isImportAction?: boolean): void;

@@ -155,2 +176,6 @@ /**

*/
getSettings(annotation: any): any;
/**
* @private
*/
setAnnotationType(type: AnnotType): void;

@@ -180,2 +205,3 @@ /**

onKeyDownInputBox(event: KeyboardEvent): void;
private updateFreeTextAnnotationSize;
/**

@@ -182,0 +208,0 @@ * @private

@@ -35,5 +35,17 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';

this.selectionEnd = 0;
/**
* @private
*/
this.isBold = false;
/**
* @private
*/
this.isItalic = false;
/**
* @private
*/
this.isUnderline = false;
/**
* @private
*/
this.isStrikethrough = false;

@@ -67,2 +79,5 @@ this.pdfViewer = pdfviewer;

}
/**
* @private
*/
FreeTextAnnotation.prototype.updateTextProperties = function () {

@@ -147,2 +162,3 @@ this.defautWidth = this.pdfViewer.freeTextSettings.width ? this.pdfViewer.freeTextSettings.width : 151;

var annotation = shapeAnnotations[i];
annotation.annotationAddMode = this.pdfViewer.annotationModule.findAnnotationMode(annotation, pageNumber, annotation.AnnotType);
if (annotation.AnnotType) {

@@ -157,2 +173,4 @@ var vertexPoints = null;

}
// tslint:disable-next-line:max-line-length
annotation.AnnotationSettings = annotation.AnnotationSettings ? annotation.AnnotationSettings : this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.freeTextSettings);
var annot = void 0;

@@ -176,3 +194,5 @@ // tslint:disable-next-line

// tslint:disable-next-line:max-line-length
font: { isBold: annotation.Font.Bold, isItalic: annotation.Font.Italic, isStrikeout: annotation.Font.Strikeout, isUnderline: annotation.Font.Underline }
font: { isBold: annotation.Font.Bold, isItalic: annotation.Font.Italic, isStrikeout: annotation.Font.Strikeout, isUnderline: annotation.Font.Underline },
annotationSelectorSettings: this.getSettings(annotation), annotationSettings: annotation.AnnotationSettings,
customData: this.pdfViewer.annotation.getCustomData(annotation), annotationAddMode: annotation.annotationAddMode
};

@@ -195,2 +215,16 @@ if (isImportAction) {

*/
// tslint:disable-next-line
FreeTextAnnotation.prototype.getSettings = function (annotation) {
var selector = this.pdfViewer.annotationSelectorSettings;
if (annotation.AnnotationSelectorSettings) {
selector = annotation.AnnotationSelectorSettings;
}
else if (this.pdfViewer.freeTextSettings.annotationSelectorSettings) {
selector = this.pdfViewer.freeTextSettings.annotationSelectorSettings;
}
return selector;
};
/**
* @private
*/
FreeTextAnnotation.prototype.setAnnotationType = function (type) {

@@ -445,2 +479,6 @@ var date = new Date();

// tslint:disable-next-line
var annotationSelectorSettings = this.pdfViewer.freeTextSettings.annotationSelectorSettings ? this.pdfViewer.freeTextSettings.annotationSelectorSettings : this.pdfViewer.annotationSelectorSettings;
// tslint:disable-next-line
var annotationSettings = this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.freeTextSettings);
// tslint:disable-next-line
annot = {

@@ -455,6 +493,13 @@ author: this.author, modifiedDate: currentDateString, subject: 'Text Box', id: 'free_text' + this.inputBoxCount,

shapeAnnotationType: 'FreeText', pageIndex: pageIndex, fontColor: this.fontColor, fontSize: this.fontSize,
fontFamily: this.fontFamily, opacity: this.opacity, comments: [], textAlign: 'Left',
font: { isBold: false, isItalic: false, isStrikeout: false, isUnderline: false },
review: { state: 'Unmarked', stateModel: 'None', modifiedDate: currentDateString, author: this.author }
fontFamily: this.fontFamily, opacity: this.opacity, comments: [], textAlign: this.textAlign,
// tslint:disable-next-line:max-line-length
font: { isBold: this.isBold, isItalic: this.isItalic, isStrikeout: this.isStrikethrough, isUnderline: this.isUnderline },
review: { state: 'Unmarked', stateModel: 'None', modifiedDate: currentDateString, author: this.author },
// tslint:disable-next-line:max-line-length
annotationSelectorSettings: annotationSelectorSettings, annotationSettings: annotationSettings,
customData: this.pdfViewer.freeTextSettings.customData
};
if (this.pdfViewer.enableRtl) {
annot.textAlign = 'Right';
}
var annotation = this.pdfViewer.add(annot);

@@ -506,9 +551,12 @@ // tslint:disable-next-line

}
this.pdfViewer.renderSelector(this.selectedAnnotation.pageIndex);
this.pdfViewer.renderSelector(this.selectedAnnotation.pageIndex, this.selectedAnnotation.annotationSelectorSettings);
}
this.isNewFreeTextAnnot = false;
if (this.inputBoxElement.parentElement) {
if (pageDiv) {
if (pageDiv && (pageDiv.id === this.inputBoxElement.parentElement.id)) {
pageDiv.removeChild(this.inputBoxElement);
}
else {
this.inputBoxElement.parentElement.removeChild(this.inputBoxElement);
}
}

@@ -531,3 +579,2 @@ var canvass = document.getElementById(this.pdfViewer.element.id + '_annotationCanvas_' + pageIndex);

FreeTextAnnotation.prototype.onKeyDownInputBox = function (event) {
var _this = this;
this.selectedAnnotation = this.pdfViewer.selectedItems.annotations ? this.pdfViewer.selectedItems.annotations[0]

@@ -543,22 +590,37 @@ : this.selectedAnnotation;

&& parseInt(inuptEleObj.inputBoxElement.style.height) < inuptEleObj.inputBoxElement.scrollHeight) {
inuptEleObj.inputBoxElement.style.height = inuptEleObj.inputBoxElement.scrollHeight + 5 + 'px';
var inputEleHeight = parseFloat(_this.inputBoxElement.style.height);
var inputEleWidth = parseFloat(_this.inputBoxElement.style.width);
inputEleHeight = ((inputEleHeight - 1) / inuptEleObj.pdfViewerBase.getZoomFactor());
inputEleWidth = ((inputEleWidth - 1) / inuptEleObj.pdfViewerBase.getZoomFactor());
if (_this.selectedAnnotation) {
var heightDiff = (inputEleHeight - inuptEleObj.selectedAnnotation.bounds.height);
if (heightDiff > 0) {
var y = inuptEleObj.selectedAnnotation.wrapper.offsetY + (heightDiff / 2);
inuptEleObj.selectedAnnotation.bounds.width = inputEleWidth;
inuptEleObj.selectedAnnotation.bounds.height = inputEleHeight;
// tslint:disable-next-line
inuptEleObj.pdfViewer.nodePropertyChange(inuptEleObj.selectedAnnotation, { bounds: { width: inuptEleObj.selectedAnnotation.bounds.width, height: inuptEleObj.selectedAnnotation.bounds.height, y: y } });
inuptEleObj.pdfViewer.renderSelector(inuptEleObj.selectedAnnotation.pageIndex);
}
}
inuptEleObj.updateFreeTextAnnotationSize(true);
}
else {
inuptEleObj.updateFreeTextAnnotationSize(false);
}
// tslint:disable-next-line
}, 0);
};
FreeTextAnnotation.prototype.updateFreeTextAnnotationSize = function (isSize) {
var inuptEleObj = this;
if (!isSize) {
inuptEleObj.inputBoxElement.style.height = 'auto';
}
inuptEleObj.inputBoxElement.style.height = inuptEleObj.inputBoxElement.scrollHeight + 5 + 'px';
var inputEleHeight = parseFloat(this.inputBoxElement.style.height);
var inputEleWidth = parseFloat(this.inputBoxElement.style.width);
inputEleHeight = ((inputEleHeight - 1) / inuptEleObj.pdfViewerBase.getZoomFactor());
inputEleWidth = ((inputEleWidth - 1) / inuptEleObj.pdfViewerBase.getZoomFactor());
if (this.selectedAnnotation) {
var heightDiff = (inputEleHeight - inuptEleObj.selectedAnnotation.bounds.height);
var y = 0;
if (heightDiff > 0) {
y = inuptEleObj.selectedAnnotation.wrapper.offsetY + (heightDiff / 2);
}
else {
heightDiff = Math.abs(heightDiff);
y = inuptEleObj.selectedAnnotation.wrapper.offsetY - (heightDiff / 2);
}
inuptEleObj.selectedAnnotation.bounds.width = inputEleWidth;
inuptEleObj.selectedAnnotation.bounds.height = inputEleHeight;
// tslint:disable-next-line
inuptEleObj.pdfViewer.nodePropertyChange(inuptEleObj.selectedAnnotation, { bounds: { width: inuptEleObj.selectedAnnotation.bounds.width, height: inuptEleObj.selectedAnnotation.bounds.height, y: y } });
inuptEleObj.pdfViewer.renderSelector(inuptEleObj.selectedAnnotation.pageIndex, this.selectedAnnotation.annotationSelectorSettings);
}
};
/**

@@ -618,3 +680,10 @@ * @private

}
this.inputBoxElement.style.textAlign = this.textAlign.toLowerCase();
if (this.pdfViewer.enableRtl) {
this.inputBoxElement.style.textAlign = 'right';
this.inputBoxElement.style.direction = 'rtl';
this.inputBoxElement.style.left = ((currentPosition.x)) - ((this.defautWidth * zoomFactor / 2));
}
else {
this.inputBoxElement.style.textAlign = this.textAlign.toLowerCase();
}
this.inputBoxElement.style.borderColor = this.borderColor;

@@ -657,3 +726,7 @@ this.inputBoxElement.style.color = this.fontColor;

}
if (this.selectedAnnotation.textAlign) {
if (this.pdfViewer.enableRtl) {
this.inputBoxElement.style.textAlign = 'right';
this.inputBoxElement.style.direction = 'rtl';
}
else if (this.selectedAnnotation.textAlign) {
this.inputBoxElement.style.textAlign = this.selectedAnnotation.textAlign;

@@ -762,2 +835,4 @@ }

}
// tslint:disable-next-line:max-line-length
annotation.AnnotationSettings = annotation.AnnotationSettings ? annotation.AnnotationSettings : this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.freeTextSettings);
var annot = void 0;

@@ -776,6 +851,8 @@ // tslint:disable-next-line

pageIndex: pageNumber, opacity: annotation.Opacity, fontColor: annotation.FontColor, fontSize: annotation.FontSize,
fontFamily: annotation.FontFamily, notes: annotation.MarkupText,
fontFamily: annotation.FontFamily, notes: annotation.MarkupText, textAlign: annotation.TextAlign,
// tslint:disable-next-line
comments: this.pdfViewer.annotationModule.getAnnotationComments(annotation.Comments, annotation, annotation.Author), review: { state: annotation.State, stateModel: annotation.StateModel, modifiedDate: annotation.ModifiedDate, author: annotation.Author },
font: { isBold: annotation.Font.Bold, isItalic: annotation.Font.Italic, isStrikeout: annotation.Font.Strikeout, isUnderline: annotation.Font.Underline }
font: { isBold: annotation.Font.Bold, isItalic: annotation.Font.Italic, isStrikeout: annotation.Font.Strikeout, isUnderline: annotation.Font.Underline },
annotationSelectorSettings: this.getSettings(annotation), annotationSettings: annotation.AnnotationSettings,
customData: this.pdfViewer.annotation.getCustomData(annotation)
};

@@ -801,2 +878,4 @@ this.pdfViewer.annotationModule.storeAnnotations(pageNumber, annot, '_annotations_freetext');

}
// tslint:disable-next-line:max-line-length
annotation.AnnotationSettings = annotation.AnnotationSettings ? annotation.AnnotationSettings : this.pdfViewer.annotationModule.updateSettings(this.pdfViewer.freeTextSettings);
// tslint:disable-next-line

@@ -818,3 +897,3 @@ var annot = void 0;

comments: this.pdfViewer.annotationModule.getAnnotationComments(annotation.Comments, annotation, annotation.Author), review: { state: annotation.State, stateModel: annotation.StateModel, modifiedDate: annotation.ModifiedDate, author: annotation.Author },
font: { isBold: annotation.Font.Bold, isItalic: annotation.Font.Italic, isStrikeout: annotation.Font.Strikeout, isUnderline: annotation.Font.Underline }, pageNumber: pageNumber
font: { isBold: annotation.Font.Bold, isItalic: annotation.Font.Italic, isStrikeout: annotation.Font.Strikeout, isUnderline: annotation.Font.Underline }, pageNumber: pageNumber, annotationSettings: annotation.AnnotationSettings
};

@@ -821,0 +900,0 @@ return annot;

@@ -93,3 +93,3 @@ /**

this.pdfViewer.nodePropertyChange(selectedAnnotation, {});
this.pdfViewer.renderSelector(selectedAnnotation.pageIndex);
this.pdfViewer.renderSelector(selectedAnnotation.pageIndex, this.pdfViewer.annotationSelectorSettings);
// tslint:disable-next-line

@@ -96,0 +96,0 @@ var commentsDiv = document.getElementById(this.pdfViewer.selectedItems.annotations[0].annotName);

@@ -26,6 +26,6 @@ import { createElement } from '@syncfusion/ej2-base';

var annotationY = data.annotationLocation;
if (hyperlinks.length > 0 && hyperlinksBounds.length > 0) {
if (hyperlinks && hyperlinks.length > 0 && hyperlinksBounds.length > 0) {
this.renderWebLink(hyperlinks, hyperlinksBounds, pageIndex);
}
if (linkAnnotation.length > 0 && linkPage.length > 0) {
if (linkAnnotation && linkAnnotation.length > 0 && linkPage.length > 0) {
this.renderDocumentLink(linkAnnotation, linkPage, annotationY, pageIndex);

@@ -32,0 +32,0 @@ }

@@ -1,2 +0,2 @@

import { PdfViewer, PdfViewerBase, IRectangle, AnnotationType as AnnotType } from '../../index';
import { PdfViewer, PdfViewerBase, IRectangle, AnnotationType as AnnotType, ShapeLabelSettingsModel } from '../../index';
import { PdfAnnotationBaseModel } from '../../diagram/pdf-annotation-model';

@@ -6,2 +6,3 @@ import { PointModel } from '@syncfusion/ej2-drawings';

import { LineHeadStyle, CalibrationUnit } from '../base';
import { AnnotationSelectorSettingsModel } from '../pdfviewer-model';
/**

@@ -49,2 +50,6 @@ * @hidden

labelBounds: IRectangle;
annotationSelectorSettings: AnnotationSelectorSettingsModel;
labelSettings?: ShapeLabelSettingsModel;
annotationSettings?: any;
customData: object;
}

@@ -151,2 +156,6 @@ /**

*/
leaderLength: number;
/**
* @private
*/
perimeterThickness: number;

@@ -198,4 +207,7 @@ /**

measureShapeCount: number;
/**
* @private
*/
volumeDepth: number;
private ratio;
private volumeDepth;
private scaleRatioString;

@@ -221,4 +233,9 @@ private scaleRatioDialog;

*/
getSettings(annotation: any): any;
/**
* @private
*/
setAnnotationType(type: AnnotType): void;
private createAnnotationObject;
private getSelector;
private getShapeAnnotType;

@@ -225,0 +242,0 @@ private getShapeType;

@@ -1,3 +0,4 @@

import { PdfViewer, PdfViewerBase, IRectangle, ICommentsCollection, IReviewCollection, AnnotationType as AnnotType, LineHeadStyle } from '../../index';
import { PdfViewer, PdfViewerBase, IRectangle, ICommentsCollection, IReviewCollection, AnnotationType as AnnotType, LineHeadStyle, ShapeLabelSettingsModel } from '../../index';
import { PointModel } from '@syncfusion/ej2-drawings';
import { AnnotationSelectorSettingsModel } from '../pdfviewer-model';
/**

@@ -39,2 +40,6 @@ * @hidden

labelBounds: IRectangle;
annotationSelectorSettings: AnnotationSelectorSettingsModel;
labelSettings?: ShapeLabelSettingsModel;
annotationSettings?: any;
customData: object;
}

@@ -167,2 +172,6 @@ /**

*/
getSettings(annotation: any): any;
/**
* @private
*/
setAnnotationType(type: AnnotType): void;

@@ -186,2 +195,3 @@ private setShapeType;

private createAnnotationObject;
private getSelector;
private getAnnotations;

@@ -188,0 +198,0 @@ private getRgbCode;

@@ -54,2 +54,3 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base';

var annotation = shapeAnnotations[i];
annotation.annotationAddMode = this.pdfViewer.annotationModule.findAnnotationMode(annotation, pageNumber, annotation.AnnotType);
var annotationObject = null;

@@ -74,4 +75,10 @@ this.shapeCount = this.shapeCount + 1;

annotation.FontSize = annotation.FontSize ? annotation.FontSize : 16;
// tslint:disable-next-line:max-line-length
annotation.LabelSettings = annotation.LabelSettings ? annotation.LabelSettings : this.pdfViewer.shapeLabelSettings;
}
// tslint:disable-next-line:max-line-length
annotation.AnnotationSelectorSettings = annotation.AnnotationSelectorSettings ? annotation.AnnotationSelectorSettings : this.pdfViewer.annotationSelectorSettings;
// tslint:disable-next-line:max-line-length
annotation.AnnotationSettings = annotation.AnnotationSettings ? annotation.AnnotationSettings : this.pdfViewer.annotationModule.updateAnnotationSettings(annotation);
// tslint:disable-next-line:max-line-length
annotationObject = {

@@ -88,3 +95,5 @@ id: 'shape' + this.shapeCount, shapeAnnotationType: annotation.ShapeAnnotationType, author: annotation.Author, modifiedDate: annotation.ModifiedDate, subject: annotation.Subject,

fontColor: annotation.FontColor, labelBorderColor: annotation.LabelBorderColor, fontSize: annotation.FontSize,
labelBounds: annotation.LabelBounds
// tslint:disable-next-line:max-line-length
labelBounds: annotation.LabelBounds, annotationSelectorSettings: this.getSettings(annotation), labelSettings: annotation.LabelSettings, annotationSettings: annotation.AnnotationSettings,
customData: this.pdfViewer.annotation.getCustomData(annotation)
};

@@ -97,2 +106,4 @@ var annot = void 0;

}
// tslint:disable-next-line:max-line-length
annotation.AnnotationSelectorSettings = annotation.AnnotationSelectorSettings ? annotation.AnnotationSelectorSettings : this.pdfViewer.annotationSelectorSettings;
annot = {

@@ -111,8 +122,6 @@ // tslint:disable-next-line:max-line-length

fontColor: annotation.FontColor, labelBorderColor: annotation.LabelBorderColor, fontSize: annotation.FontSize,
labelBounds: annotation.LabelBounds
labelBounds: annotation.LabelBounds, annotationSelectorSettings: annotation.AnnotationSelectorSettings,
annotationSettings: annotationObject.annotationSettings, annotationAddMode: annotation.annotationAddMode
};
var addedAnnot = this.pdfViewer.add(annot);
if (addedAnnot.shapeAnnotationType === 'Polygon') {
this.pdfViewer.nodePropertyChange(addedAnnot, { fillColor: annot.fillColor });
}
this.pdfViewer.annotationModule.storeAnnotations(pageNumber, annotationObject, '_annotations_shape');

@@ -125,2 +134,3 @@ }

var annotationObject = this.createAnnotationObject(shapeAnnotations);
this.pdfViewer.annotationModule.triggerAnnotationAdd(shapeAnnotations);
this.pdfViewer.annotationModule.storeAnnotations(pageNumber, annotationObject, '_annotations_shape');

@@ -133,2 +143,16 @@ }

*/
// tslint:disable-next-line
ShapeAnnotation.prototype.getSettings = function (annotation) {
var selector = this.pdfViewer.annotationSelectorSettings;
if (annotation.AnnotationSelectorSettings) {
selector = annotation.AnnotationSelectorSettings;
}
else {
selector = this.getSelector(annotation.ShapeAnnotationType, annotation.Subject);
}
return selector;
};
/**
* @private
*/
ShapeAnnotation.prototype.setAnnotationType = function (type) {

@@ -210,3 +234,3 @@ var date = new Date();

opacity: this.polygonOpacity, thickness: this.polygonThickness, borderDashArray: '0',
notes: '', author: author, subject: this.pdfViewer.lineSettings.subject,
notes: '', author: author, subject: this.pdfViewer.polygonSettings.subject,
modifiedDate: modifiedDatePolygon, borderStyle: ''

@@ -299,2 +323,3 @@ };

if (annotationBase.id === pageAnnotations[i].id) {
var date = new Date();
if (property === 'bounds') {

@@ -332,6 +357,5 @@ if (pageAnnotations[i].shapeAnnotationType === 'Line') {

}
// tslint:disable-next-line:max-line-length
// tslint:disable-next-line:max-line-length
pageAnnotations[i].labelBounds = { left: labelLeft, top: labelTop, width: labelWidth, height: labelHeight, right: 0, bottom: 0 };
}
var date = new Date();
pageAnnotations[i].modifiedDate = date.toLocaleString();

@@ -341,3 +365,2 @@ }

pageAnnotations[i].fillColor = annotationBase.wrapper.children[0].style.fill;
var date = new Date();
pageAnnotations[i].modifiedDate = date.toLocaleString();

@@ -347,3 +370,2 @@ }

pageAnnotations[i].strokeColor = annotationBase.wrapper.children[0].style.strokeColor;
var date = new Date();
pageAnnotations[i].modifiedDate = date.toLocaleString();

@@ -353,3 +375,2 @@ }

pageAnnotations[i].opacity = annotationBase.wrapper.children[0].style.opacity;
var date = new Date();
pageAnnotations[i].modifiedDate = date.toLocaleString();

@@ -359,3 +380,2 @@ }

pageAnnotations[i].thickness = annotationBase.wrapper.children[0].style.strokeWidth;
var date = new Date();
pageAnnotations[i].modifiedDate = date.toLocaleString();

@@ -366,3 +386,2 @@ }

pageAnnotations[i].borderStyle = annotationBase.borderStyle;
var date = new Date();
pageAnnotations[i].modifiedDate = date.toLocaleString();

@@ -373,3 +392,2 @@ }

pageAnnotations[i].lineHeadStart = this.pdfViewer.annotation.getArrowTypeForCollection(annotationBase.sourceDecoraterShapes);
var date = new Date();
pageAnnotations[i].modifiedDate = date.toLocaleString();

@@ -380,3 +398,2 @@ }

pageAnnotations[i].lineHeadEnd = this.pdfViewer.annotation.getArrowTypeForCollection(annotationBase.taregetDecoraterShapes);
var date = new Date();
pageAnnotations[i].modifiedDate = date.toLocaleString();

@@ -386,3 +403,2 @@ }

pageAnnotations[i].note = annotationBase.notes;
var date = new Date();
pageAnnotations[i].modifiedDate = date.toLocaleString();

@@ -397,3 +413,2 @@ }

pageAnnotations[i].labelContent = annotationBase.labelContent;
var date = new Date();
pageAnnotations[i].modifiedDate = date.toLocaleString();

@@ -404,3 +419,8 @@ break;

pageAnnotations[i].fontColor = annotationBase.fontColor;
pageAnnotations[i].modifiedDate = date.toLocaleString();
}
else if (property === 'fontSize') {
pageAnnotations[i].fontSize = annotationBase.fontSize;
pageAnnotations[i].modifiedDate = date.toLocaleString();
}
}

@@ -526,2 +546,3 @@ }

}
this.pdfViewer.annotation.stickyNotesAnnotationModule.addTextToComments(annotationName, annotationModel.notes);
// tslint:disable-next-line:radix

@@ -531,2 +552,4 @@ var borderDashArray = parseInt(annotationModel.borderDashArray);

var date = new Date();
// tslint:disable-next-line
var annotationSettings = this.pdfViewer.annotationModule.findAnnotationSettings(annotationModel, true);
return {

@@ -542,9 +565,30 @@ // tslint:disable-next-line:max-line-length

vertexPoints: annotationModel.vertexPoints, lineHeadStart: this.pdfViewer.annotation.getArrowTypeForCollection(annotationModel.sourceDecoraterShapes),
lineHeadEnd: this.pdfViewer.annotation.getArrowTypeForCollection(annotationModel.taregetDecoraterShapes), rectangleDifference: [], isLocked: false,
lineHeadEnd: this.pdfViewer.annotation.getArrowTypeForCollection(annotationModel.taregetDecoraterShapes), rectangleDifference: [], isLocked: annotationSettings.isLock,
// tslint:disable-next-line:max-line-length
labelContent: annotationModel.labelContent, enableShapeLabel: annotationModel.enableShapeLabel, labelFillColor: annotationModel.labelFillColor,
fontColor: annotationModel.fontColor, labelBorderColor: annotationModel.labelBorderColor, fontSize: annotationModel.fontSize,
labelBounds: labelBound
// tslint:disable-next-line:max-line-length
labelBounds: labelBound, annotationSelectorSettings: this.getSelector(annotationModel.shapeAnnotationType, annotationModel.subject), labelSettings: this.pdfViewer.shapeLabelSettings, annotationSettings: annotationSettings,
customData: this.pdfViewer.annotation.getShapeData(annotationModel.shapeAnnotationType, annotationModel.subject)
};
};
ShapeAnnotation.prototype.getSelector = function (type, subject) {
var selector = this.pdfViewer.annotationSelectorSettings;
if (type === 'Line' && subject !== 'Arrow' && this.pdfViewer.lineSettings.annotationSelectorSettings) {
selector = this.pdfViewer.lineSettings.annotationSelectorSettings;
}
else if ((type === 'LineWidthArrowHead' || subject === 'Arrow') && this.pdfViewer.lineSettings.annotationSelectorSettings) {
selector = this.pdfViewer.arrowSettings.annotationSelectorSettings;
}
else if ((type === 'Rectangle' || type === 'Square') && this.pdfViewer.rectangleSettings.annotationSelectorSettings) {
selector = this.pdfViewer.rectangleSettings.annotationSelectorSettings;
}
else if ((type === 'Ellipse' || type === 'Circle') && this.pdfViewer.circleSettings.annotationSelectorSettings) {
selector = this.pdfViewer.circleSettings.annotationSelectorSettings;
}
else if (type === 'Polygon' && this.pdfViewer.polygonSettings.annotationSelectorSettings) {
selector = this.pdfViewer.polygonSettings.annotationSelectorSettings;
}
return selector;
};
// tslint:disable-next-line

@@ -576,2 +620,5 @@ ShapeAnnotation.prototype.getAnnotations = function (pageIndex, shapeAnnotations) {

ShapeAnnotation.prototype.getRgbCode = function (colorString) {
if (!colorString.match(/#([a-z0-9]+)/gi) && !colorString.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/)) {
colorString = this.pdfViewer.annotationModule.nameToHash(colorString);
}
var stringArray = colorString.split(',');

@@ -616,4 +663,7 @@ if (isNullOrUndefined(stringArray[1])) {

annotation.FontSize = annotation.FontSize ? annotation.FontSize : 16;
annotation.LabelSettings = annotation.LabelSettings ? annotation.LabelSettings : this.pdfViewer.shapeLabelSettings;
}
// tslint:disable-next-line:max-line-length
annotation.AnnotationSettings = annotation.AnnotationSettings ? annotation.AnnotationSettings : this.pdfViewer.annotationModule.updateAnnotationSettings(annotation);
// tslint:disable-next-line:max-line-length
annotationObject = {

@@ -629,3 +679,5 @@ id: 'shape', shapeAnnotationType: annotation.ShapeAnnotationType, author: annotation.Author, modifiedDate: annotation.ModifiedDate, subject: annotation.Subject,

labelBorderColor: annotation.LabelBorderColor, fontColor: annotation.FontColor, fontSize: annotation.FontSize,
labelBounds: annotation.LabelBounds
// tslint:disable-next-line:max-line-length
labelBounds: annotation.LabelBounds, annotationSelectorSettings: this.getSettings(annotation), labelSettings: annotation.LabelSettings, annotationSettings: annotation.AnnotationSettings,
customData: this.pdfViewer.annotation.getCustomData(annotation)
};

@@ -657,4 +709,7 @@ this.pdfViewer.annotationModule.storeAnnotations(pageNumber, annotationObject, '_annotations_shape');

annotation.FontSize = annotation.FontSize ? annotation.FontSize : 16;
annotation.LabelSettings = annotation.LabelSettings ? annotation.LabelSettings : this.pdfViewer.shapeLabelSettings;
}
// tslint:disable-next-line:max-line-length
annotation.AnnotationSettings = annotation.AnnotationSettings ? annotation.AnnotationSettings : this.pdfViewer.annotationModule.updateAnnotationSettings(annotation);
// tslint:disable-next-line:max-line-length
annotationObject = {

@@ -670,3 +725,5 @@ id: 'shape', shapeAnnotationType: annotation.ShapeAnnotationType, author: annotation.Author, modifiedDate: annotation.ModifiedDate, subject: annotation.Subject,

labelBorderColor: annotation.LabelBorderColor, fontColor: annotation.FontColor, fontSize: annotation.FontSize,
labelBounds: annotation.LabelBounds, pageNumber: pageNumber
// tslint:disable-next-line:max-line-length
labelBounds: annotation.LabelBounds, pageNumber: pageNumber, labelSettings: annotation.LabelSettings, annotationSettings: annotation.AnnotationSettings,
customData: this.pdfViewer.annotation.getCustomData(annotation)
};

@@ -673,0 +730,0 @@ return annotationObject;

import { PdfAnnotationBase } from '../../diagram/pdf-annotation';
import { PdfViewer, PdfViewerBase, ICommentsCollection, IReviewCollection } from '../../index';
import { AnnotationSelectorSettingsModel } from '../pdfviewer-model';
/**

@@ -30,2 +31,5 @@ * @hidden

position?: string;
annotationSelectorSettings: AnnotationSelectorSettingsModel;
annotationSettings?: any;
customData: object;
}

@@ -90,2 +94,6 @@ interface IRectangles {

*/
getSettings(annotation: any): any;
/**
* @private
*/
resetAnnotation(): void;

@@ -129,3 +137,5 @@ /**

updateStampAnnotationCollections(annotation: any, pageNumber: number): any;
private findImageData;
private findDynamicText;
}
export {};
import { PdfViewerBase, PdfViewer } from '../index';
import { AnnotationSelectorSettingsModel } from '../pdfviewer-model';
/**

@@ -20,2 +21,5 @@ * @hidden

annotName: string;
annotationSelectorSettings: AnnotationSelectorSettingsModel;
customData: object;
annotationSettings: any;
}

@@ -91,2 +95,6 @@ /**

*/
isAnnotationRendered: boolean;
/**
* @private
*/
constructor(pdfViewer: PdfViewer, pdfViewerBase: PdfViewerBase);

@@ -100,2 +108,6 @@ /**

*/
getSettings(annotation: any): any;
/**
* @private
*/
drawStickyNotes(X: number, Y: number, width: number, height: number, pageIndex: number, annotation: any, canvas?: any): any;

@@ -107,2 +119,7 @@ private setImageSource;

createRequestForComments(): void;
/**
* @private
*/
updateAnnotationsInDocumentCollections(excistingAnnotation: any, newAnnotation: any): any;
private updateDocumentAnnotationCollections;
private renderAnnotationCollections;

@@ -109,0 +126,0 @@ /**

import { PdfViewer, PdfViewerBase, IRectangle, ICommentsCollection, IReviewCollection } from '../index';
import { ChangeEventArgs } from '@syncfusion/ej2-inputs';
import { AnnotationSelectorSettingsModel } from '../pdfviewer-model';
/**

@@ -25,2 +26,8 @@ * @hidden

textMarkupEndIndex: number;
annotationSelectorSettings: AnnotationSelectorSettingsModel;
customData: object;
isMultiSelect?: boolean;
annotNameCollection?: any[];
annotpageNumbers?: any[];
annotationAddMode: string;
}

@@ -76,2 +83,6 @@ /**

*/
annotationAddMode: string;
/**
* @private
*/
strikethroughOpacity: number;

@@ -104,7 +115,11 @@ /**

isLeftDropletClicked: boolean;
private isSelectionMaintained;
/**
* @private
*/
isSelectionMaintained: boolean;
private isExtended;
private isNewAnnotation;
private selectAnnotationCollection;
private selectedAnnotation;
private selectedTextMarkup;
private multiPageCollection;
private triggerAddEvent;
/**

@@ -114,5 +129,10 @@ * @private

isSelectedAnnotation: boolean;
private dropletHeight;
/**
* @private
*/
annotationClickPosition: object;
/**
* @private
*/
constructor(pdfViewer: PdfViewer, viewerBase: PdfViewerBase);

@@ -135,3 +155,5 @@ /**

showHideDropletDiv(hide: boolean): void;
private updateDropletStyles;
private updateAnnotationBounds;
private updateMultiAnnotBounds;
private retreieveSelection;

@@ -155,5 +177,20 @@ /**

*/
getSettings(annotation: any): any;
/**
* @private
*/
drawTextMarkupAnnotations(type: string): void;
private isMultiPageAnnotations;
private modifyCurrentAnnotation;
private drawAnnotationSelector;
private selectMultiPageAnnotations;
private deletMultiPageAnnotation;
private modifyMultiPageAnnotations;
private convertSelectionToTextMarkup;
private updateTextMarkupAnnotationBounds;
/**
* @private
*/
multiPageCollectionList(annotation: any): any;
private updateAnnotationNames;
private updateAnnotationContent;

@@ -246,5 +283,7 @@ private drawTextMarkups;

selectAnnotation(annotation: ITextMarkupAnnotation, canvas: HTMLElement, pageNumber?: number, event?: MouseEvent | TouchEvent): void;
/**
* @private
*/
updateCurrentResizerPosition(annotation?: any): void;
private drawAnnotationSelectRect;
private getAnnotationsUnderClickPoint;
private calculateAnnotationBounds;
/**

@@ -261,2 +300,3 @@ * @private

private getAddedAnnotation;
private getSelector;
private annotationDivSelect;

@@ -263,0 +303,0 @@ private getPageContext;

@@ -35,2 +35,3 @@ import { PdfViewer } from '../index';

private pdfViewer;
private retryCount;
/**

@@ -49,2 +50,3 @@ * Constructor for Ajax class

send(jsonObj: object): void;
private resendRequest;
private sendRequest;

@@ -51,0 +53,0 @@ private addExtraData;

@@ -30,2 +30,3 @@ /**

this.pdfViewer = pdfviewer;
this.retryCount = pdfviewer.retryCount;
}

@@ -46,7 +47,57 @@ /**

}
this.httpRequest.onreadystatechange = function () { _this.stateChange(_this); };
this.httpRequest.onreadystatechange = function () {
var isSkip = false;
// tslint:disable-next-line
var viewerBase = _this.pdfViewer.viewerBase;
if (viewerBase && viewerBase.isPasswordAvailable && viewerBase.passwordData === '') {
isSkip = true;
_this.retryCount = 0;
}
if (_this.retryCount > 0) {
isSkip = _this.resendRequest(_this, jsonObj);
}
if (!isSkip) {
_this.stateChange(_this);
}
};
this.httpRequest.onerror = function () { _this.error(_this); };
};
// tslint:disable-next-line
AjaxHandler.prototype.resendRequest = function (proxy, jsonObj) {
var isSkip = false;
var status = proxy.httpRequest.status;
var statusString = status.toString().split('')[0];
if (proxy.httpRequest.readyState === 4 && status === 200) {
// tslint:disable-next-line
var data = void 0;
if (this.responseType !== null) {
data = proxy.httpRequest.response;
}
else {
data = proxy.httpRequest.responseText;
}
if (data) {
if (typeof data !== 'object') {
try {
data = JSON.parse(data);
}
catch (error) {
// tslint:disable-next-line:max-line-length
if (data === 'Document stream does not exist in the cache' || data === 'Document Reference pointer does not exist in the cache') {
isSkip = true;
}
}
}
}
}
if (statusString === '5' || isSkip) {
isSkip = true;
this.retryCount--;
proxy.send(jsonObj);
}
return isSkip;
};
AjaxHandler.prototype.sendRequest = function (jsonObj) {
this.httpRequest.open(this.type, this.url, this.mode);
this.httpRequest.withCredentials = this.pdfViewer.ajaxRequestSettings.withCredentials;
this.httpRequest.setRequestHeader('Content-Type', this.contentType);

@@ -53,0 +104,0 @@ jsonObj = this.addExtraData(jsonObj);

@@ -33,3 +33,3 @@ import { createElement, Browser } from '@syncfusion/ej2-base';

ContextMenu.prototype.createContextMenu = function () {
this.contextMenuElement = createElement('ul', { id: this.pdfViewer.element.id + '_context_menu' });
this.contextMenuElement = createElement('ul', { id: this.pdfViewer.element.id + '_context_menu', className: 'e-pv-context-menu' });
this.pdfViewer.element.appendChild(this.contextMenuElement);

@@ -119,3 +119,5 @@ this.contextMenuObj = new Context({

if ((!args.event.target.classList.contains('e-pv-maintaincontent') && args.event.target.classList.contains('e-pv-text') || args.event.target.classList.contains('e-pv-text-layer'))) {
args.cancel = true;
if (this.pdfViewerBase.checkIsNormalText()) {
args.cancel = true;
}
// tslint:disable-next-line:max-line-length

@@ -146,3 +148,3 @@ }

}
else if (this.pdfViewerBase.isCalibrateAnnotationModule() && this.pdfViewer.annotationModule.measureAnnotationModule.currentAnnotationMode !== '') {
else if (this.pdfViewerBase.isCalibrateAnnotationModule() && this.pdfViewer.annotationModule.measureAnnotationModule.currentAnnotationMode) {
// tslint:disable-next-line:max-line-length

@@ -299,5 +301,7 @@ this.contextMenuObj.hideItems([this.pdfViewer.localeObj.getConstant('Highlight context'), this.pdfViewer.localeObj.getConstant('Underline context'), this.pdfViewer.localeObj.getConstant('Strikethrough context'), this.pdfViewer.localeObj.getConstant('Properties')]);

if (this.pdfViewer.annotation && this.pdfViewer.annotation.textMarkupAnnotationModule) {
this.pdfViewer.annotation.textMarkupAnnotationModule.isSelectionMaintained = false;
this.pdfViewer.annotation.textMarkupAnnotationModule.drawTextMarkupAnnotations('Highlight');
this.pdfViewer.annotation.textMarkupAnnotationModule.isTextMarkupAnnotationMode = false;
this.pdfViewer.annotation.textMarkupAnnotationModule.currentTextMarkupAddMode = '';
this.pdfViewer.annotation.textMarkupAnnotationModule.isSelectionMaintained = true;
}

@@ -307,5 +311,7 @@ break;

if (this.pdfViewer.annotation && this.pdfViewer.annotation.textMarkupAnnotationModule) {
this.pdfViewer.annotation.textMarkupAnnotationModule.isSelectionMaintained = false;
this.pdfViewer.annotation.textMarkupAnnotationModule.drawTextMarkupAnnotations('Underline');
this.pdfViewer.annotation.textMarkupAnnotationModule.isTextMarkupAnnotationMode = false;
this.pdfViewer.annotation.textMarkupAnnotationModule.currentTextMarkupAddMode = '';
this.pdfViewer.annotation.textMarkupAnnotationModule.isSelectionMaintained = true;
}

@@ -315,5 +321,7 @@ break;

if (this.pdfViewer.annotation && this.pdfViewer.annotation.textMarkupAnnotationModule) {
this.pdfViewer.annotation.textMarkupAnnotationModule.isSelectionMaintained = false;
this.pdfViewer.annotation.textMarkupAnnotationModule.drawTextMarkupAnnotations('Strikethrough');
this.pdfViewer.annotation.textMarkupAnnotationModule.isTextMarkupAnnotationMode = false;
this.pdfViewer.annotation.textMarkupAnnotationModule.currentTextMarkupAddMode = '';
this.pdfViewer.annotation.textMarkupAnnotationModule.isSelectionMaintained = true;
}

@@ -320,0 +328,0 @@ break;

import { BaseEventArgs } from '@syncfusion/ej2-base';
import { AnnotationType } from './index';
import { ShapeLabelSettingsModel, DocumentTextCollectionSettingsModel } from '../pdfviewer-model';
/**

@@ -14,2 +15,6 @@ * Exports types used by PDF viewer.

documentName: string;
/**
* Defines the page details and page count of the PDF document.
*/
pageData: any;
}

@@ -64,2 +69,19 @@ /**

/**
* This event arguments provides the necessary information about form validation.
*/
export interface ValidateFormFieldsArgs extends BaseEventArgs {
/**
* The form fields object from PDF document being loaded.
*/
formField: any;
/**
* Document name to be loaded into PdfViewer
*/
documentName: string;
/**
* Defines the non-fillable form fields.
*/
nonFillableFields: any;
}
/**
* This event arguments provides the necessary information about page click event.

@@ -173,2 +195,10 @@ */

textMarkupEndIndex?: number;
/**
* End index of text markup annotation in the page text content.
*/
labelSettings?: ShapeLabelSettingsModel;
/**
* Defines the multi page annotation collections.
*/
multiplePageCollection?: any;
}

@@ -207,2 +237,6 @@ /**

textMarkupEndIndex?: number;
/**
* Defines the multi page annotation collections.
*/
multiplePageCollection?: any;
}

@@ -273,2 +307,6 @@ /**

textMarkupEndIndex?: number;
/**
* Defines the multi page annotation collections.
*/
multiplePageCollection?: any;
}

@@ -311,2 +349,10 @@ /**

textMarkupEndIndex?: number;
/**
* End index of text markup annotation in the page text content.
*/
labelSettings?: ShapeLabelSettingsModel;
/**
* Defines the multiple page annotation collections.
*/
multiplePageCollection?: any;
}

@@ -343,2 +389,221 @@ /**

/**
* This event arguments provides the necessary information about signature add event.
*/
export interface AddSignatureEventArgs extends BaseEventArgs {
/**
* Defines the bounds of the signature added in the page of the PDF document.
*/
bounds: any;
/**
* Defines the id of the signature added in the page of the PDF document.
*/
id: string;
/**
* Defines the page number in which the signature is added.
*/
pageIndex: number;
/**
* Define the type of the signature added in the page of the PDF document.
*/
type: AnnotationType;
/**
* Define the opacity of the signature added in the page of the PDF document.
*/
opacity: number;
/**
* Define the stroke color of the signature added in the page of the PDF document.
*/
strokeColor: string;
/**
* Define the thickness of the signature added in the page of the PDF document.
*/
thickness: number;
}
/**
* This event arguments provides the necessary information about signature remove event.
*/
export interface RemoveSignatureEventArgs extends BaseEventArgs {
/**
* Defines the bounds of the signature removed in the page of the PDF document.
*/
bounds: any;
/**
* Defines the id of the signature removed in the page of the PDF document.
*/
id: string;
/**
* Defines the page number in which the signature is removed.
*/
pageIndex: number;
/**
* Define the type of the signature removed in the page of the PDF document.
*/
type: AnnotationType;
}
/**
* This event arguments provides the necessary information about signature move event.
*/
export interface MoveSignatureEventArgs extends BaseEventArgs {
/**
* Defines the id of the annotation moved in the page of the PDF document.
*/
id: string;
/**
* Defines the page number in which the annotation is moved.
*/
pageIndex: number;
/**
* Defines the type of the signature moved in the page of the PDF document.
*/
type: AnnotationType;
/**
* Define the opacity of the signature added in the page of the PDF document.
*/
opacity: number;
/**
* Define the stroke color of the signature added in the page of the PDF document.
*/
strokeColor: string;
/**
* Define the thickness of the signature added in the page of the PDF document.
*/
thickness: number;
/**
* Previous position of signature in the page text content.
*/
previousPosition: object;
/**
* Current position of signature in the page text content.
*/
currentPosition: object;
}
/**
* This event arguments provides the necessary information about signature properties change event.
*/
export interface SignaturePropertiesChangeEventArgs extends BaseEventArgs {
/**
* Defines the id of the signature property is changed in the page of the PDF document.
*/
id: string;
/**
* Defines the page number in which the signature property is changed.
*/
pageIndex: number;
/**
* Defines the type of the signature property is changed in the page of the PDF document.
*/
type: AnnotationType;
/**
* Specifies that the stroke color of the signature is changed.
*/
isStrokeColorChanged?: boolean;
/**
* Specifies that the opacity of the signature is changed.
*/
isOpacityChanged: boolean;
/**
* Specifies that the thickness of the signature is changed.
*/
isThicknessChanged?: boolean;
/**
* Defines the old property value of the signature.
*/
oldValue: any;
/**
* Defines the new property value of the signature.
*/
newValue: any;
}
/**
* This event arguments provides the necessary information about signature resize event.
*/
export interface ResizeSignatureEventArgs extends BaseEventArgs {
/**
* Defines the id of the signature added in the page of the PDF document.
*/
id: string;
/**
* Defines the page number in which the signature is added.
*/
pageIndex: number;
/**
* Define the type of the signature added in the page of the PDF document.
*/
type: AnnotationType;
/**
* Define the opacity of the signature added in the page of the PDF document.
*/
opacity: number;
/**
* Define the stroke color of the signature added in the page of the PDF document.
*/
strokeColor: string;
/**
* Define the thickness of the signature added in the page of the PDF document.
*/
thickness: number;
/**
* Defines the current Position of the signature added in the page of the PDF document.
*/
currentPosition: any;
/**
* Defines the previous position of the signature added in the page of the PDF document.
*/
previousPosition: any;
}
/**
* This event arguments provides the necessary information about annotation mouseover event.
*/
export interface AnnotationMouseoverEventArgs extends BaseEventArgs {
/**
* Defines the id of the mouse over annotation object in the page of the PDF document
*/
annotationId: string;
/**
* Defines the page number in which the mouse over annotation object is rendered.
*/
pageIndex: number;
/**
* Defines the type of the annotation during the mouse hover in the PDF document.
*/
annotationType: AnnotationType;
/**
* Defines the annotation object mouse hover in the PDF document.
*/
annotation: any;
/**
* Defines the bounds of the annotation resized in the page of the PDF document.
*/
annotationBounds: any;
/**
* Defines the mouseover x position with respect to page container.
*/
pageX: number;
/**
* Defines the mouseover y position with respect to page container.
*/
pageY: number;
/**
* Defines the mouseover x position with respect to viewer container.
*/
X: number;
/**
* Defines the mouseover y position with respect to viewer container.
*/
Y: number;
}
/**
* This event arguments provides the necessary information about page mouseovers event.
*/
export interface PageMouseoverEventArgs extends BaseEventArgs {
/**
* Mouseover x position with respect to page container.
*/
pageX: number;
/**
* Mouseover y position with respect to page container.
*/
pageY: number;
}
/**
* This event arguments provides the necessary information about annotation select event.

@@ -363,4 +628,33 @@ */

annotationCollection?: any;
/**
* Defines the multi page annotation collections.
*/
multiplePageCollection?: any;
/**
* Defines the annotation selection by mouse.
*/
isProgrammaticSelection?: boolean;
/**
* Defines the annotation add mode.
*/
annotationAddMode?: string;
}
/**
* This event arguments provides the necessary information about annotation double click event.
*/
export interface AnnotationDoubleClickEventArgs extends BaseEventArgs {
/**
* Defines the id of the annotation double clicked in the page of the PDF document.
*/
annotationId: string;
/**
* Defines the page number in which the annotation is double clicked.
*/
pageIndex: number;
/**
* Defines the annotation double clicked in the PDF document.
*/
annotation: any;
}
/**
* This event arguments provides the necessary information about thumbnail click event.

@@ -467,2 +761,11 @@ */

/**
* This event arguments provides the necessary information about text extraction completed in the PDF Viewer.
*/
export interface ExtractTextCompletedEventArgs extends BaseEventArgs {
/**
* Returns the extracted text collection
*/
documentTextCollection: DocumentTextCollectionSettingsModel[][];
}
/**
* This event arguments provides the necessary information about data.

@@ -469,0 +772,0 @@ */

@@ -22,3 +22,2 @@ import { PdfViewer } from '../index';

private offset;
private sideBarTitle;
private contentContainerScrollWidth;

@@ -41,2 +40,6 @@ private closeButtonLeft;

*/
sideBarTitle: HTMLElement;
/**
* @private
*/
annotationMenuObj: Context;

@@ -142,2 +145,3 @@ /**

createTooltipMobile(text: string): void;
private createMobileTooltip;
private onTooltipClose;

@@ -197,6 +201,9 @@ /**

updateViewerContainerOnClose(): void;
private updateViewerContainerOnExpand;
/**
* @private
*/
updateViewerContainerOnExpand(): void;
/**
* @private
*/
getViewerContainerLeft(): number;

@@ -216,3 +223,6 @@ /**

openThumbnailPane: () => void;
private setThumbnailSelectionIconTheme;
/**
* @private
*/
setThumbnailSelectionIconTheme(): void;
private removeThumbnailSelectionIconTheme;

@@ -219,0 +229,0 @@ private resetThumbnailIcon;

@@ -249,3 +249,5 @@ import { createElement, Browser } from '@syncfusion/ej2-base';

var proxy = _this;
document.getElementById(_this.pdfViewer.element.id + '_thumbnail_view').style.display = 'none';
if (document.getElementById(_this.pdfViewer.element.id + '_thumbnail_view')) {
document.getElementById(_this.pdfViewer.element.id + '_thumbnail_view').style.display = 'none';
}
_this.removeThumbnailSelectionIconTheme();

@@ -485,2 +487,3 @@ _this.sideBarTitle.textContent = _this.pdfViewer.localeObj.getConstant('Bookmarks');

var annotationButton = createElement('button', { id: this.pdfViewer.element.id + '_annotations_btn' });
annotationButton.setAttribute('aria-label', 'annotation button');
annotationButton.className = 'e-btn e-pv-tbar-btn e-pv-comment-panel-title-close-div e-btn';

@@ -550,3 +553,3 @@ // tslint:disable-next-line:max-line-length

// tslint:disable-next-line:max-line-length
this.annotationInputElement = createElement('input', { id: this.pdfViewer.element.id + '_annotationUploadElement', styles: 'position:fixed; left:-100em', attrs: { 'type': 'file' } });
this.annotationInputElement = createElement('input', { id: this.pdfViewer.element.id + '_annotationUploadElement', styles: 'position:fixed; left:-100em', attrs: { 'type': 'file', 'aria-label': 'upload elements' } });
this.annotationInputElement.setAttribute('accept', '.json');

@@ -646,2 +649,3 @@ toolbarElement.appendChild(this.annotationInputElement);

}
this.toolbar.isStringTemplate = true;
this.toolbar.appendTo(this.toolbarElement);

@@ -748,17 +752,5 @@ if (option === 'search') {

NavigationPane.prototype.createTooltipMobile = function (text) {
if (!this.isTooltipCreated) { //boolean to prevent again toast creation.
// tslint:disable-next-line:max-line-length
var tooltipDiv = createElement('div', { className: 'e-pv-container-tooltip', id: this.pdfViewer.element.id + '_container_tooltip' });
this.pdfViewer.element.appendChild(tooltipDiv);
// tslint:disable-next-line:max-line-length
this.toastObject = new Toast({ title: text, target: this.pdfViewer.element, close: this.onTooltipClose.bind(this), position: { X: 0, Y: 0 }, animation: { hide: { duration: 200, effect: 'FadeOut' } } });
this.toastObject.appendTo(tooltipDiv);
var y = this.pdfViewer.element.clientHeight * 0.65;
var x = (this.pdfViewer.element.clientWidth - tooltipDiv.clientWidth) / 2;
this.isTooltipCreated = true;
this.toastObject.show({ position: { X: x, Y: y } });
var tooltipChild = tooltipDiv.firstElementChild;
if (tooltipChild) {
tooltipChild.style.width = 'auto';
}
if (!this.isTooltipCreated) {
//boolean to prevent again toast creation.
this.createMobileTooltip(text);
}

@@ -774,12 +766,42 @@ else {

}
else {
this.isTooltipCreated = false;
var tooltipElement_1 = this.pdfViewerBase.getElement('_container_tooltip');
if (this.toastObject) {
this.toastObject.destroy();
}
tooltipElement_1.parentElement.removeChild(tooltipElement_1);
this.toastObject = null;
this.createMobileTooltip(text);
}
}
}
};
NavigationPane.prototype.createMobileTooltip = function (text) {
// tslint:disable-next-line:max-line-length
var tooltipDiv = createElement('div', { className: 'e-pv-container-tooltip', id: this.pdfViewer.element.id + '_container_tooltip' });
this.pdfViewer.element.appendChild(tooltipDiv);
// tslint:disable-next-line:max-line-length
this.toastObject = new Toast({ title: text, target: this.pdfViewer.element, close: this.onTooltipClose.bind(this), position: { X: 0, Y: 0 }, animation: { hide: { duration: 200, effect: 'FadeOut' } } });
this.toastObject.appendTo(tooltipDiv);
var y = this.pdfViewer.element.clientHeight * 0.65;
var x = (this.pdfViewer.element.clientWidth - tooltipDiv.clientWidth) / 2;
this.isTooltipCreated = true;
this.toastObject.show({ position: { X: x, Y: y } });
var tooltipChild = tooltipDiv.firstElementChild;
if (tooltipChild) {
tooltipChild.style.width = 'auto';
}
};
NavigationPane.prototype.onTooltipClose = function (args) {
this.isTooltipCreated = false;
var tooltipElement = this.pdfViewerBase.getElement('_container_tooltip');
this.pdfViewer.textSearchModule.isMessagePopupOpened = false;
this.toastObject.destroy();
tooltipElement.parentElement.removeChild(tooltipElement);
this.toastObject = null;
if (this.pdfViewer.textSearchModule) {
this.isTooltipCreated = false;
var tooltipElement = this.pdfViewerBase.getElement('_container_tooltip');
this.pdfViewer.textSearchModule.isMessagePopupOpened = false;
if (this.toastObject) {
this.toastObject.destroy();
}
tooltipElement.parentElement.removeChild(tooltipElement);
this.toastObject = null;
}
};

@@ -846,2 +868,3 @@ /**

this.closeDiv = createElement('button', { id: this.pdfViewer.element.id + '_close_btn' });
this.closeDiv.setAttribute('aria-label', 'close button');
this.closeDiv.className = 'e-btn e-pv-tbar-btn e-pv-title-close-div e-btn';

@@ -973,2 +996,5 @@ if (this.pdfViewer.enableRtl) {

};
/**
* @private
*/
NavigationPane.prototype.updateViewerContainerOnExpand = function () {

@@ -1011,2 +1037,5 @@ var proxy = this;

};
/**
* @private
*/
NavigationPane.prototype.setThumbnailSelectionIconTheme = function () {

@@ -1013,0 +1042,0 @@ if (this.thumbnailButton) {

@@ -37,2 +37,3 @@ import { PdfViewer, TextLayer, ContextMenu, Signature } from '../index';

freeTextAnnotation: object;
signatureAnnotation?: object;
}

@@ -129,3 +130,6 @@ /**

private goToPagePopup;
private isPasswordAvailable;
/**
* @private
*/
isPasswordAvailable: boolean;
private document;

@@ -135,2 +139,6 @@ /**

*/
passwordData: string;
/**
* @private
*/
reRenderedCount: number;

@@ -286,6 +294,9 @@ private passwordInput;

isDynamicStamp: boolean;
private isMixedSizeDocument;
/**
* @private
*/
isMixedSizeDocument: boolean;
/**
* @private
*/
customStampCollection: ICustomStampItems[];

@@ -368,2 +379,39 @@ /**

downloadCollections: any;
/**
* @private
*/
isAnnotationAdded: boolean;
/**
* @private
*/
annotationEvent: any;
private isAnnotationDrawn;
/**
* @private
*/
isAnnotationSelect: boolean;
/**
* @private
*/
isAnnotationMouseDown: boolean;
/**
* @private
*/
isAnnotationMouseMove: boolean;
/**
* @private
*/
validateForm: boolean;
/**
* @private
*/
isMinimumZoom: boolean;
/**
* @private
*/
documentLoaded: boolean;
/**
* @private
*/
highestWidth: number;
constructor(viewer: PdfViewer);

@@ -380,2 +428,6 @@ /**

private mobileScrollContainerDown;
/**
* @private
*/
relativePosition(e: MouseEvent): PointModel;
private setMaximumHeight;

@@ -509,2 +561,7 @@ /**

private viewerContainerOnMousedown;
private checkIsRtlText;
/**
* @private
*/
checkIsNormalText(): boolean;
private viewerContainerOnMouseup;

@@ -553,2 +610,3 @@ private viewerContainerOnMouseWheel;

private tileRenderPage;
private calculateImageWidth;
private renderPage;

@@ -570,2 +628,6 @@ private onPageRender;

*/
applyElementStyles(pageCanvas: any, pageNumber: number): void;
/**
* @private
*/
updateLeftPosition(pageIndex: number): number;

@@ -584,2 +646,3 @@ /**

pageViewScrollChanged(currentPageNumber: number): void;
private renderPreviousPagesInScroll;
private downloadDocument;

@@ -590,3 +653,3 @@ private downloadExportAnnotationJson;

*/
exportFormFields(): void;
exportFormFields(path?: string): void;
/**

@@ -599,3 +662,3 @@ * @private

*/
createRequestForExportFormfields(isObject?: boolean): any;
createRequestForExportFormfields(isObject?: boolean, path?: string): any;
/**

@@ -605,3 +668,6 @@ * @private

createRequestForImportingFormfields(source: any): void;
private createFormfieldsJsonData;
/**
* @public
*/
createFormfieldsJsonData(): any;
private constructJsonDownload;

@@ -637,2 +703,3 @@ /**

private getWindowSessionStorageTile;
private retrieveCurrentZoomFactor;
private manageSessionStorage;

@@ -773,2 +840,3 @@ private createBlobUrl;

private drawPageAnnotations;
private checkSignatureCollections;
private checkAnnotationCollections;

@@ -796,3 +864,7 @@ private checkAnnotationCommentsCollections;

deleteAnnotations(): void;
/**
* @private
*/
createAnnotationsCollection(): any;
}
export {};

@@ -16,2 +16,3 @@ import { PdfViewer } from '../index';

data: string;
signatureName: string;
}

@@ -86,2 +87,6 @@ /**

*/
renderExistingSignature(annotationCollection: any, pageIndex: number, isImport: boolean): void;
/**
* @private
*/
storeSignatureData(pageNumber: number, annotations: any): void;

@@ -105,4 +110,8 @@ /**

*/
ConvertPointToPixel(number: any): any;
/**
* @private
*/
destroy(): void;
}
export {};
import { createElement, isNullOrUndefined } from '@syncfusion/ej2-base';
import { Dialog } from '@syncfusion/ej2-popups';
import { splitArrayCollection, processPathData } from '@syncfusion/ej2-drawings';
import { splitArrayCollection, processPathData, getPathString } from '@syncfusion/ej2-drawings';
import { ColorPicker } from '@syncfusion/ej2-inputs';

@@ -65,2 +65,3 @@ /**

if (this.pdfViewerBase.isToolbarSignClicked) {
var annotationName = this.pdfViewer.annotation.createGUID();
this.pdfViewerBase.currentSignatureAnnot = null;

@@ -88,3 +89,3 @@ this.pdfViewerBase.isSignatureAdded = true;

id: 'sign' + this.pdfViewerBase.signatureCount, bounds: { x: currentLeft, y: currentTop, width: currentWidth, height: currentHeight }, pageIndex: pageIndex, data: this.outputString,
shapeAnnotationType: 'HandWrittenSignature', opacity: opacity, strokeColor: strokeColor, thickness: thickness,
shapeAnnotationType: 'HandWrittenSignature', opacity: opacity, strokeColor: strokeColor, thickness: thickness, signatureName: annotationName,
};

@@ -329,2 +330,3 @@ this.hideSignaturePanel();

var currentAnnotation = this.pdfViewerBase.currentSignatureAnnot;
var annotationName = this.pdfViewer.annotation.createGUID();
if (currentAnnotation) {

@@ -334,3 +336,3 @@ annot = {

id: currentAnnotation.id, bounds: { x: left, y: top, width: currentAnnotation.bounds.width, height: currentAnnotation.bounds.height }, pageIndex: currentAnnotation.pageIndex, data: currentAnnotation.data,
shapeAnnotationType: 'HandWrittenSignature', opacity: currentAnnotation.opacity, strokeColor: currentAnnotation.strokeColor, thickness: currentAnnotation.thickness,
shapeAnnotationType: 'HandWrittenSignature', opacity: currentAnnotation.opacity, strokeColor: currentAnnotation.strokeColor, thickness: currentAnnotation.thickness, signatureName: annotationName,
};

@@ -351,2 +353,45 @@ this.pdfViewer.add(annot);

// tslint:disable-next-line
Signature.prototype.renderExistingSignature = function (annotationCollection, pageIndex, isImport) {
var annot;
for (var n = 0; n < annotationCollection.length; n++) {
// tslint:disable-next-line
var currentAnnotation = annotationCollection[n];
//tslint:disable-next-line
if (currentAnnotation) {
// tslint:disable-next-line
var bounds = currentAnnotation.Bounds;
var currentLeft = this.ConvertPointToPixel(bounds.X);
var currentTop = this.ConvertPointToPixel(bounds.Y);
var currentWidth = this.ConvertPointToPixel(bounds.Width);
var currentHeight = this.ConvertPointToPixel(bounds.Height);
// tslint:disable-next-line
var data = currentAnnotation.PathData;
if (isImport) {
data = getPathString(JSON.parse(currentAnnotation.PathData));
}
annot = {
// tslint:disable-next-line:max-line-length
id: 'sign' + this.pdfViewerBase.signatureCount, bounds: { x: currentLeft, y: currentTop, width: currentWidth, height: currentHeight }, pageIndex: pageIndex, data: data,
shapeAnnotationType: 'HandWrittenSignature', opacity: currentAnnotation.Opacity, strokeColor: currentAnnotation.StrokeColor, thickness: currentAnnotation.Thickness, signatureName: currentAnnotation.SignatureName,
};
this.pdfViewer.add(annot);
// tslint:disable-next-line
var canvass = document.getElementById(this.pdfViewer.element.id + '_annotationCanvas_' + currentAnnotation.pageIndex);
// tslint:disable-next-line
this.pdfViewer.renderDrawing(canvass, annot.pageIndex);
this.storeSignatureData(annot.pageIndex, annot);
this.pdfViewerBase.currentSignatureAnnot = null;
this.pdfViewerBase.signatureCount++;
// tslint:disable-next-line:max-line-length
if (this.pdfViewerBase.navigationPane && this.pdfViewerBase.navigationPane.annotationMenuObj && this.pdfViewer.isSignatureEditable) {
// tslint:disable-next-line:max-line-length
this.pdfViewerBase.navigationPane.annotationMenuObj.enableItems([this.pdfViewer.localeObj.getConstant('Export Annotations')], true);
}
}
}
};
/**
* @private
*/
// tslint:disable-next-line
Signature.prototype.storeSignatureData = function (pageNumber, annotations) {

@@ -364,3 +409,3 @@ // tslint:disable-next-line:max-line-length

// tslint:disable-next-line:max-line-length
id: annotations.id, bounds: { left: left, top: top, width: annotations.bounds.width, height: annotations.bounds.height }, shapeAnnotationType: 'Signature', opacity: annotations.opacity, thickness: annotations.thickness, strokeColor: annotations.strokeColor, pageIndex: annotations.pageIndex, data: annotations.data
id: annotations.id, bounds: { left: left, top: top, width: annotations.bounds.width, height: annotations.bounds.height }, shapeAnnotationType: 'Signature', opacity: annotations.opacity, thickness: annotations.thickness, strokeColor: annotations.strokeColor, pageIndex: annotations.pageIndex, data: annotations.data, signatureName: annotations.signatureName,
};

@@ -487,2 +532,9 @@ // tslint:disable-next-line

*/
// tslint:disable-next-line
Signature.prototype.ConvertPointToPixel = function (number) {
return (number * (96 / 72));
};
/**
* @private
*/
Signature.prototype.destroy = function () {

@@ -489,0 +541,0 @@ window.sessionStorage.removeItem('_annotations_sign');

@@ -38,2 +38,3 @@ import { createElement, isNullOrUndefined, Browser } from '@syncfusion/ej2-base';

}
this.pdfViewerBase.applyElementStyles(textLayer, pageNumber);
return textLayer;

@@ -55,5 +56,3 @@ };

var textContent = textContents[i];
textContent = textContent.replace(/</g, '&lt;');
textContent = textContent.replace(/>/g, '&gt;');
textDiv.innerHTML = textContent.replace(/&nbsp;/g, ' ');
textDiv.textContent = textContent.replace(/&nbsp;/g, ' ');
// tslint:disable-next-line

@@ -134,3 +133,3 @@ var newLine = textContents[i].replace(/ +/g, ' ');

TextLayer.prototype.applyTextRotation = function (scale, textDiv, rotation, textRotation) {
var scaleString = 'scale(' + scale + ')';
var scaleString = 'scaleX(' + scale + ')';
if (rotation === 0) {

@@ -321,31 +320,33 @@ if (textRotation === 0) {

var length_1 = void 0;
length_1 = textDiv.textContent.length;
var textContent = textDiv.textContent;
textDiv.textContent = '';
if (j === startId) {
if (i === startPage) {
initId = anchorOffset;
if (textDiv.textContent) {
length_1 = textDiv.textContent.length;
var textContent = textDiv.textContent;
textDiv.textContent = '';
if (j === startId) {
if (i === startPage) {
initId = anchorOffset;
}
else {
initId = 0;
}
lastId = length_1;
this.convertToSpan(i, j, 0, initId, textContent, null);
}
else if (j === endId && i === endPage) {
initId = 0;
lastId = focusOffset;
}
else {
initId = 0;
lastId = length_1;
}
lastId = length_1;
this.convertToSpan(i, j, 0, initId, textContent, null);
if (startId === endId && startPage === endPage) {
initId = anchorOffset;
lastId = focusOffset;
}
this.convertToSpan(i, j, initId, lastId, textContent, 'e-pv-maintaincontent');
if (j === endId && i === endPage) {
this.convertToSpan(i, j, lastId, textContent.length, textContent, null);
}
}
else if (j === endId && i === endPage) {
initId = 0;
lastId = focusOffset;
}
else {
initId = 0;
lastId = length_1;
}
if (startId === endId) {
initId = anchorOffset;
lastId = focusOffset;
}
this.convertToSpan(i, j, initId, lastId, textContent, 'e-pv-maintaincontent');
if (j === endId && i === endPage) {
this.convertToSpan(i, j, lastId, textContent.length, textContent, null);
}
}

@@ -499,3 +500,10 @@ }

_this.notifyDialog.destroy();
_this.pdfViewer.element.removeChild(popupElement_1);
if (_this.pdfViewer.element) {
try {
_this.pdfViewer.element.removeChild(popupElement_1);
}
catch (error) {
popupElement_1.parentElement.removeChild(popupElement_1);
}
}
if (_this.pdfViewer.textSearchModule) {

@@ -502,0 +510,0 @@ _this.pdfViewer.textSearch.isMessagePopupOpened = false;

@@ -28,3 +28,3 @@ /**

*/
export declare type CalibrationUnit = 'pt' | 'in' | 'mm' | 'cm' | 'p' | 'ft';
export declare type CalibrationUnit = 'pt' | 'in' | 'mm' | 'cm' | 'p' | 'ft' | 'ft_in' | 'm';
/**

@@ -63,1 +63,27 @@ * Enum unit for ContextMenu Actions

export declare type ZoomMode = 'Default' | 'FitToWidth' | 'FitToPage';
/**
* Enum for Print Mode
*/
export declare type PrintMode = 'Default' | 'NewWindow';
/**
* Enum for cursor type
*/
export declare enum CursorType {
auto = "auto",
crossHair = "crosshair",
e_resize = "e-resize",
ew_resize = "ew-resize",
grab = "grab",
grabbing = "grabbing",
move = "move",
n_resize = "n-resize",
ne_resize = "ne-resize",
ns_resize = "ns-resize",
nw_resize = "nw-resize",
pointer = "pointer",
s_resize = "s-resize",
se_resize = "se-resize",
sw_resize = "sw-resize",
text = "text",
w_resize = "w-resize"
}

@@ -20,1 +20,24 @@ /**

})(AnnotationResizerLocation || (AnnotationResizerLocation = {}));
/**
* Enum for cursor type
*/
export var CursorType;
(function (CursorType) {
CursorType["auto"] = "auto";
CursorType["crossHair"] = "crosshair";
CursorType["e_resize"] = "e-resize";
CursorType["ew_resize"] = "ew-resize";
CursorType["grab"] = "grab";
CursorType["grabbing"] = "grabbing";
CursorType["move"] = "move";
CursorType["n_resize"] = "n-resize";
CursorType["ne_resize"] = "ne-resize";
CursorType["ns_resize"] = "ns-resize";
CursorType["nw_resize"] = "nw-resize";
CursorType["pointer"] = "pointer";
CursorType["s_resize"] = "s-resize";
CursorType["se_resize"] = "se-resize";
CursorType["sw_resize"] = "sw-resize";
CursorType["text"] = "text";
CursorType["w_resize"] = "w-resize";
})(CursorType || (CursorType = {}));

@@ -146,5 +146,9 @@ import { createElement, Browser } from '@syncfusion/ej2-base';

this.treeObj.appendTo(this.bookmarkView);
['mouseover', 'keydown'].forEach(function (evt) { return _this.bookmarkView.addEventListener(evt, function (event) {
_this.setHeight(event.target);
}); });
// tslint:disable-next-line
var event_1 = ['mouseover', 'keydown'];
for (var m = 0; m < event_1.length; m++) {
this.bookmarkView.addEventListener(event_1[m], function (event) {
_this.setHeight(event.target);
});
}
this.isBookmarkViewDiv = true;

@@ -151,0 +155,0 @@ }

@@ -19,2 +19,6 @@ import { PdfViewer } from '../index';

*/
nonFillableFields: any;
/**
* @private
*/
constructor(viewer: PdfViewer, base: PdfViewerBase);

@@ -49,2 +53,7 @@ /**

private checkIsReadonly;
/**
* @private
*/
formFieldsReadOnly(isReadonly: boolean): void;
private makeformFieldsReadonly;
private applyTabIndex;

@@ -51,0 +60,0 @@ private checkIsRequiredField;

@@ -17,2 +17,7 @@ import { Browser } from '@syncfusion/ej2-base';

this.isSignatureField = false;
/**
* @private
*/
// tslint:disable-next-line
this.nonFillableFields = {};
this.pdfViewer = viewer;

@@ -84,11 +89,35 @@ this.pdfViewerBase = base;

if (currentData.Name === 'Textbox' || currentData.Name === 'Password' || currentData.Multiline) {
if (currentData.Text === '' || currentData.Text === null) {
this.pdfViewerBase.validateForm = true;
this.nonFillableFields[currentData.FieldName] = currentData.Text;
}
else {
delete (this.nonFillableFields[currentData.FieldName]);
}
datas[currentData.FieldName] = currentData.Text;
}
else if (currentData.Name === 'RadioButton' && currentData.Selected) {
if (currentData.Selected === false) {
this.pdfViewerBase.validateForm = true;
this.nonFillableFields[currentData.GroupName] = currentData.Value;
}
else {
delete (this.nonFillableFields[currentData.GroupName]);
}
datas[currentData.GroupName] = currentData.Value;
}
else if (currentData.Name === 'CheckBox') {
if (currentData.Selected === false) {
this.pdfViewerBase.validateForm = true;
}
datas[currentData.GroupName] = currentData.Selected;
}
else if (currentData.Name === 'DropDown') {
if (currentData.SelectedValue === '') {
this.pdfViewerBase.validateForm = true;
this.nonFillableFields[currentData.Text] = currentData.SelectedValue;
}
else {
delete (this.nonFillableFields[currentData.Text]);
}
datas[currentData.Text] = currentData.SelectedValue;

@@ -112,2 +141,9 @@ }

var csData = splitArrayCollection(collectionData);
if (currentData.Value === null || currentData.Value === '') {
this.pdfViewerBase.validateForm = true;
this.nonFillableFields[currentData.FieldName] = JSON.stringify(csData);
}
else {
delete (this.nonFillableFields[currentData.FieldName]);
}
datas[currentData.FieldName] = JSON.stringify(csData);

@@ -423,3 +459,3 @@ }

FormFields.prototype.checkIsReadonly = function (data, inputField) {
if (data.IsReadonly) {
if (data.IsReadonly || (!this.pdfViewer.enableFormFields)) {
inputField.disabled = true;

@@ -436,3 +472,32 @@ inputField.style.cursor = 'default';

};
/**
* @private
*/
// tslint:disable-next-line:max-line-length
FormFields.prototype.formFieldsReadOnly = function (isReadonly) {
// tslint:disable-next-line
var formFields = document.getElementsByClassName('e-pdfviewer-formFields');
this.makeformFieldsReadonly(formFields, isReadonly);
// tslint:disable-next-line
var signatureFields = document.getElementsByClassName('e-pdfviewer-signatureformFields');
this.makeformFieldsReadonly(signatureFields, isReadonly);
};
// tslint:disable-next-line
FormFields.prototype.makeformFieldsReadonly = function (formFields, isReadonly) {
for (var i = 0; i < formFields.length; i++) {
if (formFields[i]) {
// tslint:disable-next-line
var inputField = formFields[i];
if (!isReadonly) {
inputField.disabled = true;
inputField.style.cursor = 'default';
}
else {
// tslint:disable-next-line
inputField.disabled = false;
}
}
}
};
// tslint:disable-next-line
FormFields.prototype.applyTabIndex = function (data, inputField, pageIndex) {

@@ -636,3 +701,3 @@ inputField.tabIndex = data.TabIndex;

var currentData = formFieldsData[m];
if (currentData.Name === 'ink' && currentData.FieldName === signData.FieldName && signData.Value !== '') {
if ((currentData.Name === 'ink' || currentData.Name === 'SignatureField') && currentData.FieldName === signData.FieldName && currentData.Value && currentData.Value !== '') {
signData.Value = currentData.Value;

@@ -720,3 +785,3 @@ this.isSignatureField = true;

FormFields.prototype.destroy = function () {
window.sessionStorage.removeItem(this.pdfViewerBase.documentId + '_formfields');
this.currentTarget = null;
};

@@ -723,0 +788,0 @@ /**

@@ -20,3 +20,3 @@ import { Browser } from '@syncfusion/ej2-base';

this.scrollWidth = 25;
this.zoomPercentages = [50, 75, 100, 125, 150, 200, 400];
this.zoomPercentages = [10, 25, 50, 75, 100, 125, 150, 200, 400];
this.isNotPredefinedZoom = false;

@@ -82,4 +82,4 @@ this.pinchStep = 0.02;

Magnification.prototype.zoomTo = function (zoomValue) {
if (zoomValue < 50) {
zoomValue = 50;
if (zoomValue < 10) {
zoomValue = 10;
}

@@ -110,4 +110,4 @@ else if (zoomValue > 400) {

this.isNotPredefinedZoom = false;
if (this.zoomLevel >= 6) {
this.zoomLevel = 6;
if (this.zoomLevel >= 8) {
this.zoomLevel = 8;
}

@@ -237,4 +237,4 @@ else {

}
if (temporaryZoomFactor < 0.5) {
temporaryZoomFactor = 0.5;
if (temporaryZoomFactor < 0.1) {
temporaryZoomFactor = 0.1;
}

@@ -258,7 +258,14 @@ this.isPinchZoomed = true;

var temporaryZoomFactor = this.zoomFactor + this.pinchStep;
if (temporaryZoomFactor > 2) {
temporaryZoomFactor = temporaryZoomFactor + this.pinchStep;
if (Browser.isDevice) {
if (temporaryZoomFactor > 2) {
temporaryZoomFactor = 2;
}
}
if (temporaryZoomFactor > 4) {
temporaryZoomFactor = 4;
else {
if (temporaryZoomFactor > 2) {
temporaryZoomFactor = temporaryZoomFactor + this.pinchStep;
}
if (temporaryZoomFactor > 4) {
temporaryZoomFactor = 4;
}
}

@@ -304,2 +311,8 @@ this.isTapToFitZoom = true;

this.zoomFactor = this.getZoomFactor(zoomValue);
if (this.zoomFactor <= 0.25) {
this.pdfViewerBase.isMinimumZoom = true;
}
else {
this.pdfViewerBase.isMinimumZoom = false;
}
if (Browser.isDevice) {

@@ -379,2 +392,7 @@ if (this.isWebkitMobile) {

}
// tslint:disable-next-line
var annotModule = this.pdfViewer.annotationModule;
if (annotModule && annotModule.textMarkupAnnotationModule) {
this.pdfViewer.annotationModule.textMarkupAnnotationModule.updateCurrentResizerPosition();
}
if (this.pdfViewerBase.pageSize.length > 0) {

@@ -388,3 +406,5 @@ // tslint:disable-next-line:max-line-length

this.pdfViewerBase.viewerContainer.scrollTop = scrollValue;
this.magnifyPageRerenderTimer = setTimeout(function () { proxy_1.rerenderMagnifiedPages(); }, 800);
if (!this.pdfViewerBase.documentLoaded) {
this.magnifyPageRerenderTimer = setTimeout(function () { proxy_1.rerenderMagnifiedPages(); }, 800);
}
}

@@ -522,3 +542,3 @@ };

var pageDivs = document.querySelectorAll('canvas[id*="' + this.pdfViewer.element.id + '_pageCanvas_"]');
var viewportWidth = 816;
var viewPortWidth = 816;
for (var i = 0; i < pageDivs.length; i++) {

@@ -528,3 +548,3 @@ // tslint:disable-next-line:radix

var pageWidth = this.pdfViewerBase.pageSize[pageNumber].width;
if (viewportWidth < pageWidth) {
if ((viewPortWidth < pageWidth) && this.pdfViewer.tileRenderingSettings.enableTileRendering) {
pageDivs[i].width = pageWidth * this.pdfViewerBase.getZoomFactor();

@@ -573,3 +593,8 @@ // tslint:disable-next-line:max-line-length

Magnification.prototype.initiateRerender = function (proxy) {
if (proxy.pageRerenderCount === proxy.pdfViewerBase.reRenderedCount && proxy.pageRerenderCount !== 0 && proxy.pdfViewerBase.reRenderedCount !== 0) {
var isReRender = false;
if (this.previousZoomFactor < 0.4 || this.pdfViewerBase.isMinimumZoom) {
isReRender = true;
}
// tslint:disable-next-line:max-line-length
if (((proxy.pageRerenderCount === proxy.pdfViewerBase.reRenderedCount) || isReRender) && proxy.pageRerenderCount !== 0 && proxy.pdfViewerBase.reRenderedCount !== 0) {
proxy.reRenderAfterPinch(this.reRenderPageNumber);

@@ -581,4 +606,8 @@ }

var lowerPageValue = currentPageIndex - 3;
var higherPageValue = currentPageIndex + 1;
if (this.pdfViewerBase.isMinimumZoom) {
lowerPageValue = currentPageIndex - 4;
higherPageValue = currentPageIndex + 4;
}
lowerPageValue = (lowerPageValue > 0) ? lowerPageValue : 0;
var higherPageValue = currentPageIndex + 1;
higherPageValue = (higherPageValue < this.pdfViewerBase.pageCount) ? higherPageValue : (this.pdfViewerBase.pageCount - 1);

@@ -617,4 +646,8 @@ for (var i = lowerPageValue; i <= higherPageValue; i++) {

var lowerPageValue = currentPageIndex - 3;
var higherPageValue = currentPageIndex + 1; // jshint ignore:line
if (this.pdfViewerBase.isMinimumZoom) {
lowerPageValue = currentPageIndex - 4;
higherPageValue = currentPageIndex + 4;
}
lowerPageValue = (lowerPageValue > 0) ? lowerPageValue : 0;
var higherPageValue = currentPageIndex + 1; // jshint ignore:line
higherPageValue = (higherPageValue < this.pdfViewerBase.pageCount) ? higherPageValue : (this.pdfViewerBase.pageCount - 1);

@@ -668,4 +701,8 @@ for (var i = lowerPageValue; i <= higherPageValue; i++) {

var lowerPageValue = pageNumber - 3;
var higherPageValue = pageNumber + 3;
if (this.pdfViewerBase.isMinimumZoom) {
lowerPageValue = pageNumber - 4;
higherPageValue = pageNumber + 4;
}
lowerPageValue = (lowerPageValue > 0) ? lowerPageValue : 0;
var higherPageValue = pageNumber + 3;
higherPageValue = (higherPageValue < this.pdfViewerBase.pageCount) ? higherPageValue : (this.pdfViewerBase.pageCount - 1);

@@ -684,3 +721,8 @@ for (var i = lowerPageValue; i <= higherPageValue; i++) {

var height = this.pdfViewerBase.pageSize[i].height * this.zoomFactor;
pageDiv.style.width = width + 'px';
if (this.pdfViewerBase.isMixedSizeDocument && this.pdfViewerBase.highestWidth > 0) {
pageDiv.style.width = (this.pdfViewerBase.highestWidth * this.zoomFactor) + 'px';
}
else {
pageDiv.style.width = width + 'px';
}
pageDiv.style.height = height + 'px';

@@ -713,4 +755,4 @@ // tslint:disable-next-line:max-line-length

// tslint:disable-next-line:max-line-length
var higherValue = ((pageNumber) === (this.pdfViewerBase.pageCount)) ? (this.pdfViewerBase.pageCount - 1) : pageNumber;
if ((lowerValue <= i) && (i <= higherValue) && ((this.pdfViewer.textSelectionModule.isTextSelection && isSelectionAvailable) || this.pdfViewerBase.textLayer.getTextSearchStatus())) {
var higherValue = ((pageNumber) === (this.pdfViewerBase.pageCount)) ? (this.pdfViewerBase.pageCount - 1) : (pageNumber + 1);
if ((lowerValue <= i) && (i <= higherValue) && ((this.pdfViewer.textSelectionModule.isTextSelection && isSelectionAvailable) || this.pdfViewerBase.textLayer.getTextSearchStatus() || this.pdfViewerBase.isInitialPageMode)) {
this.pdfViewerBase.textLayer.resizeTextContentsOnZoom(i);

@@ -729,2 +771,3 @@ if (this.pdfViewer.textSelectionModule.isTextSelection && isSelectionAvailable) {

}
this.pdfViewerBase.applyElementStyles(textLayer, i);
}

@@ -745,3 +788,4 @@ var adornerSvg = getDiagramElement(this.pdfViewer.element.id + '_textLayer_' + i);

adornerSvg.style.height = height + 'px';
this.pdfViewer.renderSelector(i);
this.pdfViewer.renderSelector(i, this.pdfViewer.annotationSelectorSettings);
this.pdfViewerBase.applyElementStyles(diagramAdornerLayer, i);
}

@@ -748,0 +792,0 @@ }

@@ -1,2 +0,2 @@

import { Component, INotifyPropertyChanged, NotifyPropertyChanges, ChildProperty, L10n, Collection, Complex } from '@syncfusion/ej2-base';import { ModuleDeclaration, isNullOrUndefined, Property, Event, EmitType } from '@syncfusion/ej2-base';import { PdfViewerBase } from './index';import { Navigation } from './index';import { Magnification } from './index';import { Toolbar } from './index';import { ToolbarItem } from './index';import { LinkTarget, InteractionMode, AnnotationType, AnnotationToolbarItem, LineHeadStyle, ContextMenuAction, FontStyle, TextAlignment, AnnotationResizerShape, AnnotationResizerLocation, ZoomMode } from './base/types';import { Annotation } from './index';import { LinkAnnotation } from './index';import { ThumbnailView } from './index';import { BookmarkView } from './index';import { TextSelection } from './index';import { TextSearch } from './index';import { FormFields } from './index';import { Print, CalibrationUnit } from './index';import { UnloadEventArgs, LoadEventArgs, LoadFailedEventArgs, AjaxRequestFailureEventArgs, PageChangeEventArgs, PageClickEventArgs, ZoomChangeEventArgs, HyperlinkClickEventArgs, HyperlinkMouseOverArgs, ImportStartEventArgs, ImportSuccessEventArgs, ImportFailureEventArgs, ExportStartEventArgs, ExportSuccessEventArgs, ExportFailureEventArgs, AjaxRequestInitiateEventArgs } from './index';import { AnnotationAddEventArgs, AnnotationRemoveEventArgs, AnnotationPropertiesChangeEventArgs, AnnotationResizeEventArgs, AnnotationSelectEventArgs, AnnotationMoveEventArgs } from './index';import { TextSelectionStartEventArgs, TextSelectionEndEventArgs, DownloadStartEventArgs, DownloadEndEventArgs } from './index';import { PdfAnnotationBase, ZOrderPageTable } from '../diagram/pdf-annotation';import { PdfAnnotationBaseModel } from '../diagram/pdf-annotation-model';import { Drawing, ClipBoardObject } from '../diagram/drawing';import { Selector } from '../diagram/selector';import { SelectorModel } from '../diagram/selector-model';import { PointModel, IElement, Rect } from '@syncfusion/ej2-drawings';import { renderAdornerLayer } from '../diagram/dom-util';import { ThumbnailClickEventArgs } from './index';
import { Component, INotifyPropertyChanged, NotifyPropertyChanges, ChildProperty, L10n, Collection, Complex } from '@syncfusion/ej2-base'; import { ModuleDeclaration, isNullOrUndefined, Property, Event, EmitType } from '@syncfusion/ej2-base'; import { PdfViewerBase } from './index'; import { Navigation } from './index'; import { Magnification } from './index'; import { Toolbar } from './index'; import { ToolbarItem } from './index'; import { LinkTarget, InteractionMode, AnnotationType, AnnotationToolbarItem, LineHeadStyle, ContextMenuAction, FontStyle, TextAlignment, AnnotationResizerShape, AnnotationResizerLocation, ZoomMode, PrintMode, CursorType } from './base/types'; import { Annotation } from './index'; import { LinkAnnotation } from './index'; import { ThumbnailView } from './index'; import { BookmarkView } from './index'; import { TextSelection } from './index'; import { TextSearch } from './index'; import { FormFields } from './index'; import { Print, CalibrationUnit } from './index'; import { UnloadEventArgs, LoadEventArgs, LoadFailedEventArgs, AjaxRequestFailureEventArgs, PageChangeEventArgs, PageClickEventArgs, ZoomChangeEventArgs, HyperlinkClickEventArgs, HyperlinkMouseOverArgs, ImportStartEventArgs, ImportSuccessEventArgs, ImportFailureEventArgs, ExportStartEventArgs, ExportSuccessEventArgs, ExportFailureEventArgs, AjaxRequestInitiateEventArgs } from './index'; import { AnnotationAddEventArgs, AnnotationRemoveEventArgs, AnnotationPropertiesChangeEventArgs, AnnotationResizeEventArgs, AnnotationSelectEventArgs, AnnotationMoveEventArgs, AnnotationDoubleClickEventArgs, AnnotationMouseoverEventArgs, PageMouseoverEventArgs } from './index'; import { TextSelectionStartEventArgs, TextSelectionEndEventArgs, DownloadStartEventArgs, DownloadEndEventArgs, ExtractTextCompletedEventArgs } from './index'; import { PdfAnnotationBase, ZOrderPageTable } from '../diagram/pdf-annotation'; import { PdfAnnotationBaseModel } from '../diagram/pdf-annotation-model'; import { Drawing, ClipBoardObject } from '../diagram/drawing'; import { Selector } from '../diagram/selector'; import { SelectorModel } from '../diagram/selector-model'; import { PointModel, IElement, Rect } from '@syncfusion/ej2-drawings'; import { renderAdornerLayer } from '../diagram/dom-util'; import { ThumbnailClickEventArgs } from './index'; import { ValidateFormFieldsArgs } from './base'; import { AddSignatureEventArgs, RemoveSignatureEventArgs, MoveSignatureEventArgs, SignaturePropertiesChangeEventArgs, ResizeSignatureEventArgs } from './base';
import {IAjaxHeaders} from "./pdfviewer";

@@ -32,2 +32,7 @@ import {ComponentModel} from '@syncfusion/ej2-base';

/**
* set the ajax credentials for the pdfviewer.
*/
withCredentials?: boolean;
}

@@ -129,2 +134,7 @@

/**
* specifies the export action of PdfViewer.
*/
renderTexts?: string;
}

@@ -162,2 +172,12 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
}

@@ -195,2 +215,12 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
}

@@ -228,2 +258,12 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
}

@@ -286,2 +326,37 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
}

@@ -344,2 +419,37 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
}

@@ -387,2 +497,37 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
}

@@ -430,2 +575,37 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
}

@@ -468,2 +648,7 @@

/**
* specifies the default content of the label.
*/
notes?: string;
}

@@ -511,2 +696,37 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
}

@@ -534,2 +754,37 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
}

@@ -582,2 +837,27 @@

/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
}

@@ -640,2 +920,47 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* specifies the leader length of the annotation.
*/
leaderLength?: number;
/**
* Defines the cursor type for distance annotation.
*/
resizeCursorType?: CursorType;
}

@@ -698,2 +1023,32 @@

/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
}

@@ -741,2 +1096,32 @@

/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
}

@@ -784,2 +1169,37 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
}

@@ -827,2 +1247,32 @@

/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
}

@@ -855,2 +1305,17 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
/**
* specifies the lock action of the annotation.
*/
isLock?: boolean;
}

@@ -975,2 +1440,37 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
/**
* specifies the minHeight of the annotation.
*/
minHeight?: number;
/**
* specifies the minWidth of the annotation.
*/
minWidth?: number;
/**
* specifies the minHeight of the annotation.
*/
maxHeight?: number;
/**
* specifies the maxWidth of the annotation.
*/
maxWidth?: number;
/**
* specifies the locked action of the annotation.
*/
isLock?: boolean;
/**
* specifies the custom data of the annotation.
*/
customData?: object;
}

@@ -1075,2 +1575,7 @@

/**
* specifies the annotation selector settings of the annotation.
*/
annotationSelectorSettings?: AnnotationSelectorSettingsModel;
}

@@ -1126,2 +1631,133 @@

/**
* Interface for a class DocumentTextCollectionSettings
*/
export interface DocumentTextCollectionSettingsModel {
/**
* specifies the text data of the document.
*/
textData?: TextDataSettingsModel[];
/**
* specifies the page text of the document.
*/
pageText?: string;
/**
* specifies the page size of the document.
*/
pageSize?: number;
}
/**
* Interface for a class TextDataSettings
*/
export interface TextDataSettingsModel {
/**
* specifies the bounds of the rectangle.
*/
bounds?: RectangleBoundsModel;
/**
* specifies the text of the document.
*/
text?: string;
}
/**
* Interface for a class RectangleBounds
*/
export interface RectangleBoundsModel {
/**
* specifies the size of the rectangle.
*/
size?: number;
/**
* specifies the x co-ordinate of the upper-left corner of the rectangle.
*/
x?: number;
/**
* specifies the y co-ordinate of the upper-left corner of the rectangle.
*/
y?: number;
/**
* specifies the width of the rectangle.
*/
width?: number;
/**
* specifies the height of the rectangle.
*/
height?: number;
/**
* specifies the left value of the rectangle.
*/
left?: number;
/**
* specifies the top value of the rectangle.
*/
top?: number;
/**
* specifies the right of the rectangle.
*/
right?: number;
/**
* specifies the bottom value of the rectangle.
*/
bottom?: number;
/**
* Returns true if height and width of the rectangle is zero.
* @default 'false'
*/
isEmpty?: boolean;
}
/**
* Interface for a class TileRenderingSettings
*/
export interface TileRenderingSettingsModel {
/**
* Enable or disables tile rendering mode in the PDF Viewer.
*/
enableTileRendering?: boolean;
/**
* specifies the tileX count of the render Page.
*/
x?: number;
/**
* specifies the tileY count of the render Page.
*/
y?: number;
}
/**
* Interface for a class ScrollSettings
*/
export interface ScrollSettingsModel {
/**
* Increase or decrease the delay time.
*/
delayPageRequestTimeOnScroll?: number;
}
/**
* Interface for a class PdfViewer

@@ -1142,2 +1778,7 @@ */

/**
* Gets or sets the download file name in the PdfViewer control.
*/
downloadFileName?: string;
/**
* Defines the scrollable height of the PdfViewer control.

@@ -1161,2 +1802,14 @@ * @default 'auto'

/**
* Specifies the retry count for the failed requests.
* @default 1
*/
retryCount?: number;
/**
* If it is set as false then error message box is not displayed in PDF viewer control.
* @default true
*/
showNotificationDialog?: boolean;
/**
* Enable or disables the Navigation toolbar of PdfViewer.

@@ -1174,2 +1827,8 @@ * @default true

/**
* If it set as true, then the command panel show at initial document loading in the PDF viewer
* @default false
*/
isCommandPanelOpen?: boolean;
/**
* Enable or disable the text markup resizer to modify the bounds in UI.

@@ -1181,2 +1840,14 @@ * @default false

/**
* Enable or disable the multi line text markup annotations in overlapping collections.
* @default false
*/
enableMultiLineOverlap?: boolean;
/**
* Enables or disables the multi-page text markup annotation selection in UI.
* @default false
*/
enableMultiPageAnnotation?: boolean;
/**
* Enable or disables the download option of PdfViewer.

@@ -1200,2 +1871,14 @@ * @default true

/**
* If it set as true, then the thumbnail view show at initial document loading in the PDF viewer
* @default false
*/
isThumbnailViewOpen?: boolean;
/**
* Enables or disable saving Hand Written signature as editable in the PDF.
* @default false
*/
isSignatureEditable?: boolean;
/**
* Enables or disables the bookmark view in the PDF viewer

@@ -1279,2 +1962,8 @@ * @default true

/**
* Enable or disable the form fields validation.
* @default false
*/
enableFormFieldsValidation?: boolean;
/**
* Enable or disable the free text annotation in the Pdfviewer.

@@ -1317,3 +2006,3 @@ * @default true

* Opens the annotation toolbar when the PDF document is loaded in the PDF Viewer control initially.
* @default false
* @default true
*/

@@ -1335,2 +2024,26 @@ enableAnnotationToolbar?: boolean;

/**
* Specifies the print mode in the PDF Viewer.
* @default Default
*/
printMode?: PrintMode;
/**
* Sets the initial loading zoom value from 10 to 400 in PdfViewer Control.
* @default 0
*/
zoomValue?: number;
/**
* Enable or disable the zoom optimization mode in PDF Viewer.
* @default true
*/
enableZoomOptimization?: boolean;
/**
* Enable or disables the get the document text collections.
* @default false
*/
isExtractText?: boolean;
/**
* Defines the settings of the PdfViewer toolbar.

@@ -1369,2 +2082,3 @@ */

*/
// tslint:disable-next-line:max-line-length
highlightSettings?: HighlightSettingsModel;

@@ -1375,2 +2089,3 @@

*/
// tslint:disable-next-line:max-line-length
strikethroughSettings?: StrikethroughSettingsModel;

@@ -1381,2 +2096,3 @@

*/
// tslint:disable-next-line:max-line-length
underlineSettings?: UnderlineSettingsModel;

@@ -1465,2 +2181,3 @@

*/
// tslint:disable-next-line:max-line-length
stickyNotesSettings?: StickyNotesSettingsModel;

@@ -1493,2 +2210,3 @@

*/
// tslint:disable-next-line:max-line-length
handWrittenSignatureSettings?: HandWrittenSignatureSettingsModel;

@@ -1503,2 +2221,12 @@

/**
* Defines the tile rendering settings.
*/
tileRenderingSettings?: TileRenderingSettingsModel;
/**
* Defines the scroll settings.
*/
scrollSettings?: ScrollSettingsModel;
/**
* Defines the collection of selected items, size and position of the selector

@@ -1538,2 +2266,9 @@ * @default {}

/**
* Triggers when validation is failed.
* @event
* @blazorProperty 'validateFormFields'
*/
validateFormFields?: EmitType<ValidateFormFieldsArgs>;
/**
* Triggers when the mouse click is performed over the page of the PDF document.

@@ -1602,2 +2337,32 @@ * @event

/**
* Triggers when signature is added over the page of the PDF document.
* @event
*/
addSignature?: EmitType<AddSignatureEventArgs>;
/**
* Triggers when signature is removed over the page of the PDF document.
* @event
*/
removeSignature?: EmitType<RemoveSignatureEventArgs>;
/**
* Triggers when an signature is moved over the page of the PDF document.
* @event
*/
moveSignature?: EmitType<MoveSignatureEventArgs>;
/**
* Triggers when the property of the signature is changed in the page of the PDF document.
* @event
*/
signaturePropertiesChange?: EmitType<SignaturePropertiesChangeEventArgs>;
/**
* Triggers when signature is resized over the page of the PDF document.
* @event
*/
resizeSignature?: EmitType<ResizeSignatureEventArgs>;
/**
* Triggers when an annotation is selected over the page of the PDF document.

@@ -1610,2 +2375,9 @@ * @event

/**
* Triggers an event when the annotation is double click.
* @event
* @blazorProperty 'OnAnnotationDoubleClick'
*/
annotationDoubleClick?: EmitType<AnnotationDoubleClickEventArgs>;
/**
* Triggers when an annotation is moved over the page of the PDF document.

@@ -1618,2 +2390,14 @@ * @event

/**
* Triggers when mouse over the annotation object.
* @event
*/
annotationMouseover?: EmitType<AnnotationMouseoverEventArgs>;
/**
* Triggers when mouse over the page.
* @event
*/
pageMouseover?: EmitType<PageMouseoverEventArgs>;
/**
* Triggers when an imported annotations started in the PDF document.

@@ -1661,2 +2445,9 @@ * @event

/**
* Triggers when an text extraction is completed in the PDF Viewer.
* @event
* @blazorProperty 'ExtractTextCompleted'
*/
extractTextCompleted?: EmitType<ExtractTextCompletedEventArgs>;
/**
* Triggers an event when the thumbnail is clicked in the thumbnail panel of PDF Viewer.

@@ -1663,0 +2454,0 @@ * @event

@@ -14,2 +14,3 @@ import { PdfViewer } from '../index';

private iframe;
private printWindow;
/**

@@ -31,2 +32,3 @@ * @private

private printWindowOpen;
private createPrintLoadingIndicator;
/**

@@ -33,0 +35,0 @@ * @private

@@ -27,11 +27,19 @@ import { createElement, Browser } from '@syncfusion/ej2-base';

});
this.pdfViewerBase.showPrintLoadingIndicator(true);
this.iframe = document.createElement('iframe');
this.iframe.className = 'iframeprint';
this.iframe.id = 'iframePrint';
this.iframe.style.position = 'absolute';
this.iframe.style.top = '-100000000px';
document.body.appendChild(this.iframe);
this.frameDoc = this.iframe.contentWindow ? this.iframe.contentWindow : this.iframe.contentDocument;
this.frameDoc.document.open();
if (this.pdfViewer.printMode === 'Default') {
this.pdfViewerBase.showPrintLoadingIndicator(true);
this.iframe = document.createElement('iframe');
this.iframe.className = 'iframeprint';
this.iframe.id = 'iframePrint';
this.iframe.style.position = 'absolute';
this.iframe.style.top = '-100000000px';
document.body.appendChild(this.iframe);
this.frameDoc = this.iframe.contentWindow ? this.iframe.contentWindow : this.iframe.contentDocument;
this.frameDoc.document.open();
}
else {
this.printWindow = window.open('', 'print', 'height=' + window.outerHeight + ',width=' + window.outerWidth + ',tabbar=no');
this.printWindow.moveTo(0, 0);
this.printWindow.resizeTo(screen.availWidth, screen.availHeight);
this.createPrintLoadingIndicator(this.printWindow.document.body);
}
setTimeout(function () {

@@ -61,2 +69,3 @@ for (pageIndex = 0; pageIndex < _this.pdfViewerBase.pageCount; pageIndex++) {

}
proxy.pdfViewerBase.createFormfieldsJsonData();
proxy.printRequestHandler = new AjaxHandler(proxy.pdfViewer);

@@ -66,3 +75,10 @@ proxy.printRequestHandler.url = proxy.pdfViewer.serviceUrl + '/' + proxy.pdfViewer.serverActionSettings.print;

proxy.printRequestHandler.mode = false;
proxy.printRequestHandler.send(jsonObject);
if (this.pdfViewerBase.validateForm && this.pdfViewer.enableFormFieldsValidation) {
this.pdfViewer.fireValidatedFailed(proxy.pdfViewer.serverActionSettings.download);
this.pdfViewerBase.validateForm = false;
this.pdfViewerBase.showPrintLoadingIndicator(false);
}
else {
proxy.printRequestHandler.send(jsonObject);
}
// tslint:disable-next-line

@@ -103,7 +119,7 @@ proxy.printRequestHandler.onSuccess = function (result) {

// tslint:disable-next-line:max-line-length
annotationSource_1 = proxy.pdfViewer.annotationModule.textMarkupAnnotationModule.printTextMarkupAnnotations(textMarkupAnnotation, pageIndex, stampAnnotation, shapeAnnotation, measureShapeAnnotation, stickyNoteAnnotation);
annotationSource_1 = proxy.pdfViewer.annotationModule.textMarkupAnnotationModule.printTextMarkupAnnotations(textMarkupAnnotation, printImage.pageNumber, stampAnnotation, shapeAnnotation, measureShapeAnnotation, stickyNoteAnnotation);
}
else {
// tslint:disable-next-line:max-line-length
annotationSource_1 = proxy.pdfViewer.annotationModule.textMarkupAnnotationModule.printTextMarkupAnnotations(printCollection.textMarkupAnnotation, pageIndex, printCollection.stampAnnotations, printCollection.shapeAnnotation, printCollection.measureShapeAnnotation, printCollection.stickyNoteAnnotation);
annotationSource_1 = proxy.pdfViewer.annotationModule.textMarkupAnnotationModule.printTextMarkupAnnotations(printCollection.textMarkupAnnotation, printImage.pageNumber, printCollection.stampAnnotations, printCollection.shapeAnnotation, printCollection.measureShapeAnnotation, printCollection.stickyNoteAnnotation);
}

@@ -113,3 +129,3 @@ }

// tslint:disable-next-line:max-line-length
annotationSource_1 = proxy.pdfViewer.annotationModule.textMarkupAnnotationModule.printTextMarkupAnnotations(null, pageIndex, null, null, null, null);
annotationSource_1 = proxy.pdfViewer.annotationModule.textMarkupAnnotationModule.printTextMarkupAnnotations(null, printImage.pageNumber, null, null, null, null);
}

@@ -174,22 +190,30 @@ }

var formFieldsData = JSON.parse(data);
for (var i = 0; i < formFieldsData.length; i++) {
// tslint:disable-next-line
var currentData = formFieldsData[i];
// tslint:disable-next-line
if (parseFloat(currentData['PageIndex']) === pageIndex) {
if (formFieldsData) {
for (var i = 0; i < formFieldsData.length; i++) {
// tslint:disable-next-line
var targetField = this.frameDoc.document.getElementById('fields_' + pageIndex);
var currentData = formFieldsData[i];
// tslint:disable-next-line
var inputField = this.pdfViewer.formFieldsModule.createFormFields(currentData, pageIndex, i, targetField);
if (inputField) {
if (parseFloat(currentData['PageIndex']) === pageIndex) {
// tslint:disable-next-line
var bounds = currentData['LineBounds'];
var targetField = void 0;
if (this.pdfViewer.printMode === 'Default') {
targetField = this.frameDoc.document.getElementById('fields_' + pageIndex);
}
else {
targetField = this.printWindow.document.getElementById('fields_' + pageIndex);
}
// tslint:disable-next-line
var font = currentData['Font'];
this.applyPosition(inputField, bounds, font, heightRatio, widthRatio);
inputField.style.backgroundColor = 'transparent';
if (!currentData.IsSignatureField) {
inputField.style.borderColor = 'transparent';
var inputField = this.pdfViewer.formFieldsModule.createFormFields(currentData, pageIndex, i, targetField);
if (inputField) {
// tslint:disable-next-line
var bounds = currentData['LineBounds'];
// tslint:disable-next-line
var font = currentData['Font'];
this.applyPosition(inputField, bounds, font, heightRatio, widthRatio);
inputField.style.backgroundColor = 'transparent';
if (!currentData.IsSignatureField) {
inputField.style.borderColor = 'transparent';
}
targetField.appendChild(inputField);
}
targetField.appendChild(inputField);
}

@@ -229,2 +253,10 @@ }

var browserUserAgent = navigator.userAgent;
// tslint:disable-next-line
var printDocument;
if (this.pdfViewer.printMode === 'Default') {
printDocument = this.frameDoc.document;
}
else {
printDocument = this.printWindow.document;
}
// tslint: disable-next-line:max-line-length

@@ -234,5 +266,5 @@ if ((browserUserAgent.indexOf('Chrome') !== -1) || (browserUserAgent.indexOf('Safari') !== -1) ||

//chrome and firefox
this.frameDoc.document.write('<!DOCTYPE html>');
printDocument.write('<!DOCTYPE html>');
// tslint: disable-next-line:max-line-length
this.frameDoc.document.write('<html moznomarginboxes mozdisallowselectionprint><head><style>html, body { height: 100%; }'
printDocument.write('<html moznomarginboxes mozdisallowselectionprint><head><style>html, body { height: 100%; }'
+ ' img { height: 100%; width: 100%; display: block; }@media print { body { margin: 0cm; }'

@@ -245,5 +277,5 @@ + ' img { width:100%; max-width: 1048px; box-sizing: border-box; }br, button { display: none; }'

//ie
this.frameDoc.document.write('<!DOCTYPE html>');
printDocument.write('<!DOCTYPE html>');
// tslint: disable-next-line:max-line-length
this.frameDoc.document.write('<html><head>'
printDocument.write('<html><head>'
+ '<style>html, body { height: 100%; } img { height: 100%; width: 100%; }@media print { body { margin: 0cm; }'

@@ -257,3 +289,3 @@ + 'img { width:100%; max-width: 1048px; box-sizing: border-box; }br, button { display: none; } '

var canvasUrl = this.printViewerContainer.children[i].toDataURL();
this.frameDoc.document.write('<div style="margin:0mm;width:816px;height:1056px;position:relative"><img src="' + canvasUrl + '" id="' + 'image_' + i + '" /><div id="' + 'fields_' + i + '" style="margin:0px;top:0px;left:0px;position:absolute;width:816px;height:1056px;z-index:2"></div></div>');
printDocument.write('<div style="margin:0mm;width:816px;height:1056px;position:relative"><img src="' + canvasUrl + '" id="' + 'image_' + i + '" /><div id="' + 'fields_' + i + '" style="margin:0px;top:0px;left:0px;position:absolute;width:816px;height:1056px;z-index:2"></div></div>');
if (this.pdfViewer.formFieldsModule) {

@@ -267,9 +299,20 @@ var pageWidth = this.pdfViewerBase.pageSize[i].width;

}
this.pdfViewerBase.showPrintLoadingIndicator(false);
if (Browser.isIE || Browser.info.name === 'edge') {
try {
this.iframe.contentWindow.document.execCommand('print', false, null);
if (this.pdfViewer.printMode === 'Default') {
this.pdfViewerBase.showPrintLoadingIndicator(false);
this.iframe.contentWindow.document.execCommand('print', false, null);
}
else {
this.printWindow.document.execCommand('print', false, null);
}
}
catch (e) {
this.iframe.contentWindow.print();
if (this.pdfViewer.printMode === 'Default') {
this.pdfViewerBase.showPrintLoadingIndicator(false);
this.iframe.contentWindow.print();
}
else {
this.printWindow.print();
}
}

@@ -279,8 +322,66 @@ }

setTimeout(function () {
_this.iframe.contentWindow.print();
_this.iframe.contentWindow.focus();
document.body.removeChild(_this.iframe);
if (_this.pdfViewer.printMode === 'Default') {
_this.pdfViewerBase.showPrintLoadingIndicator(false);
_this.iframe.contentWindow.print();
_this.iframe.contentWindow.focus();
document.body.removeChild(_this.iframe);
}
else {
if (_this.printWindow) {
try {
_this.printWindow.print();
_this.printWindow.focus();
_this.printWindow.close();
}
catch (error) {
return null;
}
}
}
}, 200);
}
};
// tslint:disable-next-line
Print.prototype.createPrintLoadingIndicator = function (element) {
// tslint:disable-next-line
var printWindowContainer = createElement('div', {
id: this.pdfViewer.element.id + '_printWindowcontainer'
});
printWindowContainer.style.height = '100%';
printWindowContainer.style.width = '100%';
printWindowContainer.style.position = 'absolute';
printWindowContainer.style.zIndex = 2000;
printWindowContainer.style.left = 0;
printWindowContainer.style.top = 0;
printWindowContainer.style.overflow = 'auto';
printWindowContainer.style.backgroundColor = 'rgba(0, 0, 0, 0.3)';
element.appendChild(printWindowContainer);
var printWaitingPopup = createElement('div', {
id: this.pdfViewer.element.id + '_printLoadingContainer'
});
printWaitingPopup.style.position = 'absolute';
printWaitingPopup.style.width = '50px';
printWaitingPopup.style.height = '50px';
printWaitingPopup.style.left = '46%';
printWaitingPopup.style.top = '45%';
printWindowContainer.style.zIndex = 3000;
printWindowContainer.appendChild(printWaitingPopup);
// tslint:disable-next-line
var printImageContainer = new Image();
// tslint:disable-next-line
printImageContainer.src = 'data:image/gif;base64,R0lGODlhNgA3APMAAP///wAAAHh4eBwcHA4ODtjY2FRUVNzc3MTExEhISIqKigAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAANgA3AAAEzBDISau9OOvNu/9gKI5kaZ4lkhBEgqCnws6EApMITb93uOqsRC8EpA1Bxdnx8wMKl51ckXcsGFiGAkamsy0LA9pAe1EFqRbBYCAYXXUGk4DWJhZN4dlAlMSLRW80cSVzM3UgB3ksAwcnamwkB28GjVCWl5iZmpucnZ4cj4eWoRqFLKJHpgSoFIoEe5ausBeyl7UYqqw9uaVrukOkn8LDxMXGx8ibwY6+JLxydCO3JdMg1dJ/Is+E0SPLcs3Jnt/F28XXw+jC5uXh4u89EQAh+QQJCgAAACwAAAAANgA3AAAEzhDISau9OOvNu/9gKI5kaZ5oqhYGQRiFWhaD6w6xLLa2a+iiXg8YEtqIIF7vh/QcarbB4YJIuBKIpuTAM0wtCqNiJBgMBCaE0ZUFCXpoknWdCEFvpfURdCcM8noEIW82cSNzRnWDZoYjamttWhphQmOSHFVXkZecnZ6foKFujJdlZxqELo1AqQSrFH1/TbEZtLM9shetrzK7qKSSpryixMXGx8jJyifCKc1kcMzRIrYl1Xy4J9cfvibdIs/MwMue4cffxtvE6qLoxubk8ScRACH5BAkKAAAALAAAAAA2ADcAAATOEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwyZKxhqhgJJeSQVdraBNFSsVUVPHsEAzJrEtnJNSELXRN2bKcwjw19f0QG7PjA7B2EGfn+FhoeIiYoSCAk1CQiLFQpoChlUQwhuBJEWcXkpjm4JF3w9P5tvFqZsLKkEF58/omiksXiZm52SlGKWkhONj7vAxcbHyMkTmCjMcDygRNAjrCfVaqcm11zTJrIjzt64yojhxd/G28XqwOjG5uTxJhEAIfkECQoAAAAsAAAAADYANwAABM0QyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/i8qmCoGQoacT8FZ4AXbFopfTwEBhhnQ4w2j0GRkgQYiEOLPI6ZUkgHZwd6EweLBqSlq6ytricICTUJCKwKkgojgiMIlwS1VEYlspcJIZAkvjXHlcnKIZokxJLG0KAlvZfAebeMuUi7FbGz2z/Rq8jozavn7Nev8CsRACH5BAkKAAAALAAAAAA2ADcAAATLEMhJq7046827/2AojmRpnmiqrqwwDAJbCkRNxLI42MSQ6zzfD0Sz4YYfFwzJNCmPzheUyJuKijVrZ2cTlrg1LwjcO5HFyeoJeyM9U++mfE6v2+/4PD6O5F/YWiqAGWdIhRiHP4kWg0ONGH4/kXqUlZaXmJlMBQY1BgVuUicFZ6AhjyOdPAQGQF0mqzauYbCxBFdqJao8rVeiGQgJNQkIFwdnB0MKsQrGqgbJPwi2BMV5wrYJetQ129x62LHaedO21nnLq82VwcPnIhEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7/g8Po7kX9haKoAZZ0iFGIc/iRaDQ40Yfj+RepSVlpeYAAgJNQkIlgo8NQqUCKI2nzNSIpynBAkzaiCuNl9BIbQ1tl0hraewbrIfpq6pbqsioaKkFwUGNQYFSJudxhUFZ9KUz6IGlbTfrpXcPN6UB2cHlgfcBuqZKBEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhhh8XDMk0KY/OF5TIm4qKNWtnZxOWuDUvCNw7kcXJ6gl7Iz1T76Z8Tq/b7yJEopZA4CsKPDUKfxIIgjZ+P3EWe4gECYtqFo82P2cXlTWXQReOiJE5bFqHj4qiUhmBgoSFho59rrKztLVMBQY1BgWzBWe8UUsiuYIGTpMglSaYIcpfnSHEPMYzyB8HZwdrqSMHxAbath2MsqO0zLLorua05OLvJxEAIfkECQoAAAAsAAAAADYANwAABMwQyEmrvTjrzbv/YCiOZGmeaKqurDAMAlsKRE3EsjjYxJDrPN8PRLPhfohELYHQuGBDgIJXU0Q5CKqtOXsdP0otITHjfTtiW2lnE37StXUwFNaSScXaGZvm4r0jU1RWV1hhTIWJiouMjVcFBjUGBY4WBWw1A5RDT3sTkVQGnGYYaUOYPaVip3MXoDyiP3k3GAeoAwdRnRoHoAa5lcHCw8TFxscduyjKIrOeRKRAbSe3I9Um1yHOJ9sjzCbfyInhwt3E2cPo5dHF5OLvJREAOwAAAAAAAAAAAA==';
printImageContainer.style.width = '50px';
printImageContainer.style.height = '50px';
printWaitingPopup.appendChild(printImageContainer);
var printLabelContainer = createElement('div', {
id: this.pdfViewer.element.id + '_printLabelContainer'
});
printLabelContainer.style.position = 'absolute';
printLabelContainer.textContent = 'Loading ...';
printLabelContainer.style.fontWeight = 'Bold';
printLabelContainer.style.left = '46%';
printLabelContainer.style.top = '54.5%';
printLabelContainer.style.zIndex = '3000';
printWindowContainer.appendChild(printLabelContainer);
};
/**

@@ -292,2 +393,3 @@ * @private

this.frameDoc = undefined;
this.printWindow = undefined;
};

@@ -294,0 +396,0 @@ /**

import { PdfViewer, PdfViewerBase } from '../index';
import { DocumentTextCollectionSettingsModel } from '../pdfviewer-model';
/**

@@ -18,2 +19,6 @@ * TextSearch module

searchInput: HTMLElement;
/**
* @private
*/
searchCount: number;
private pdfViewer;

@@ -44,2 +49,11 @@ private pdfViewerBase;

*/
documentTextCollection: DocumentTextCollectionSettingsModel[][];
/**
* @private
*/
isTextRetrieved: boolean;
private isTextSearched;
/**
* @private
*/
constructor(pdfViewer: PdfViewer, pdfViewerBase: PdfViewerBase);

@@ -72,2 +86,3 @@ /**

private getPossibleMatches;
private getSearchTextContent;
private getSearchPage;

@@ -105,2 +120,11 @@ private highlightSearchedTexts;

private createRequestForSearch;
/**
* @private
*/
getPDFDocumentTexts(): void;
/**
* @private
*/
createRequestForGetPdfTexts(startIndex: number, endIndex: number): void;
private orderPdfTextCollections;
private createSearchBoxButtons;

@@ -107,0 +131,0 @@ private enablePrevButton;

@@ -17,2 +17,6 @@ import { createElement, Browser, isNullOrUndefined } from '@syncfusion/ej2-base';

this.isTextSearch = false;
/**
* @private
*/
this.searchCount = 0;
this.searchIndex = 0;

@@ -38,2 +42,7 @@ this.currentSearchIndex = 0;

this.isMessagePopupOpened = false;
/**
* @private
*/
this.isTextRetrieved = false;
this.isTextSearched = false;
this.checkBoxOnChange = function (event) {

@@ -226,2 +235,16 @@ if (event.checked) {

this.searchPageIndex = this.pdfViewerBase.currentPageNumber - 1;
this.searchCount = 0;
if (this.pdfViewer.isExtractText) {
if (this.isTextRetrieved) {
for (var i = 0; i < this.pdfViewerBase.pageCount; i++) {
this.initSearch(i, false, true);
}
}
else {
this.isTextSearched = true;
for (var i = 0; i < this.documentTextCollection.length; i++) {
this.initSearch(i, false, true);
}
}
}
this.initSearch(this.searchPageIndex, false);

@@ -279,3 +302,3 @@ this.highlightOthers();

};
TextSearch.prototype.initSearch = function (pageIndex, isSinglePageSearch) {
TextSearch.prototype.initSearch = function (pageIndex, isSinglePageSearch, isCount) {
// tslint:disable-next-line

@@ -287,15 +310,28 @@ var storedData = this.pdfViewerBase.getStoredData(pageIndex);

var characterBounds = null;
if (storedData) {
// tslint:disable-next-line
pageText = storedData['pageText'];
// tslint:disable-next-line
textContents = storedData['textContent'];
characterBounds = this.pdfViewerBase.textLayer.characterBound[pageIndex];
this.textContents[pageIndex] = textContents;
this.getPossibleMatches(pageIndex, this.searchString, pageText, textContents, isSinglePageSearch, characterBounds);
if (isCount) {
if (this.documentTextCollection.length !== 0) {
// tslint:disable-next-line
var documentIndex = this.documentTextCollection[pageIndex][pageIndex];
var pageTextData = documentIndex.pageText ? documentIndex.pageText : documentIndex.PageText;
if (this.documentTextCollection[pageIndex] && documentIndex) {
// tslint:disable-next-line:max-line-length
this.getSearchTextContent(pageIndex, this.searchString, pageTextData, textContents, isSinglePageSearch, this.documentTextCollection[pageIndex]);
}
}
}
else {
if (!isSinglePageSearch) {
this.createRequestForSearch(pageIndex);
if (storedData) {
// tslint:disable-next-line
pageText = storedData['pageText'];
// tslint:disable-next-line
textContents = storedData['textContent'];
characterBounds = this.pdfViewerBase.textLayer.characterBound[pageIndex];
this.textContents[pageIndex] = textContents;
this.getPossibleMatches(pageIndex, this.searchString, pageText, textContents, isSinglePageSearch, characterBounds);
}
else {
if (!isSinglePageSearch) {
this.createRequestForSearch(pageIndex);
}
}
}

@@ -305,37 +341,41 @@ };

TextSearch.prototype.getPossibleMatches = function (pageIndex, searchString, pageString, textContents, isSinglePageSearch, characterBounds) {
var pageText = pageString;
var searchText = searchString;
var queryLength = searchString.length;
if (!this.isMatchCase) {
searchText = searchString.toLowerCase();
pageText = pageString.toLowerCase();
}
var matches = [];
var matchIndex = -queryLength;
var newIndex = -queryLength;
while (matchIndex !== 0) {
if (searchText === '' || searchText === ' ' || !searchText) {
break;
if (this.searchMatches && !this.searchMatches[pageIndex]) {
var pageText = pageString;
var searchText = searchString;
var queryLength = searchString.length;
if (!this.isMatchCase) {
searchText = searchString.toLowerCase();
pageText = pageString.toLowerCase();
}
matchIndex = pageText.indexOf(searchText, matchIndex + queryLength);
if (searchText.indexOf(' ') !== -1) {
var newString = searchString.replace(' ', '\r\n');
newIndex = pageText.indexOf(newString, newIndex + queryLength);
if (!(newIndex <= -1)) {
if (newIndex < matchIndex) {
matches.push(newIndex);
var matches = [];
var matchIndex = -queryLength;
var newIndex = -queryLength;
while (matchIndex !== 0) {
if (searchText === '' || searchText === ' ' || !searchText) {
break;
}
matchIndex = pageText.indexOf(searchText, matchIndex + queryLength);
if (searchText.indexOf(' ') !== -1) {
var newString = searchString.replace(' ', '\r\n');
newIndex = pageText.indexOf(newString, newIndex + queryLength);
if (!(newIndex <= -1)) {
if (newIndex < matchIndex) {
matches.push(newIndex);
}
}
}
if (matchIndex <= -1 && newIndex <= -1) {
break;
}
if (!(matchIndex <= -1)) {
matches.push(matchIndex);
}
if (newIndex > matchIndex && !(newIndex <= -1)) {
matches.push(newIndex);
}
}
if (matchIndex <= -1 && newIndex <= -1) {
break;
if (this.searchMatches) {
this.searchMatches[pageIndex] = matches;
}
if (!(matchIndex <= -1)) {
matches.push(matchIndex);
}
if (newIndex > matchIndex && !(newIndex <= -1)) {
matches.push(newIndex);
}
}
this.searchMatches[pageIndex] = matches;
if (!isSinglePageSearch) {

@@ -347,3 +387,3 @@ if (this.searchedPages.indexOf(pageIndex) === -1) {

}
if (this.searchMatches[pageIndex].length !== 0) {
if (this.searchMatches && this.searchMatches[pageIndex] && this.searchMatches[pageIndex].length !== 0) {
if (!isSinglePageSearch) {

@@ -381,3 +421,3 @@ if (this.isPrevSearch) {

// tslint:disable-next-line:max-line-length
if (!this.searchMatches[this.searchPageIndex] && this.searchMatches.length === 0 && this.searchedPages.length === this.pdfViewerBase.pageCount) {
if (this.searchMatches && !this.searchMatches[this.searchPageIndex] && this.searchMatches.length === 0 && this.searchedPages.length === this.pdfViewerBase.pageCount) {
// tslint:disable-next-line:max-line-length

@@ -389,3 +429,3 @@ if (!this.isMessagePopupOpened) {

}
else if (this.searchMatches.length > 0 && (this.searchIndex === 0 || this.searchIndex === -1) && (searchPageIndex) === this.currentSearchIndex) {
else if (this.searchMatches && this.searchMatches.length > 0 && (this.searchIndex === 0 || this.searchIndex === -1) && (searchPageIndex) === this.currentSearchIndex) {
if (this.isPrevSearch) {

@@ -414,2 +454,43 @@ // tslint:disable-next-line:max-line-length

};
// tslint:disable-next-line
TextSearch.prototype.getSearchTextContent = function (pageIndex, searchString, pageString, textContents, isSinglePageSearch, characterBounds) {
var pageText = pageString;
var searchText = searchString;
var queryLength = searchString.length;
if (!this.isMatchCase) {
searchText = searchString.toLowerCase();
pageText = pageString.toLowerCase();
}
var matches = [];
var matchIndex = -queryLength;
var newIndex = -queryLength;
while (matchIndex !== 0) {
if (searchText === '' || searchText === ' ' || !searchText) {
break;
}
matchIndex = pageText.indexOf(searchText, matchIndex + queryLength);
if (searchText.indexOf(' ') !== -1) {
var newString = searchString.replace(' ', '\r\n');
newIndex = pageText.indexOf(newString, newIndex + queryLength);
if (!(newIndex <= -1)) {
if (newIndex < matchIndex) {
matches.push(newIndex);
}
}
}
if (matchIndex <= -1 && newIndex <= -1) {
break;
}
if (!(matchIndex <= -1)) {
matches.push(matchIndex);
}
if (newIndex > matchIndex && !(newIndex <= -1)) {
matches.push(newIndex);
}
}
if (matches.length !== 0) {
this.searchCount = this.searchCount + matches.length;
}
this.searchMatches[pageIndex] = matches;
};
TextSearch.prototype.getSearchPage = function (pageIndex) {

@@ -492,3 +573,5 @@ var pageNumber = null;

if (isNullOrUndefined(textLayer) && className === 'e-pv-search-text-highlight') {
this.pdfViewer.navigation.goToPage(pageIndex + 1);
if (this.pdfViewer.navigation) {
this.pdfViewer.navigation.goToPage(pageIndex + 1);
}
}

@@ -509,4 +592,6 @@ var count = this.searchMatches[pageIndex][index];

var left = 0;
left = characterBounds[count].X;
top = characterBounds[count].Y;
if (characterBounds[count]) {
left = characterBounds[count].X;
top = characterBounds[count].Y;
}
var v = 0;

@@ -518,11 +603,13 @@ if ((count - initial) !== 0) {

for (v = v; v < queryLength; v++) {
// tslint:disable-next-line
var charBound = characterBounds[count];
if (left > charBound.X) {
break;
if (characterBounds[count]) {
// tslint:disable-next-line
var charBound = characterBounds[count];
if (left > charBound.X) {
break;
}
top = (top < charBound.Y) ? top : charBound.Y;
var topDifference = (top < charBound.Y) ? (charBound.Y - top) : (top - charBound.Y);
height = (height > (topDifference + charBound.Height)) ? height : (topDifference + charBound.Height);
count++;
}
top = (top < charBound.Y) ? top : charBound.Y;
var topDifference = (top < charBound.Y) ? (charBound.Y - top) : (top - charBound.Y);
height = (height > (topDifference + charBound.Height)) ? height : (topDifference + charBound.Height);
count++;
}

@@ -532,7 +619,16 @@ var isContinuation = false;

isContinuation = true;
width = (characterBounds[count - 1].X - left);
if (characterBounds[count - 1]) {
width = (characterBounds[count - 1].X - left);
}
}
else {
isContinuation = false;
width = (characterBounds[count].X - left);
if (characterBounds[count]) {
width = (characterBounds[count].X - left);
}
else {
if (characterBounds[count - 1]) {
width = (characterBounds[count - 1].X - left);
}
}
}

@@ -627,10 +723,14 @@ this.createSearchTextDiv(index, pageIndex, height, width, top, left, className, isContinuation, divCount);

var textDiv = searchDivs[i];
var previousZoomFactor = 1;
if (this.pdfViewer.magnificationModule) {
previousZoomFactor = this.pdfViewer.magnificationModule.previousZoomFactor;
}
// tslint:disable-next-line
textDiv.style.width = (parseFloat(textDiv.style.width) / this.pdfViewer.magnificationModule.previousZoomFactor) * this.pdfViewerBase.getZoomFactor() + 'px';
textDiv.style.width = (parseFloat(textDiv.style.width) / previousZoomFactor) * this.pdfViewerBase.getZoomFactor() + 'px';
// tslint:disable-next-line
textDiv.style.height = (parseFloat(textDiv.style.height) / this.pdfViewer.magnificationModule.previousZoomFactor) * this.pdfViewerBase.getZoomFactor() + 'px';
textDiv.style.height = (parseFloat(textDiv.style.height) / previousZoomFactor) * this.pdfViewerBase.getZoomFactor() + 'px';
// tslint:disable-next-line
textDiv.style.top = (parseFloat(textDiv.style.top) / this.pdfViewer.magnificationModule.previousZoomFactor) * this.pdfViewerBase.getZoomFactor() + 'px';
textDiv.style.top = (parseFloat(textDiv.style.top) / previousZoomFactor) * this.pdfViewerBase.getZoomFactor() + 'px';
// tslint:disable-next-line
textDiv.style.left = (parseFloat(textDiv.style.left) / this.pdfViewer.magnificationModule.previousZoomFactor) * this.pdfViewerBase.getZoomFactor() + 'px';
textDiv.style.left = (parseFloat(textDiv.style.left) / previousZoomFactor) * this.pdfViewerBase.getZoomFactor() + 'px';
}

@@ -693,2 +793,5 @@ };

this.enablePrevButton(false);
this.documentTextCollection = [];
this.isTextRetrieved = false;
this.isTextSearched = false;
};

@@ -704,9 +807,14 @@ TextSearch.prototype.onTextSearchClose = function () {

var proxy = this;
var viewportWidth = 816;
var viewportHeight = this.pdfViewer.element.clientHeight;
var viewPortWidth = 816;
var viewPortHeight = this.pdfViewer.element.clientHeight;
var pageWidth = this.pdfViewerBase.pageSize[pageIndex].width;
var pageHeight = this.pdfViewerBase.pageSize[pageIndex].height;
var tileCount = this.pdfViewerBase.getTileCount(pageWidth);
var noTileX = viewportWidth >= pageWidth ? 1 : tileCount;
var noTileY = viewportWidth >= pageWidth ? 1 : tileCount;
var noTileX = viewPortWidth >= pageWidth ? 1 : tileCount;
var noTileY = viewPortWidth >= pageWidth ? 1 : tileCount;
var tileSettings = this.pdfViewer.tileRenderingSettings;
if (tileSettings.enableTileRendering && tileSettings.x > 0 && tileSettings.y > 0) {
noTileX = viewPortWidth >= pageWidth ? 1 : tileSettings.x;
noTileY = viewPortWidth >= pageWidth ? 1 : tileSettings.y;
}
for (var x = 0; x < noTileX; x++) {

@@ -716,3 +824,4 @@ for (var y = 0; y < noTileY; y++) {

// tslint:disable-next-line:max-line-length
jsonObject = { xCoordinate: 0, yCoordinate: 0, pageNumber: pageIndex, viwePortWidth: viewportWidth, viewportHeight: viewportHeight, documentId: proxy.pdfViewerBase.getDocumentId(), hashId: proxy.pdfViewerBase.hashId, zoomFactor: proxy.pdfViewerBase.getZoomFactor(), tilecount: tileCount, action: 'RenderPdfPages', elementId: proxy.pdfViewer.element.id, uniqueId: proxy.pdfViewerBase.documentId };
jsonObject = { xCoordinate: 0, yCoordinate: 0, pageNumber: pageIndex, viewPortWidth: viewPortWidth, viewPortHeight: viewPortHeight, documentId: proxy.pdfViewerBase.getDocumentId(), hashId: proxy.pdfViewerBase.hashId, zoomFactor: proxy.pdfViewerBase.getZoomFactor(), tilecount: tileCount, action: 'RenderPdfPages', elementId: proxy.pdfViewer.element.id, uniqueId: proxy.pdfViewerBase.documentId,
tileXCount: noTileX, tileYCount: noTileY };
if (this.pdfViewerBase.jsonDocumentId) {

@@ -743,3 +852,3 @@ // tslint:disable-next-line

var pageNumber = (data.pageNumber !== undefined) ? data.pageNumber : pageIndex;
if (viewportWidth >= pageWidth) {
if (viewPortWidth >= pageWidth) {
proxy.pdfViewerBase.storeWinData(data, pageNumber);

@@ -762,2 +871,3 @@ }

proxy.pdfViewerBase.openNotificationPopup();
// tslint:disable-next-line:max-line-length
proxy.pdfViewer.fireAjaxRequestFailed(result.status, result.statusText, this.pdfViewer.serverActionSettings.renderPages);

@@ -768,2 +878,110 @@ };

};
/**
* @private
*/
TextSearch.prototype.getPDFDocumentTexts = function () {
var startIndex = 0;
var endIndex = 50;
var pageCount = this.pdfViewerBase.pageCount;
if (endIndex >= pageCount) {
endIndex = pageCount;
}
this.createRequestForGetPdfTexts(startIndex, endIndex);
};
/**
* @private
*/
TextSearch.prototype.createRequestForGetPdfTexts = function (startIndex, endIndex) {
var proxy = this;
var jsonObject;
// tslint:disable-next-line:max-line-length
jsonObject = { pageStartIndex: startIndex, pageEndIndex: endIndex, documentId: proxy.pdfViewerBase.getDocumentId(), hashId: proxy.pdfViewerBase.hashId, action: 'Search', elementId: proxy.pdfViewer.element.id, uniqueId: proxy.pdfViewerBase.documentId };
if (this.pdfViewerBase.jsonDocumentId) {
// tslint:disable-next-line
jsonObject.documentId = this.pdfViewerBase.jsonDocumentId;
}
this.searchRequestHandler = new AjaxHandler(this.pdfViewer);
this.searchRequestHandler.url = this.pdfViewer.serviceUrl + '/' + this.pdfViewer.serverActionSettings.renderTexts;
this.searchRequestHandler.responseType = 'json';
this.searchRequestHandler.send(jsonObject);
// tslint:disable-next-line
this.searchRequestHandler.onSuccess = function (result) {
// tslint:disable-next-line
var data = result.data;
if (data) {
if (typeof data !== 'object') {
try {
data = JSON.parse(data);
}
catch (error) {
proxy.pdfViewerBase.onControlError(500, data, this.pdfViewer.serverActionSettings.renderTexts);
data = null;
}
}
if (data) {
if (data.documentTextCollection && data.uniqueId === proxy.pdfViewerBase.documentId) {
if (proxy.documentTextCollection.length > 0) {
proxy.documentTextCollection = data.documentTextCollection.concat(proxy.documentTextCollection);
proxy.documentTextCollection = proxy.orderPdfTextCollections(proxy.documentTextCollection);
}
else {
proxy.documentTextCollection = data.documentTextCollection;
}
var pageCount = proxy.pdfViewerBase.pageCount;
if (endIndex !== pageCount) {
startIndex = endIndex;
endIndex = endIndex + 50;
if (endIndex >= pageCount) {
endIndex = pageCount;
}
proxy.createRequestForGetPdfTexts(startIndex, endIndex);
}
else {
proxy.isTextRetrieved = true;
proxy.pdfViewer.fireTextExtractionCompleted(proxy.documentTextCollection);
if (proxy.isTextSearched && proxy.searchString.length > 0) {
proxy.textSearch(proxy.searchString);
proxy.isTextSearched = false;
}
}
}
}
}
};
// tslint:disable-next-line
this.searchRequestHandler.onFailure = function (result) {
proxy.pdfViewer.fireAjaxRequestFailed(result.status, result.statusText, this.pdfViewer.serverActionSettings.renderTexts);
};
// tslint:disable-next-line
this.searchRequestHandler.onError = function (result) {
proxy.pdfViewerBase.openNotificationPopup();
proxy.pdfViewer.fireAjaxRequestFailed(result.status, result.statusText, this.pdfViewer.serverActionSettings.renderTexts);
};
};
// tslint:disable-next-line
TextSearch.prototype.orderPdfTextCollections = function (oldCollection) {
// tslint:disable-next-line
var annotationCollectionList = [];
for (var i = 0; i < oldCollection.length; i++) {
if (annotationCollectionList.length === 0) {
annotationCollectionList.push(oldCollection[i]);
}
else {
// tslint:disable-next-line
if (parseInt(Object.keys(oldCollection[i])[0]) > parseInt(Object.keys(annotationCollectionList[annotationCollectionList.length - 1])[0])) {
annotationCollectionList.push(oldCollection[i]);
}
else {
for (var j = 0; j < annotationCollectionList.length; j++) {
// tslint:disable-next-line
if ((parseInt(Object.keys(oldCollection[i])[0]) < parseInt(Object.keys(annotationCollectionList[j])[0]))) {
annotationCollectionList.splice(j, 0, oldCollection[i]);
break;
}
}
}
}
}
return annotationCollectionList;
};
TextSearch.prototype.createSearchBoxButtons = function (id, className) {

@@ -770,0 +988,0 @@ // tslint:disable-next-line:max-line-length

@@ -31,3 +31,2 @@ import { PdfViewer, PdfViewerBase } from '../index';

* The `TextSelection` module is used to handle the text selection of PDF viewer.
* @hidden
*/

@@ -77,5 +76,14 @@ export declare class TextSelection {

textSelectionOnDrag(target: EventTarget, x: number, y: number, isforward: boolean): boolean;
selectTextRegion(pageNumbers: number, bounds: IRectangle[]): void;
/**
* @private
*/
checkLeftBounds(left: number, textDiVLeft: number, totalLeft: number, x: number): boolean;
/**
* @private
*/
checkTopBounds(top: number, currentTop: number, y: number): boolean;
/**
* @private
*/
textSelectionOnMouseLeave(event: MouseEvent): void;

@@ -101,5 +109,2 @@ private scrollForwardOnSelection;

enableTextSelectionMode(): void;
/**
* @private
*/
clearTextSelection(): void;

@@ -106,0 +111,0 @@ /**

@@ -155,2 +155,11 @@ import { AjaxHandler } from '../index';

}
if (proxy.pdfViewer.isThumbnailViewOpen) {
proxy.pdfViewerBase.navigationPane.isThumbnailOpen = true;
// tslint:disable-next-line:max-line-length
proxy.pdfViewerBase.navigationPane.sideBarTitle.textContent = proxy.pdfViewer.localeObj.getConstant('Page Thumbnails');
document.getElementById(proxy.pdfViewer.element.id + '_thumbnail_view').style.display = 'flex';
proxy.pdfViewerBase.navigationPane.setThumbnailSelectionIconTheme();
proxy.pdfViewerBase.navigationPane.updateViewerContainerOnExpand();
proxy.pdfViewerBase.navigationPane.isBookmarkOpen = false;
}
}

@@ -257,2 +266,12 @@ }

this.thumbnailImage.src = data.thumbnailImage[i];
if (this.pdfViewerBase.pageSize[i].height < this.pdfViewerBase.pageSize[i].width) {
this.thumbnailImage.style.height = '86px';
this.thumbnailImage.style.width = '126px';
thumbnail.style.height = '100px';
thumbnail.style.width = '140px';
pageLink.style.left = '-25px';
pageLink.style.position = 'relative';
thumbnailPageNumber.style.left = '18px';
thumbnailPageNumber.style.position = 'relative';
}
this.thumbnailSelectionRing.appendChild(this.thumbnailImage);

@@ -259,0 +278,0 @@ pageLink.appendChild(thumbnail);

@@ -74,2 +74,9 @@ import { PdfViewer, PdfViewerBase, Toolbar } from '../index';

private isShapeBtnVisible;
private isSignatureBtnVisible;
private isFontFamilyToolVisible;
private isFontSizeToolVisible;
private isFontAlignToolVisible;
private isFontColorToolVisible;
private isFontStylesToolVisible;
private isCommentPanelBtnVisible;
private isFreeTextBtnVisible;

@@ -104,3 +111,3 @@ private isCalibrateBtnVisible;

initializeAnnotationToolbar(): void;
createMobileAnnotationToolbar(isEnable: boolean): void;
createMobileAnnotationToolbar(isEnable: boolean, isPath?: boolean): void;
hideMobileAnnotationToolbar(): void;

@@ -113,2 +120,3 @@ private createMobileToolbarItems;

private addStampImage;
private checkStampAnnotations;
private createDropDowns;

@@ -188,2 +196,4 @@ private opacityDropDownOpen;

private handleFreeTextEditor;
private updateFontFamily;
private updateFontFamilyIcon;
/**

@@ -190,0 +200,0 @@ * @private

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc