@syncfusion/ej2-pdfviewer
Advanced tools
Comparing version 17.2.41 to 17.2.46
@@ -5,2 +5,33 @@ # Changelog | ||
### PDF Viewer | ||
#### Breaking Changes | ||
- The following API is renamed. | ||
| Existing API name| New API Name | | ||
|------|-------------| | ||
| toolbarItem| toolbarItems| | ||
#### New Features | ||
- ‘#223065’, ‘#234860’, ‘#241770’, ‘#241487’, ‘#229426’, ‘#244801’ – Provided the support for importing and exporting the annotation details as a JSON object. | ||
#### Bug Fixes | ||
- ‘#243837’ – Exception will no longer be thrown while loading the PDF document as FileStream. | ||
## 17.2.41 (2019-08-14) | ||
### PDF Viewer | ||
#### Bug Fixes | ||
- #241487, #243077 - Annotation author name is now updated properly in the comment panel. | ||
- #242804 - The Bookmark's destination value is now maintained properly during navigation. | ||
- #241487 - The provided PDF document will now be loaded properly in the PDF Viewer control. | ||
- #244437 - Resolved the typo errors in the PDF Viewer toolbar content. | ||
- #244654 - The editAnnotation API is now working properly. | ||
- #243134 - The PDF documents load properly when render the PDF Viewer control under multiple tab with fitToPage view mode during initial loading. | ||
## 17.2.40 (2019-08-06) | ||
@@ -7,0 +38,0 @@ |
/*! | ||
* filename: index.d.ts | ||
* version : 17.2.41 | ||
* version : 17.2.46 | ||
* Copyright Syncfusion Inc. 2001 - 2019. All rights reserved. | ||
@@ -5,0 +5,0 @@ * Use of this code is subject to the terms of our license. |
{ | ||
"_from": "@syncfusion/ej2-pdfviewer@*", | ||
"_id": "@syncfusion/ej2-pdfviewer@17.2.40", | ||
"_id": "@syncfusion/ej2-pdfviewer@17.2.41", | ||
"_inBundle": false, | ||
"_integrity": "sha512-AXGjzQdVY4qtY3l/5AmX+O7B/rDONeX6fkfK7ctLRo6VpTdr/Ylv4C5fZf+AE4t+iDePozWgj5HMBOS1Wd+Pcw==", | ||
"_integrity": "sha512-/qqOfGmT/OyQj/Q3u9jlSKFhOt0LjybT+tNBT3UYS8jfrWXsoa9pm5/AjMuqzirPEuZacll8U4ksqhL3++ITpw==", | ||
"_location": "/@syncfusion/ej2-pdfviewer", | ||
@@ -26,4 +26,4 @@ "_phantomChildren": {}, | ||
], | ||
"_resolved": "http://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-pdfviewer/-/ej2-pdfviewer-17.2.40.tgz", | ||
"_shasum": "ab20e5197f41b6a5d84e86af837df663f0a5d9da", | ||
"_resolved": "http://nexus.syncfusion.com/repository/ej2-release/@syncfusion/ej2-pdfviewer/-/ej2-pdfviewer-17.2.41.tgz", | ||
"_shasum": "ac1507db7426590862e502319309a097162c3184", | ||
"_spec": "@syncfusion/ej2-pdfviewer@*", | ||
@@ -39,15 +39,15 @@ "_where": "/jenkins/workspace/ation_hotfix_16.4.0.42_Vol4-CJVRBFC7Z7RSISPRJNEMNQSRMCB6XTG67IJD6R2DVNXFIKQEITTQ/packages/included", | ||
"dependencies": { | ||
"@syncfusion/ej2-base": "~17.2.40", | ||
"@syncfusion/ej2-buttons": "~17.2.35", | ||
"@syncfusion/ej2-calendars": "~17.2.41", | ||
"@syncfusion/ej2-data": "~17.2.39", | ||
"@syncfusion/ej2-drawings": "~17.2.34", | ||
"@syncfusion/ej2-dropdowns": "~17.2.41", | ||
"@syncfusion/ej2-inplace-editor": "~17.2.40", | ||
"@syncfusion/ej2-inputs": "~17.2.41", | ||
"@syncfusion/ej2-lists": "~17.2.34", | ||
"@syncfusion/ej2-navigations": "~17.2.41", | ||
"@syncfusion/ej2-notifications": "~17.2.40", | ||
"@syncfusion/ej2-popups": "~17.2.35", | ||
"@syncfusion/ej2-richtexteditor": "~17.2.41" | ||
"@syncfusion/ej2-base": "~17.2.46", | ||
"@syncfusion/ej2-buttons": "~17.2.46", | ||
"@syncfusion/ej2-calendars": "~17.2.46", | ||
"@syncfusion/ej2-data": "~17.2.46", | ||
"@syncfusion/ej2-drawings": "~17.2.46", | ||
"@syncfusion/ej2-dropdowns": "~17.2.46", | ||
"@syncfusion/ej2-inplace-editor": "~17.2.46", | ||
"@syncfusion/ej2-inputs": "~17.2.46", | ||
"@syncfusion/ej2-lists": "~17.2.46", | ||
"@syncfusion/ej2-navigations": "~17.2.46", | ||
"@syncfusion/ej2-notifications": "~17.2.46", | ||
"@syncfusion/ej2-popups": "~17.2.46", | ||
"@syncfusion/ej2-richtexteditor": "~17.2.46" | ||
}, | ||
@@ -78,4 +78,4 @@ "deprecated": false, | ||
"typings": "index.d.ts", | ||
"version": "17.2.41", | ||
"version": "17.2.46", | ||
"sideEffects": false | ||
} |
@@ -143,3 +143,3 @@ 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 { AnnotationType } from './enum';import { ICommentsCollection, IReviewCollection } from '../pdfviewer'; | ||
* Represents the path data of the annotation | ||
* @default 'string' | ||
* @default '' | ||
*/ | ||
@@ -192,3 +192,3 @@ data?: string; | ||
* Represents the height of the leader of distance shapes | ||
* @default 0 | ||
* @default 40 | ||
*/ | ||
@@ -217,3 +217,3 @@ leaderHeight?: number; | ||
* Represents vertex points in the line annotation or shape annotation. | ||
* @default [] | ||
* @default null | ||
*/ | ||
@@ -224,3 +224,3 @@ sourcePoint?: PointModel; | ||
* Represents vertex points in the line annotation or shape annotation. | ||
* @default [] | ||
* @default None | ||
*/ | ||
@@ -231,3 +231,3 @@ sourceDecoraterShapes?: DecoratorShapes; | ||
* Represents vertex points in the line annotation or shape annotation. | ||
* @default [] | ||
* @default None | ||
*/ | ||
@@ -238,3 +238,3 @@ taregetDecoraterShapes?: DecoratorShapes; | ||
* Represents vertex points in the line annotation or shape annotation. | ||
* @default [] | ||
* @default null | ||
*/ | ||
@@ -251,3 +251,3 @@ targetPoint?: PointModel; | ||
* Represents bounds of the annotation | ||
* @default '' | ||
* @default new Point(0,0) | ||
*/ | ||
@@ -271,3 +271,3 @@ bounds?: PdfBoundsModel; | ||
* Represents the cloud intensity | ||
* @default -1 | ||
* @default null | ||
*/ | ||
@@ -278,3 +278,3 @@ wrapper?: Container; | ||
* Represents the dynamic stamp | ||
* @default -1 | ||
* @default false | ||
*/ | ||
@@ -285,3 +285,3 @@ isDynamicStamp?: boolean; | ||
* Represents the dynamic text. | ||
* @default -1 | ||
* @default '' | ||
*/ | ||
@@ -288,0 +288,0 @@ dynamicText?: string; |
@@ -126,3 +126,3 @@ import { ChildProperty } from '@syncfusion/ej2-base'; | ||
* Represents the path data of the annotation | ||
* @default 'string' | ||
* @default '' | ||
*/ | ||
@@ -167,3 +167,3 @@ data: string; | ||
* Represents the height of the leader of distance shapes | ||
* @default 0 | ||
* @default 40 | ||
*/ | ||
@@ -188,3 +188,3 @@ leaderHeight: number; | ||
* Represents vertex points in the line annotation or shape annotation. | ||
* @default [] | ||
* @default null | ||
*/ | ||
@@ -194,3 +194,3 @@ sourcePoint: PointModel; | ||
* Represents vertex points in the line annotation or shape annotation. | ||
* @default [] | ||
* @default None | ||
*/ | ||
@@ -200,3 +200,3 @@ sourceDecoraterShapes: DecoratorShapes; | ||
* Represents vertex points in the line annotation or shape annotation. | ||
* @default [] | ||
* @default None | ||
*/ | ||
@@ -206,3 +206,3 @@ taregetDecoraterShapes: DecoratorShapes; | ||
* Represents vertex points in the line annotation or shape annotation. | ||
* @default [] | ||
* @default null | ||
*/ | ||
@@ -217,3 +217,3 @@ targetPoint: PointModel; | ||
* Represents bounds of the annotation | ||
* @default '' | ||
* @default new Point(0,0) | ||
*/ | ||
@@ -233,3 +233,3 @@ bounds: PdfBoundsModel; | ||
* Represents the cloud intensity | ||
* @default -1 | ||
* @default null | ||
*/ | ||
@@ -239,3 +239,3 @@ wrapper: Container; | ||
* Represents the dynamic stamp | ||
* @default -1 | ||
* @default false | ||
*/ | ||
@@ -245,3 +245,3 @@ isDynamicStamp: boolean; | ||
* Represents the dynamic text. | ||
* @default -1 | ||
* @default '' | ||
*/ | ||
@@ -248,0 +248,0 @@ dynamicText: string; |
@@ -251,3 +251,3 @@ import { PdfViewer, PdfViewerBase, AnnotationType, TextMarkupAnnotation, ShapeAnnotation, StampAnnotation, StickyNotesAnnotation, IPopupAnnotation, MeasureAnnotation } from '../index'; | ||
*/ | ||
getAnnotationComments(commentsAnnotations: any, parentAnnotation: any): any; | ||
getAnnotationComments(commentsAnnotations: any, parentAnnotation: any, author: string): any; | ||
private getRandomNumber; | ||
@@ -296,2 +296,6 @@ /** | ||
*/ | ||
updateAnnotationAuthor(annotationType: string, annotationSubType?: string): string; | ||
/** | ||
* @private | ||
*/ | ||
clear(): void; | ||
@@ -298,0 +302,0 @@ /** |
@@ -266,2 +266,6 @@ import { PdfViewer, PdfViewerBase, IRectangle, AnnotationType as AnnotType } from '../../index'; | ||
private getRgbCode; | ||
/** | ||
* @private | ||
*/ | ||
saveImportedMeasureAnnotations(annotation: any, pageNumber: number): any; | ||
} |
@@ -69,2 +69,3 @@ import { ColorPicker, NumericTextBox } from '@syncfusion/ej2-inputs'; | ||
if (annotation.ShapeAnnotationType) { | ||
annotation.Author = this.pdfViewer.annotationModule.updateAnnotationAuthor('measure', annotation.Subject); | ||
var vertexPoints = null; | ||
@@ -97,3 +98,3 @@ if (annotation.VertexPoints) { | ||
// tslint:disable-next-line:max-line-length | ||
leaderLineOffset: annotation.LeaderLineOffset, indent: annotation.Indent, annotName: annotation.AnnotName, comments: this.pdfViewer.annotationModule.getAnnotationComments(annotation.Comments, annotation), | ||
leaderLineOffset: annotation.LeaderLineOffset, indent: annotation.Indent, annotName: annotation.AnnotName, comments: this.pdfViewer.annotationModule.getAnnotationComments(annotation.Comments, annotation, annotation.Author), | ||
review: { state: annotation.State, stateModel: annotation.StateModel, modifiedDate: annotation.ModifiedDate, author: annotation.Author } | ||
@@ -209,2 +210,3 @@ }; | ||
annotationModel.annotName = annotationName; | ||
annotationModel.author = this.pdfViewer.annotationModule.updateAnnotationAuthor('measure', annotationModel.subject); | ||
this.pdfViewer.annotation.stickyNotesAnnotationModule.addTextToComments(annotationName, annotationModel.notes); | ||
@@ -330,5 +332,7 @@ if (annotationModel.wrapper.bounds) { | ||
var numberFormatArray = new Array(); | ||
for (var i = 0; i < list.length; i++) { | ||
// tslint:disable-next-line:max-line-length | ||
numberFormatArray[i] = { unit: list[i].Unit, fractionalType: list[i].FractionalType, conversionFactor: list[i].ConversionFactor, denominator: list[i].Denominator, formatDenominator: list[i].FormatDenominator }; | ||
if (list) { | ||
for (var i = 0; i < list.length; i++) { | ||
// tslint:disable-next-line:max-line-length | ||
numberFormatArray[i] = { unit: list[i].Unit, fractionalType: list[i].FractionalType, conversionFactor: list[i].ConversionFactor, denominator: list[i].Denominator, formatDenominator: list[i].FormatDenominator }; | ||
} | ||
} | ||
@@ -828,4 +832,43 @@ return numberFormatArray; | ||
}; | ||
/** | ||
* @private | ||
*/ | ||
// tslint:disable-next-line | ||
MeasureAnnotation.prototype.saveImportedMeasureAnnotations = function (annotation, pageNumber) { | ||
var annotationObject = null; | ||
var vertexPoints = null; | ||
if (annotation.VertexPoints) { | ||
vertexPoints = []; | ||
for (var j = 0; j < annotation.VertexPoints.length; j++) { | ||
var point = { x: annotation.VertexPoints[j].X, y: annotation.VertexPoints[j].Y }; | ||
vertexPoints.push(point); | ||
} | ||
} | ||
var measureObject = { | ||
// tslint:disable-next-line:max-line-length | ||
ratio: annotation.Calibrate.Ratio, x: this.getNumberFormatArray(annotation.Calibrate.X), distance: this.getNumberFormatArray(annotation.Calibrate.Distance), area: this.getNumberFormatArray(annotation.Calibrate.Area), angle: this.getNumberFormatArray(annotation.Calibrate.Angle), volume: this.getNumberFormatArray(annotation.Calibrate.Volume), | ||
targetUnitConversion: annotation.Calibrate.TargetUnitConversion | ||
}; | ||
if (annotation.Calibrate.Depth) { | ||
measureObject.depth = annotation.Calibrate.Depth; | ||
} | ||
annotation.Author = this.pdfViewer.annotationModule.updateAnnotationAuthor('measure', annotation.Subject); | ||
annotationObject = { | ||
// tslint:disable-next-line:max-line-length | ||
id: 'measure', shapeAnnotationType: annotation.ShapeAnnotationType, author: annotation.Author, modifiedDate: annotation.ModifiedDate, subject: annotation.Subject, | ||
note: annotation.Note, strokeColor: annotation.StrokeColor, fillColor: annotation.FillColor, opacity: annotation.Opacity, thickness: annotation.Thickness, rectangleDifference: annotation.RectangleDifference, | ||
// tslint:disable-next-line:max-line-length | ||
borderStyle: annotation.BorderStyle, borderDashArray: annotation.BorderDashArray, rotateAngle: annotation.RotateAngle, isCloudShape: annotation.IsCloudShape, | ||
cloudIntensity: annotation.CloudIntensity, vertexPoints: vertexPoints, lineHeadStart: annotation.LineHeadStart, lineHeadEnd: annotation.LineHeadEnd, isLocked: annotation.IsLocked, | ||
// tslint:disable-next-line:max-line-length | ||
bounds: { left: annotation.Bounds.X, top: annotation.Bounds.Y, width: annotation.Bounds.Width, height: annotation.Bounds.Height, right: annotation.Bounds.Right, bottom: annotation.Bounds.Bottom }, | ||
caption: annotation.Caption, captionPosition: annotation.CaptionPosition, calibrate: measureObject, leaderLength: annotation.LeaderLength, leaderLineExtension: annotation.LeaderLineExtension, | ||
// tslint:disable-next-line:max-line-length | ||
leaderLineOffset: annotation.LeaderLineOffset, indent: annotation.Indent, annotName: annotation.AnnotName, comments: this.pdfViewer.annotationModule.getAnnotationComments(annotation.Comments, annotation, annotation.Author), | ||
review: { state: annotation.State, stateModel: annotation.StateModel, modifiedDate: annotation.ModifiedDate, author: annotation.Author } | ||
}; | ||
this.pdfViewer.annotationModule.storeAnnotations(pageNumber, annotationObject, '_annotations_shape_measure'); | ||
}; | ||
return MeasureAnnotation; | ||
}()); | ||
export { MeasureAnnotation }; |
@@ -147,3 +147,2 @@ import { PdfViewer, PdfViewerBase, IRectangle, ICommentsCollection, IReviewCollection, AnnotationType as AnnotType, LineHeadStyle } from '../../index'; | ||
arrowEndHead: LineHeadStyle; | ||
private author; | ||
constructor(pdfviewer: PdfViewer, pdfViewerBase: PdfViewerBase); | ||
@@ -177,2 +176,6 @@ /** | ||
private getRgbCode; | ||
/** | ||
* @private | ||
*/ | ||
saveImportedShapeAnnotations(annotation: any, pageNumber: number): any; | ||
} |
@@ -36,3 +36,2 @@ import { isNullOrUndefined } from '@syncfusion/ej2-base'; | ||
this.polygonOpacity = this.pdfViewer.polygonSettings.opacity ? this.pdfViewer.polygonSettings.opacity : 1; | ||
this.author = this.pdfViewer.lineSettings.author; | ||
} | ||
@@ -51,2 +50,8 @@ /** | ||
if (annotation.ShapeAnnotationType) { | ||
if (annotation.Subject === 'Line' && annotation.ShapeAnnotationType === 'Polygon') { | ||
annotation.Author = this.pdfViewer.annotationModule.updateAnnotationAuthor('shape', 'Polygon'); | ||
} | ||
else { | ||
annotation.Author = this.pdfViewer.annotationModule.updateAnnotationAuthor('shape', annotation.Subject); | ||
} | ||
var vertexPoints = null; | ||
@@ -62,3 +67,3 @@ if (annotation.VertexPoints) { | ||
annotationObject = { | ||
id: 'shape' + i, shapeAnnotationType: annotation.ShapeAnnotationType, author: this.author, modifiedDate: annotation.ModifiedDate, subject: annotation.Subject, | ||
id: 'shape' + i, shapeAnnotationType: annotation.ShapeAnnotationType, author: annotation.Author, modifiedDate: annotation.ModifiedDate, subject: annotation.Subject, | ||
// tslint:disable-next-line:max-line-length | ||
@@ -68,3 +73,3 @@ note: annotation.Note, strokeColor: annotation.StrokeColor, fillColor: annotation.FillColor, opacity: annotation.Opacity, thickness: annotation.Thickness, rectangleDifference: annotation.RectangleDifference, | ||
// tslint:disable-next-line:max-line-length | ||
cloudIntensity: annotation.CloudIntensity, vertexPoints: vertexPoints, lineHeadStart: annotation.LineHeadStart, lineHeadEnd: annotation.LineHeadEnd, isLocked: annotation.IsLocked, comments: this.pdfViewer.annotationModule.getAnnotationComments(annotation.Comments, annotation), review: { state: annotation.State, stateModel: annotation.StateModel, modifiedDate: annotation.ModifiedDate, author: this.author }, annotName: annotation.AnnotName, | ||
cloudIntensity: annotation.CloudIntensity, vertexPoints: vertexPoints, lineHeadStart: annotation.LineHeadStart, lineHeadEnd: annotation.LineHeadEnd, isLocked: annotation.IsLocked, comments: this.pdfViewer.annotationModule.getAnnotationComments(annotation.Comments, annotation, annotation.Author), review: { state: annotation.State, stateModel: annotation.StateModel, modifiedDate: annotation.ModifiedDate, author: annotation.Author }, annotName: annotation.AnnotName, | ||
bounds: { left: annotation.Bounds.X, top: annotation.Bounds.Y, width: annotation.Bounds.Width, height: annotation.Bounds.Height, right: annotation.Bounds.Right, bottom: annotation.Bounds.Bottom } | ||
@@ -80,3 +85,3 @@ }; | ||
// tslint:disable-next-line:max-line-length | ||
id: 'shape' + i, shapeAnnotationType: this.getShapeType(annotationObject), author: this.author, modifiedDate: annotationObject.modifiedDate, annotName: annotationObject.annotName, | ||
id: 'shape' + i, shapeAnnotationType: this.getShapeType(annotationObject), author: annotationObject.author, modifiedDate: annotationObject.modifiedDate, annotName: annotationObject.annotName, | ||
subject: annotationObject.subject, notes: annotationObject.note, fillColor: annotationObject.fillColor, strokeColor: annotationObject.strokeColor, opacity: annotationObject.opacity, | ||
@@ -411,2 +416,8 @@ // tslint:disable-next-line:max-line-length | ||
} | ||
if (annotationModel.subject === 'Line' && annotationModel.shapeAnnotationType === 'Polygon') { | ||
annotationModel.author = this.pdfViewer.annotationModule.updateAnnotationAuthor('shape', 'Polygon'); | ||
} | ||
else { | ||
annotationModel.author = this.pdfViewer.annotationModule.updateAnnotationAuthor('shape', annotationModel.subject); | ||
} | ||
// tslint:disable-next-line:radix | ||
@@ -418,4 +429,4 @@ var borderDashArray = parseInt(annotationModel.borderDashArray); | ||
// tslint:disable-next-line:max-line-length | ||
id: annotationModel.id, shapeAnnotationType: this.getShapeAnnotType(annotationModel.shapeAnnotationType), author: this.author, subject: annotationModel.subject, note: annotationModel.notes, | ||
strokeColor: annotationModel.strokeColor, annotName: annotationName, comments: [], review: { state: '', stateModel: '', modifiedDate: date.toLocaleString(), author: this.author }, | ||
id: annotationModel.id, shapeAnnotationType: this.getShapeAnnotType(annotationModel.shapeAnnotationType), author: annotationModel.author, subject: annotationModel.subject, note: annotationModel.notes, | ||
strokeColor: annotationModel.strokeColor, annotName: annotationName, comments: [], review: { state: '', stateModel: '', modifiedDate: date.toLocaleString(), author: annotationModel.author }, | ||
fillColor: annotationModel.fillColor, opacity: annotationModel.opacity, thickness: annotationModel.thickness, | ||
@@ -469,4 +480,31 @@ // tslint:disable-next-line:max-line-length | ||
}; | ||
/** | ||
* @private | ||
*/ | ||
// tslint:disable-next-line | ||
ShapeAnnotation.prototype.saveImportedShapeAnnotations = function (annotation, pageNumber) { | ||
var annotationObject = null; | ||
var vertexPoints = null; | ||
annotation.Author = this.pdfViewer.annotationModule.updateAnnotationAuthor('shape', annotation.Subject); | ||
if (annotation.VertexPoints) { | ||
vertexPoints = []; | ||
for (var j = 0; j < annotation.VertexPoints.length; j++) { | ||
var point = { x: annotation.VertexPoints[j].X, y: annotation.VertexPoints[j].Y }; | ||
vertexPoints.push(point); | ||
} | ||
} | ||
// tslint:disable-next-line:max-line-length | ||
annotationObject = { | ||
id: 'shape', shapeAnnotationType: annotation.ShapeAnnotationType, author: annotation.Author, modifiedDate: annotation.ModifiedDate, subject: annotation.Subject, | ||
// tslint:disable-next-line:max-line-length | ||
note: annotation.Note, strokeColor: annotation.StrokeColor, fillColor: annotation.FillColor, opacity: annotation.Opacity, thickness: annotation.Thickness, rectangleDifference: annotation.RectangleDifference, | ||
borderStyle: annotation.BorderStyle, borderDashArray: annotation.BorderDashArray, rotateAngle: annotation.RotateAngle, isCloudShape: annotation.IsCloudShape, | ||
// tslint:disable-next-line:max-line-length | ||
cloudIntensity: annotation.CloudIntensity, vertexPoints: vertexPoints, lineHeadStart: annotation.LineHeadStart, lineHeadEnd: annotation.LineHeadEnd, isLocked: annotation.IsLocked, comments: this.pdfViewer.annotationModule.getAnnotationComments(annotation.Comments, annotation, annotation.Author), review: { state: annotation.State, stateModel: annotation.StateModel, modifiedDate: annotation.ModifiedDate, author: annotation.Author }, annotName: annotation.AnnotName, | ||
bounds: { left: annotation.Bounds.X, top: annotation.Bounds.Y, width: annotation.Bounds.Width, height: annotation.Bounds.Height, right: annotation.Bounds.Right, bottom: annotation.Bounds.Bottom } | ||
}; | ||
this.pdfViewer.annotationModule.storeAnnotations(pageNumber, annotationObject, '_annotations_shape'); | ||
}; | ||
return ShapeAnnotation; | ||
}()); | ||
export { ShapeAnnotation }; |
@@ -71,3 +71,3 @@ import { PdfAnnotationBase } from '../../diagram/pdf-annotation'; | ||
*/ | ||
renderStampAnnotations(stampAnnotations: any, pageNumber: number, canvass?: any): void; | ||
renderStampAnnotations(stampAnnotations: any, pageNumber: number, canvass?: any, isImport?: boolean): void; | ||
/** | ||
@@ -120,3 +120,7 @@ * @private | ||
updateSessionStorage(annotation: any, id: any, type: String): any; | ||
/** | ||
* @private | ||
*/ | ||
saveImportedStampAnnotations(annotation: any, pageNumber: number): any; | ||
} | ||
export {}; |
@@ -71,3 +71,2 @@ import { PdfViewerBase, PdfViewer } from '../index'; | ||
isEditableElement: boolean; | ||
private author; | ||
/** | ||
@@ -90,7 +89,7 @@ * @private | ||
*/ | ||
renderStickyNotesAnnotations(stickyAnnotations: any, pageNumber: number): void; | ||
renderStickyNotesAnnotations(stickyAnnotations: any, pageNumber: number, canvas?: any): void; | ||
/** | ||
* @private | ||
*/ | ||
drawStickyNotes(X: number, Y: number, width: number, height: number, pageIndex: number, annotation: any): any; | ||
drawStickyNotes(X: number, Y: number, width: number, height: number, pageIndex: number, annotation: any, canvas?: any): any; | ||
/** | ||
@@ -100,6 +99,9 @@ * @private | ||
createRequestForComments(): void; | ||
private renderAnnotationComments; | ||
/** | ||
* @private | ||
*/ | ||
renderAnnotationComments(data: any, pageIndex: number): void; | ||
/** | ||
* @private | ||
*/ | ||
initializeAcccordionContainer(): void; | ||
@@ -212,2 +214,6 @@ /** | ||
*/ | ||
saveImportedStickyNotesAnnotations(annotation: any, pageNumber: number): any; | ||
/** | ||
* @private | ||
*/ | ||
clear(): void; | ||
@@ -214,0 +220,0 @@ /** |
@@ -78,3 +78,2 @@ import { PdfViewer, PdfViewerBase, IRectangle, ICommentsCollection, IReviewCollection } from '../index'; | ||
private currentAnnotationIndex; | ||
private author; | ||
/** | ||
@@ -107,3 +106,3 @@ * @private | ||
*/ | ||
printTextMarkupAnnotations(textMarkupAnnotations: any, pageIndex: number, stampData: any, shapeData: any): string; | ||
printTextMarkupAnnotations(textMarkupAnnotations: any, pageIndex: number, stampData: any, shapeData: any, measureShapeData: any, stickyData: any): string; | ||
/** | ||
@@ -201,3 +200,7 @@ * @private | ||
*/ | ||
saveImportedTextMarkupAnnotations(annotation: any, pageNumber: number): any; | ||
/** | ||
* @private | ||
*/ | ||
clear(): void; | ||
} |
@@ -33,3 +33,2 @@ import { createElement, Browser, isNullOrUndefined } from '@syncfusion/ej2-base'; | ||
this.strikethroughOpacity = pdfViewer.strikethroughSettings.opacity; | ||
this.author = pdfViewer.highlightSettings.author; | ||
} | ||
@@ -69,7 +68,8 @@ /** | ||
var annotation = annotations[i]; | ||
annotation.Author = this.pdfViewer.annotationModule.updateAnnotationAuthor('textMarkup', annotation.Subject); | ||
var annotationObject = null; | ||
if (annotation.TextMarkupAnnotationType) { | ||
// tslint:disable-next-line:max-line-length | ||
annotationObject = { textMarkupAnnotationType: annotation.TextMarkupAnnotationType, color: annotation.Color, opacity: annotation.Opacity, bounds: annotation.Bounds, author: this.author, subject: annotation.Subject, modifiedDate: annotation.ModifiedDate, note: annotation.Note, rect: annotation.Rect, | ||
annotName: annotation.AnnotName, comments: this.pdfViewer.annotationModule.getAnnotationComments(annotation.Comments, annotation), review: { state: annotation.State, stateModel: annotation.StateModel, modifiedDate: annotation.ModifiedDate, author: this.author }, shapeAnnotationType: 'textMarkup' }; | ||
annotationObject = { textMarkupAnnotationType: annotation.TextMarkupAnnotationType, color: annotation.Color, opacity: annotation.Opacity, bounds: annotation.Bounds, author: annotation.Author, subject: annotation.Subject, modifiedDate: annotation.ModifiedDate, note: annotation.Note, rect: annotation.Rect, | ||
annotName: annotation.AnnotName, comments: this.pdfViewer.annotationModule.getAnnotationComments(annotation.Comments, annotation, annotation.Author), review: { state: annotation.State, stateModel: annotation.StateModel, modifiedDate: annotation.ModifiedDate, author: annotation.Author }, shapeAnnotationType: 'textMarkup' }; | ||
this.pdfViewer.annotationModule.storeAnnotations(pageNumber, annotationObject, '_annotations_textMarkup'); | ||
@@ -159,3 +159,3 @@ } | ||
// tslint:disable-next-line | ||
var settings = { opacity: annotation.opacity, color: annotation.color, author: this.author, subject: annotation.subject, modifiedDate: annotation.modifiedDate }; | ||
var settings = { opacity: annotation.opacity, color: annotation.color, author: annotation.author, subject: annotation.subject, modifiedDate: annotation.modifiedDate }; | ||
var index = this.pdfViewer.annotationModule.actionCollection[this.pdfViewer.annotationModule.actionCollection.length - 1].index; | ||
@@ -225,3 +225,3 @@ this.pdfViewer.fireAnnotationAdd(pageNumber, index, type, annotation.rect, settings); | ||
// tslint:disable-next-line | ||
TextMarkupAnnotation.prototype.printTextMarkupAnnotations = function (textMarkupAnnotations, pageIndex, stampData, shapeData) { | ||
TextMarkupAnnotation.prototype.printTextMarkupAnnotations = function (textMarkupAnnotations, pageIndex, stampData, shapeData, measureShapeData, stickyData) { | ||
var canvas = createElement('canvas', { id: this.pdfViewer.element.id + '_print_annotation_layer_' + pageIndex }); | ||
@@ -237,9 +237,14 @@ canvas.style.width = 816 + 'px'; | ||
// tslint:disable-next-line | ||
var measureShapeAnnotation = this.getAnnotations(pageIndex, null, '_annotations_shape_measure'); | ||
// tslint:disable-next-line | ||
var stampAnnotation = this.getAnnotations(pageIndex, null, '_annotations_stamp'); | ||
if (stampAnnotation || shapeAnnotation) { | ||
// tslint:disable-next-line | ||
var stickyNoteAnnotation = this.getAnnotations(pageIndex, null, '_annotations_sticky'); | ||
if (stampAnnotation || shapeAnnotation || stickyNoteAnnotation || measureShapeAnnotation) { | ||
this.pdfViewer.renderDrawing(canvas, pageIndex); | ||
} | ||
else { | ||
this.pdfViewer.annotation.renderAnnotations(pageIndex, shapeData, null, null, canvas); | ||
this.pdfViewer.annotation.renderAnnotations(pageIndex, shapeData, measureShapeData, null, canvas); | ||
this.pdfViewer.annotation.stampAnnotationModule.renderStampAnnotations(stampData, pageIndex, canvas); | ||
this.pdfViewer.annotation.stickyNotesAnnotationModule.renderStickyNotesAnnotations(stickyData, pageIndex, canvas); | ||
} | ||
@@ -822,3 +827,3 @@ if (textMarkupannotations) { | ||
// tslint:disable-next-line:max-line-length | ||
this.pdfViewer.annotationModule.showPopupNote(event, annotation.color, this.author, annotation.note, annotation.textMarkupAnnotationType); | ||
this.pdfViewer.annotationModule.showPopupNote(event, annotation.color, annotation.author, annotation.note, annotation.textMarkupAnnotationType); | ||
} | ||
@@ -1075,3 +1080,3 @@ }; | ||
textMarkupAnnotationType: type, color: color, opacity: opacity, bounds: bounds, author: author, subject: subject, modifiedDate: modifiedDate, note: note, rect: rect, | ||
annotName: annotationName, comments: [], review: { state: '', stateModel: '', author: 'Author', modifiedDate: modifiedDate }, shapeAnnotationType: 'textMarkup' | ||
annotName: annotationName, comments: [], review: { state: '', stateModel: '', author: author, modifiedDate: modifiedDate }, shapeAnnotationType: 'textMarkup' | ||
}; | ||
@@ -1118,2 +1123,14 @@ if (document.getElementById(annotationName)) { | ||
*/ | ||
// tslint:disable-next-line | ||
TextMarkupAnnotation.prototype.saveImportedTextMarkupAnnotations = function (annotation, pageNumber) { | ||
var annotationObject = null; | ||
annotation.Author = this.pdfViewer.annotationModule.updateAnnotationAuthor('textMarkup', annotation.Subject); | ||
// tslint:disable-next-line:max-line-length | ||
annotationObject = { textMarkupAnnotationType: annotation.TextMarkupAnnotationType, color: annotation.Color, opacity: annotation.Opacity, bounds: annotation.Bounds, author: annotation.Author, subject: annotation.Subject, modifiedDate: annotation.ModifiedDate, note: annotation.Note, rect: annotation.Rect, | ||
annotName: annotation.AnnotName, comments: this.pdfViewer.annotationModule.getAnnotationComments(annotation.Comments, annotation, annotation.Author), review: { state: annotation.State, stateModel: annotation.StateModel, modifiedDate: annotation.ModifiedDate, author: annotation.Author }, shapeAnnotationType: 'textMarkup' }; | ||
this.pdfViewer.annotationModule.storeAnnotations(pageNumber, annotationObject, '_annotations_textMarkup'); | ||
}; | ||
/** | ||
* @private | ||
*/ | ||
TextMarkupAnnotation.prototype.clear = function () { | ||
@@ -1120,0 +1137,0 @@ window.sessionStorage.removeItem(this.pdfViewerBase.documentId + '_annotations_textMarkup'); |
@@ -31,2 +31,5 @@ import { PdfViewer } from '../index'; | ||
private isThumbnail; | ||
private annotationInputElement; | ||
private annotationContextMenu; | ||
private annotationMenuObj; | ||
/** | ||
@@ -95,5 +98,14 @@ * @private | ||
private createCommentPanelTitleContainer; | ||
private openAnnotationContextMenu; | ||
/** | ||
* @private | ||
*/ | ||
createAnnotationContextMenu(): void; | ||
private annotationMenuItemSelect; | ||
private createFileElement; | ||
private importAnnotationIconClick; | ||
private loadImportAnnotation; | ||
/** | ||
* @private | ||
*/ | ||
closeCommentPanelContainer(): void; | ||
@@ -206,3 +218,7 @@ /** | ||
clear(): void; | ||
/** | ||
* @private | ||
*/ | ||
destroy(): void; | ||
getModuleName(): string; | ||
} |
import { createElement, Browser } from '@syncfusion/ej2-base'; | ||
import { Toolbar as Tool } from '@syncfusion/ej2-navigations'; | ||
import { Toolbar as Tool, ContextMenu as Context, } from '@syncfusion/ej2-navigations'; | ||
import { Tooltip } from '@syncfusion/ej2-popups'; | ||
@@ -20,2 +20,3 @@ import { Toast } from '@syncfusion/ej2-notifications'; | ||
this.isThumbnail = false; | ||
this.annotationContextMenu = []; | ||
/** | ||
@@ -41,2 +42,23 @@ * @private | ||
this.isThumbnailOpen = false; | ||
// tslint:disable-next-line | ||
this.loadImportAnnotation = function (args) { | ||
// tslint:disable-next-line | ||
var upoadedFiles = args.target.files; | ||
if (args.target.files[0] !== null) { | ||
var uploadedFile = upoadedFiles[0]; | ||
if (uploadedFile) { | ||
var reader = new FileReader(); | ||
reader.readAsDataURL(uploadedFile); | ||
// tslint:disable-next-line | ||
reader.onload = function (e) { | ||
if (e.currentTarget.result) { | ||
var importFile = e.currentTarget.result.split(',')[1]; | ||
// tslint:disable-next-line | ||
var annotationData = atob(importFile); | ||
_this.pdfViewerBase.importAnnotations(JSON.parse(annotationData)); | ||
} | ||
}; | ||
} | ||
} | ||
}; | ||
this.resizeIconMouseOver = function (event) { | ||
@@ -356,2 +378,3 @@ event.srcElement.style.cursor = 'default'; | ||
this.commentPanelContainer.appendChild(this.commentsContentContainer); | ||
this.createFileElement(this.commentPanelContainer); | ||
}; | ||
@@ -364,15 +387,75 @@ NavigationPane.prototype.createCommentPanelTitleContainer = function () { | ||
commentpanelTilte.innerText = this.pdfViewer.localeObj.getConstant('Comments'); | ||
var closeButton = createElement('button', { id: this.pdfViewer.element.id + '_close_btn' }); | ||
closeButton.className = 'e-btn e-pv-tbar-btn e-pv-comment-panel-title-close-div e-btn'; | ||
var annotationButton = createElement('button', { id: this.pdfViewer.element.id + '_annotations_btn' }); | ||
annotationButton.className = 'e-btn e-pv-tbar-btn e-pv-comment-panel-title-close-div e-btn'; | ||
// tslint:disable-next-line:max-line-length | ||
var closeButtonSpan = createElement('span', { id: this.pdfViewer.element.id + '_close' + '_icon', className: 'e-pv-title-close-icon e-pv-icon' }); | ||
closeButton.appendChild(closeButtonSpan); | ||
var moreOptionButtonSpan = createElement('span', { id: this.pdfViewer.element.id + '_annotation_more_icon', className: 'e-pv-more-icon e-pv-icon' }); | ||
annotationButton.appendChild(moreOptionButtonSpan); | ||
commentPanelTitleContainer.appendChild(commentpanelTilte); | ||
commentPanelTitleContainer.appendChild(closeButton); | ||
commentPanelTitleContainer.appendChild(annotationButton); | ||
this.commentPanelContainer.appendChild(commentPanelTitleContainer); | ||
closeButton.addEventListener('click', this.closeCommentPanelContainer.bind(this, NavigationPane)); | ||
this.createAnnotationContextMenu(); | ||
annotationButton.addEventListener('click', this.openAnnotationContextMenu.bind(this)); | ||
}; | ||
// tslint:disable-next-line | ||
NavigationPane.prototype.openAnnotationContextMenu = function (event) { | ||
this.annotationMenuObj.open(event.clientY, event.clientX, event.currentTarget); | ||
}; | ||
/** | ||
* @private | ||
*/ | ||
NavigationPane.prototype.createAnnotationContextMenu = function () { | ||
// tslint:disable-next-line:max-line-length | ||
this.annotationContextMenu = [ | ||
{ text: this.pdfViewer.localeObj.getConstant('Export Annotations') }, | ||
{ text: this.pdfViewer.localeObj.getConstant('Import Annotations') } | ||
]; | ||
var annotationMenuElement = createElement('ul', { id: this.pdfViewer.element.id + '_annotation_context_menu' }); | ||
this.pdfViewer.element.appendChild(annotationMenuElement); | ||
this.annotationMenuObj = new Context({ | ||
target: '#' + this.pdfViewer.element.id + '_annotations_btn', items: this.annotationContextMenu, | ||
select: this.annotationMenuItemSelect.bind(this), | ||
}); | ||
if (this.pdfViewer.enableRtl) { | ||
this.annotationMenuObj.enableRtl = true; | ||
} | ||
this.annotationMenuObj.appendTo(annotationMenuElement); | ||
if (Browser.isDevice) { | ||
this.annotationMenuObj.animationSettings.effect = 'ZoomIn'; | ||
} | ||
else { | ||
this.annotationMenuObj.animationSettings.effect = 'SlideDown'; | ||
} | ||
}; | ||
// tslint:disable-next-line | ||
NavigationPane.prototype.annotationMenuItemSelect = function (args) { | ||
if (args.item) { | ||
switch (args.item.text) { | ||
case this.pdfViewer.localeObj.getConstant('Export Annotations'): | ||
this.pdfViewerBase.exportAnnotations(); | ||
break; | ||
case this.pdfViewer.localeObj.getConstant('Import Annotations'): | ||
this.importAnnotationIconClick(args); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
}; | ||
NavigationPane.prototype.createFileElement = function (toolbarElement) { | ||
// 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.setAttribute('accept', '.json'); | ||
toolbarElement.appendChild(this.annotationInputElement); | ||
this.annotationInputElement.addEventListener('change', this.loadImportAnnotation); | ||
}; | ||
NavigationPane.prototype.importAnnotationIconClick = function (args) { | ||
this.annotationInputElement.click(); | ||
if (Browser.isDevice) { | ||
args.originalEvent.target.blur(); | ||
this.pdfViewerBase.focusViewerContainer(); | ||
} | ||
}; | ||
/** | ||
* @private | ||
*/ | ||
NavigationPane.prototype.closeCommentPanelContainer = function () { | ||
@@ -888,2 +971,8 @@ var proxy = this; | ||
}; | ||
/** | ||
* @private | ||
*/ | ||
NavigationPane.prototype.destroy = function () { | ||
this.annotationMenuObj.destroy(); | ||
}; | ||
NavigationPane.prototype.getModuleName = function () { | ||
@@ -890,0 +979,0 @@ return 'NavigationPane'; |
@@ -26,2 +26,13 @@ import { PdfViewer, TextLayer, ContextMenu } from '../index'; | ||
/** | ||
* The `IAnnotationCollection` module is used to handle page size property of PDF viewer. | ||
* @hidden | ||
*/ | ||
export interface IAnnotationCollection { | ||
textMarkupAnnotation: object; | ||
shapeAnnotation: object; | ||
measureShapeAnnotation: object; | ||
stampAnnotations: object; | ||
stickyNotesAnnotation: object; | ||
} | ||
/** | ||
* The `PdfViewerBase` module is used to handle base methods of PDF viewer. | ||
@@ -202,5 +213,17 @@ * @hidden | ||
private virtualLoadRequestHandler; | ||
private exportAnnotationRequestHandler; | ||
private importAnnotationRequestHandler; | ||
private annotationPageList; | ||
private importPageList; | ||
/** | ||
* @private | ||
*/ | ||
importedAnnotation: any; | ||
/** | ||
* @private | ||
*/ | ||
isImportAction: boolean; | ||
/** | ||
* @private | ||
*/ | ||
tool: ToolBase; | ||
@@ -245,2 +268,3 @@ action: string; | ||
isDynamicStamp: boolean; | ||
private isMixedSizeDocument; | ||
constructor(viewer: PdfViewer); | ||
@@ -261,2 +285,10 @@ /** | ||
*/ | ||
updateWidth(): void; | ||
/** | ||
* @private | ||
*/ | ||
updateHeight(): void; | ||
/** | ||
* @private | ||
*/ | ||
updateViewerContainer(): void; | ||
@@ -437,2 +469,3 @@ private updateViewerContainerSize; | ||
private downloadDocument; | ||
private downloadExportAnnotationJson; | ||
private constructJsonDownload; | ||
@@ -553,2 +586,20 @@ private createRequestForDownload; | ||
diagramMouseDown(evt: MouseEvent | TouchEvent): void; | ||
/** | ||
* @private | ||
*/ | ||
importAnnotations(importData: any): void; | ||
/** | ||
* @private | ||
*/ | ||
exportAnnotations(): void; | ||
private createRequestForExportAnnotations; | ||
private createRequestForImportAnnotations; | ||
private reRenderAnnotations; | ||
private drawPageAnnotations; | ||
private saveImportedAnnotations; | ||
private savePageAnnotations; | ||
/** | ||
* @private | ||
*/ | ||
createAnnotationJsonData(): any; | ||
} |
@@ -234,5 +234,11 @@ import { createElement, Browser } from '@syncfusion/ej2-base'; | ||
var proxy = this; | ||
var destPage = (this.pdfViewerBase.pageSize[pageIndex - 1].height); | ||
// tslint:disable-next-line:max-line-length | ||
var scrollValue = this.pdfViewerBase.pageSize[pageIndex].top * this.pdfViewerBase.getZoomFactor() + ((destPage - y) * this.pdfViewerBase.getZoomFactor()); | ||
var destPage = (this.pdfViewerBase.pageSize[pageIndex].height); | ||
var scrollValue; | ||
if (y === 0) { | ||
scrollValue = this.pdfViewerBase.pageSize[pageIndex].top * this.pdfViewerBase.getZoomFactor(); | ||
} | ||
else { | ||
// tslint:disable-next-line:max-line-length | ||
scrollValue = this.pdfViewerBase.pageSize[pageIndex].top * this.pdfViewerBase.getZoomFactor() + ((destPage - y) * this.pdfViewerBase.getZoomFactor()); | ||
} | ||
var scroll = scrollValue.toString(); | ||
@@ -239,0 +245,0 @@ // tslint:disable-next-line:radix |
@@ -157,12 +157,14 @@ import { Browser } from '@syncfusion/ej2-base'; | ||
var zoomValue = this.calculateFitZoomFactor('fitToPage'); | ||
this.isAutoZoom = false; | ||
this.onZoomChanged(zoomValue); | ||
if (Browser.isDevice) { | ||
this.pdfViewerBase.viewerContainer.style.overflowY = 'hidden'; | ||
if (zoomValue !== null) { | ||
this.isAutoZoom = false; | ||
this.onZoomChanged(zoomValue); | ||
if (Browser.isDevice) { | ||
this.pdfViewerBase.viewerContainer.style.overflowY = 'hidden'; | ||
} | ||
else { | ||
this.pdfViewerBase.viewerContainer.style.overflowY = 'auto'; | ||
} | ||
// tslint:disable-next-line:max-line-length | ||
this.pdfViewerBase.viewerContainer.scrollTop = this.pdfViewerBase.pageSize[this.pdfViewerBase.currentPageNumber - 1].top * this.zoomFactor; | ||
} | ||
else { | ||
this.pdfViewerBase.viewerContainer.style.overflowY = 'auto'; | ||
} | ||
// tslint:disable-next-line:max-line-length | ||
this.pdfViewerBase.viewerContainer.scrollTop = this.pdfViewerBase.pageSize[this.pdfViewerBase.currentPageNumber - 1].top * this.zoomFactor; | ||
}; | ||
@@ -179,2 +181,5 @@ /** | ||
} | ||
if (isNaN(viewerHeight) || isNaN(viewerWidth)) { | ||
return null; | ||
} | ||
var highestWidth = 0; | ||
@@ -181,0 +186,0 @@ var highestHeight = 0; |
@@ -91,2 +91,12 @@ 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 } 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 { Print, CalibrationUnit } from './index';import { UnloadEventArgs, LoadEventArgs, LoadFailedEventArgs, AjaxRequestFailureEventArgs, PageChangeEventArgs, PageClickEventArgs, ZoomChangeEventArgs, HyperlinkClickEventArgs } from './index';import { AnnotationAddEventArgs, AnnotationRemoveEventArgs, AnnotationPropertiesChangeEventArgs, AnnotationResizeEventArgs, AnnotationSelectEventArgs } 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'; | ||
/** | ||
* specifies the imports annotations action of PdfViewer. | ||
*/ | ||
importAnnotations?: string; | ||
/** | ||
* specifies the export annotations action of PdfViewer. | ||
*/ | ||
exportAnnotations?: string; | ||
} | ||
@@ -93,0 +103,0 @@ |
@@ -103,2 +103,10 @@ import { Component, INotifyPropertyChanged, ChildProperty, L10n } from '@syncfusion/ej2-base'; | ||
renderComments: string; | ||
/** | ||
* specifies the imports annotations action of PdfViewer. | ||
*/ | ||
importAnnotations: string; | ||
/** | ||
* specifies the export annotations action of PdfViewer. | ||
*/ | ||
exportAnnotations: string; | ||
} | ||
@@ -1189,2 +1197,13 @@ /** | ||
/** | ||
* Perform imports annotations action in the PDF Viewer | ||
* @param {any} importData - Specifies the data for annotation imports | ||
* @returns void | ||
*/ | ||
importAnnotations(importData: any): void; | ||
/** | ||
* Perform export annotations action in the PDF Viewer | ||
* @returns void | ||
*/ | ||
exportAnnotations(): void; | ||
/** | ||
* @private | ||
@@ -1191,0 +1210,0 @@ */ |
@@ -104,2 +104,8 @@ var __extends = (this && this.__extends) || (function () { | ||
], ServerActionSettings.prototype, "renderComments", void 0); | ||
__decorate([ | ||
Property('ImportAnnotations') | ||
], ServerActionSettings.prototype, "importAnnotations", void 0); | ||
__decorate([ | ||
Property('ExportAnnotations') | ||
], ServerActionSettings.prototype, "exportAnnotations", void 0); | ||
return ServerActionSettings; | ||
@@ -790,3 +796,5 @@ }(ChildProperty)); | ||
'Add a comment': 'Add a comment', | ||
'Add a reply': 'Add a reply' | ||
'Add a reply': 'Add a reply', | ||
'Import Annotations': 'Import Annotations', | ||
'Export Annotations': 'Export Annotations' | ||
}; | ||
@@ -961,2 +969,3 @@ _this.viewerBase = new PdfViewerBase(_this); | ||
this.drawing.renderLabels(this); | ||
this.renderComplete(); | ||
}; | ||
@@ -985,2 +994,36 @@ PdfViewer.prototype.getModuleName = function () { | ||
break; | ||
case 'documentPath': | ||
this.load(newProp.documentPath, null); | ||
break; | ||
case 'interactionMode': | ||
this.interactionMode = newProp.interactionMode; | ||
if (newProp.interactionMode === 'Pan') { | ||
this.viewerBase.initiatePanning(); | ||
if (this.toolbar) { | ||
this.toolbar.updateInteractionTools(false); | ||
} | ||
} | ||
else if (newProp.interactionMode === 'TextSelection') { | ||
this.viewerBase.initiateTextSelectMode(); | ||
if (this.toolbar) { | ||
this.toolbar.updateInteractionTools(true); | ||
} | ||
} | ||
break; | ||
case 'height': | ||
this.height = newProp.height; | ||
this.viewerBase.updateHeight(); | ||
this.viewerBase.onWindowResize(); | ||
if (this.toolbar.annotationToolbarModule.isToolbarHidden) { | ||
this.toolbar.annotationToolbarModule.adjustViewer(false); | ||
} | ||
else { | ||
this.toolbar.annotationToolbarModule.adjustViewer(true); | ||
} | ||
break; | ||
case 'width': | ||
this.width = newProp.width; | ||
this.viewerBase.updateWidth(); | ||
this.viewerBase.onWindowResize(); | ||
break; | ||
} | ||
@@ -1139,3 +1182,24 @@ } | ||
}; | ||
// tslint:disable-next-line | ||
/** | ||
* Perform imports annotations action in the PDF Viewer | ||
* @param {any} importData - Specifies the data for annotation imports | ||
* @returns void | ||
*/ | ||
// tslint:disable-next-line | ||
PdfViewer.prototype.importAnnotations = function (importData) { | ||
if (this.annotationModule) { | ||
this.viewerBase.importAnnotations(importData); | ||
} | ||
}; | ||
/** | ||
* Perform export annotations action in the PDF Viewer | ||
* @returns void | ||
*/ | ||
PdfViewer.prototype.exportAnnotations = function () { | ||
if (this.annotationModule) { | ||
this.viewerBase.exportAnnotations(); | ||
} | ||
}; | ||
/** | ||
* @private | ||
@@ -1478,3 +1542,3 @@ */ | ||
__decorate([ | ||
Property({ load: 'Load', renderPages: 'RenderPdfPages', unload: 'Unload', download: 'Download', renderThumbnail: 'RenderThumbnailImages', print: 'PrintImages', renderComments: 'RenderAnnotationComments' }) | ||
Property({ load: 'Load', renderPages: 'RenderPdfPages', unload: 'Unload', download: 'Download', renderThumbnail: 'RenderThumbnailImages', print: 'PrintImages', renderComments: 'RenderAnnotationComments', importAnnotations: 'ImportAnnotations', exportAnnotations: 'ExportAnnotations' }) | ||
], PdfViewer.prototype, "serverActionSettings", void 0); | ||
@@ -1481,0 +1545,0 @@ __decorate([ |
@@ -85,4 +85,36 @@ import { createElement, Browser } from '@syncfusion/ej2-base'; | ||
var stampData = printImage['stampAnnotations']; | ||
// tslint:disable-next-line:max-line-length | ||
annotationSource_1 = proxy.pdfViewer.annotationModule.textMarkupAnnotationModule.printTextMarkupAnnotations(printImage.textMarkupAnnotation, pageIndex, stampData, printImage.shapeAnnotation); | ||
if (proxy.pdfViewerBase.isImportAction) { | ||
var importAnnotationList = proxy.pdfViewerBase.importedAnnotation; | ||
// tslint:disable-next-line | ||
var importAnnotation = importAnnotationList[printImage.pageNumber]; | ||
var textMarkupAnnotation = printImage.textMarkupAnnotation; | ||
var shapeAnnotation = printImage.shapeAnnotation; | ||
var measureShapeAnnotation = printImage.measureShapeAnnotation; | ||
var stampAnnotation = stampData; | ||
// tslint:disable-next-line | ||
var stickyNoteAnnotation = printImage.stickyNotesAnnotation; | ||
if (importAnnotation) { | ||
if (importAnnotation.textMarkupAnnotation.length !== 0) { | ||
textMarkupAnnotation = printImage.textMarkupAnnotation.concat(importAnnotation.textMarkupAnnotation); | ||
} | ||
if (importAnnotation.shapeAnnotation.length !== 0) { | ||
shapeAnnotation = printImage.shapeAnnotation.concat(importAnnotation.shapeAnnotation); | ||
} | ||
if (importAnnotation.measureShapeAnnotation.length !== 0) { | ||
measureShapeAnnotation = printImage.measureShapeAnnotation.concat(importAnnotation.measureShapeAnnotation); | ||
} | ||
if (importAnnotation.stampAnnotations.length !== 0) { | ||
stampAnnotation = stampData.concat(importAnnotation.stampAnnotations); | ||
} | ||
if (importAnnotation.stickyNotesAnnotation.length !== 0) { | ||
stickyNoteAnnotation = printImage.stickyNotesAnnotation.concat(importAnnotation.stickyNotesAnnotation); | ||
} | ||
} | ||
// tslint:disable-next-line:max-line-length | ||
annotationSource_1 = proxy.pdfViewer.annotationModule.textMarkupAnnotationModule.printTextMarkupAnnotations(textMarkupAnnotation, pageIndex, stampAnnotation, shapeAnnotation, measureShapeAnnotation, stickyNoteAnnotation); | ||
} | ||
else { | ||
// tslint:disable-next-line:max-line-length | ||
annotationSource_1 = proxy.pdfViewer.annotationModule.textMarkupAnnotationModule.printTextMarkupAnnotations(printImage.textMarkupAnnotation, pageIndex, stampData, printImage.shapeAnnotation, printImage.measureShapeAnnotation, printImage.stickyNoteAnnotation); | ||
} | ||
} | ||
@@ -89,0 +121,0 @@ var currentPageNumber_1 = printImage.pageNumber; |
@@ -141,6 +141,9 @@ import { PdfViewer, PdfViewerBase, Toolbar } from '../index'; | ||
private applyHideToToolbar; | ||
private adjustViewer; | ||
/** | ||
* @private | ||
*/ | ||
adjustViewer(isAdjust: boolean): void; | ||
private updateContentContainerHeight; | ||
private getToolbarHeight; | ||
private getHeight; | ||
private getNavigationToolbarHeight; | ||
private handleHighlight; | ||
@@ -147,0 +150,0 @@ private handleUnderline; |
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 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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19940950
137952