|
@@ -84,12 +84,23 @@ namespace compdfkit_tools.Annotation.PDFAnnotationControl
|
|
|
(annotationPanel as CPDFShapeUI).PropertyChanged += CPDFAnnotationControl_PropertyChanged;
|
|
|
SetAnnotationProperty((annotationPanel as CPDFShapeUI).GetShapeData());
|
|
|
break;
|
|
|
+ case AnnotationType.Note:
|
|
|
+ (annotationPanel as CPDFNoteUI).PropertyChanged += CPDFAnnotationControl_PropertyChanged;
|
|
|
+ SetAnnotationProperty((annotationPanel as CPDFNoteUI).GetNoteData());
|
|
|
+ break;
|
|
|
+ case AnnotationType.Freehand:
|
|
|
+ (annotationPanel as CPDFFreehandUI).PropertyChanged += CPDFAnnotationControl_PropertyChanged;
|
|
|
+ SetAnnotationProperty((annotationPanel as CPDFFreehandUI).GetFreehandData());
|
|
|
+ break;
|
|
|
+ case AnnotationType.FreeText:
|
|
|
+ SetAnnotationProperty((annotationPanel as CPDFFreeTextUI).GetFreeTextData());
|
|
|
+ break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void SetAnnotationProperty(CPDFAnnotationData pdfAnnotationData)
|
|
|
+ private void SetAnnotationProperty(CPDFAnnotationData pdfAnnotationData = null)
|
|
|
{
|
|
|
AnnotationType annotationType = pdfAnnotationData.AnnotationType;
|
|
|
AnnotHandlerEventArgs annotHandlerEventArgs = null;
|
|
@@ -171,14 +182,35 @@ namespace compdfkit_tools.Annotation.PDFAnnotationControl
|
|
|
(annotHandlerEventArgs as LineAnnotArgs).Author = lineData.Author;
|
|
|
(annotHandlerEventArgs as LineAnnotArgs).Content = lineData.Note;
|
|
|
break;
|
|
|
- case AnnotationType.Stamp:
|
|
|
- CPDFStampData stampData = pdfAnnotationData as CPDFStampData;
|
|
|
- if (stampData != null)
|
|
|
- {
|
|
|
- annotHandlerEventArgs = new StampAnnotArgs();
|
|
|
- StampAnnotArgs args = annotHandlerEventArgs as StampAnnotArgs;
|
|
|
- SetStamp(ref args, stampData);
|
|
|
- }
|
|
|
+ case AnnotationType.Note:
|
|
|
+ CPDFNoteData noteData = pdfAnnotationData as CPDFNoteData;
|
|
|
+ annotHandlerEventArgs = new StickyAnnotArgs();
|
|
|
+ (annotHandlerEventArgs as StickyAnnotArgs).Color = noteData.BorderColor;
|
|
|
+ (annotHandlerEventArgs as StickyAnnotArgs).StickyNote = noteData.Note;
|
|
|
+ (annotHandlerEventArgs as StickyAnnotArgs).Transparency = 1;
|
|
|
+ (annotHandlerEventArgs as StickyAnnotArgs).Author = noteData.Author;
|
|
|
+ break;
|
|
|
+ case AnnotationType.Freehand:
|
|
|
+ CPDFFreehandData freehandData = pdfAnnotationData as CPDFFreehandData;
|
|
|
+ annotHandlerEventArgs = new FreehandAnnotArgs();
|
|
|
+ (annotHandlerEventArgs as FreehandAnnotArgs).InkColor = freehandData.BorderColor;
|
|
|
+ (annotHandlerEventArgs as FreehandAnnotArgs).LineWidth = freehandData.Thickness;
|
|
|
+ (annotHandlerEventArgs as FreehandAnnotArgs).Transparency = freehandData.Opacity;
|
|
|
+ (annotHandlerEventArgs as FreehandAnnotArgs).Content = freehandData.Note;
|
|
|
+ (annotHandlerEventArgs as StickyAnnotArgs).Author = freehandData.Author;
|
|
|
+ break;
|
|
|
+ case AnnotationType.FreeText:
|
|
|
+ annotHandlerEventArgs = new FreeTextAnnotArgs();
|
|
|
+ (annotHandlerEventArgs as FreeTextAnnotArgs).BgColor = Colors.AliceBlue;
|
|
|
+ (annotHandlerEventArgs as FreeTextAnnotArgs).Transparency = 1;
|
|
|
+ (annotHandlerEventArgs as FreeTextAnnotArgs).LineWidth = 1;
|
|
|
+ (annotHandlerEventArgs as FreeTextAnnotArgs).FontName = "Helvetica";
|
|
|
+ (annotHandlerEventArgs as FreeTextAnnotArgs).FontColor = Colors.Black;
|
|
|
+ (annotHandlerEventArgs as FreeTextAnnotArgs).IsBold = true;
|
|
|
+ (annotHandlerEventArgs as FreeTextAnnotArgs).IsItalic = true;
|
|
|
+ (annotHandlerEventArgs as FreeTextAnnotArgs).Align = TextAlignment.Left;
|
|
|
+ (annotHandlerEventArgs as FreeTextAnnotArgs).Content = "";
|
|
|
+ (annotHandlerEventArgs as FreeTextAnnotArgs).Author = "au";
|
|
|
break;
|
|
|
case AnnotationType.None:
|
|
|
default:
|
|
@@ -257,6 +289,15 @@ namespace compdfkit_tools.Annotation.PDFAnnotationControl
|
|
|
annotationPanel = new CPDFShapeUI();
|
|
|
(annotationPanel as CPDFShapeUI).InitWithAnnotationType(annotationType);
|
|
|
break;
|
|
|
+ case AnnotationType.Freehand:
|
|
|
+ annotationPanel = new CPDFFreehandUI();
|
|
|
+ break;
|
|
|
+ case AnnotationType.FreeText:
|
|
|
+ annotationPanel = new CPDFFreeTextUI();
|
|
|
+ break;
|
|
|
+ case AnnotationType.Note:
|
|
|
+ annotationPanel = new CPDFNoteUI();
|
|
|
+ break;
|
|
|
case AnnotationType.Stamp:
|
|
|
annotationPanel = new CPDFStampUI();
|
|
|
(annotationPanel as CPDFStampUI).InitWithAnnotationType(annotationType);
|
|
@@ -266,7 +307,7 @@ namespace compdfkit_tools.Annotation.PDFAnnotationControl
|
|
|
}
|
|
|
SetAnnotationPanel(annotationPanel);
|
|
|
ExpandPanel();
|
|
|
- ChangeAnnotationData();
|
|
|
+ //ChangeAnnotationData();
|
|
|
}
|
|
|
}
|
|
|
}
|