|
@@ -11,9 +11,9 @@ using System.Windows.Data;
|
|
|
using System.Windows.Input;
|
|
|
using ComPDFKit.Controls.Helper;
|
|
|
using System.Collections.Specialized;
|
|
|
-using ComPDFKitViewer;
|
|
|
using ComPDFKit.Controls.PDFControl;
|
|
|
using static ComPDFKit.Controls.PDFControlUI.CPDFAnnotationListUI;
|
|
|
+using ComPDFKit.Controls.Data;
|
|
|
|
|
|
namespace ComPDFKit.Controls.PDFControlUI
|
|
|
{
|
|
@@ -106,8 +106,8 @@ namespace ComPDFKit.Controls.PDFControlUI
|
|
|
{
|
|
|
get
|
|
|
{
|
|
|
- CPDFAnnotation annotCore = pdfViewer?.GetCPDFViewer()?.GetAnnotForIndex(annotationData.PageIndex, annotationData.AnnotIndex)?.GetAnnotData()?.Annot;
|
|
|
- return annotCore;
|
|
|
+ List<CPDFAnnotation> annotCoreList = pdfViewer?.GetCPDFViewer()?.GetDocument()?.PageAtIndex(annotationData.PageIndex, false)?.GetAnnotations();
|
|
|
+ return annotCoreList[annotationData.AnnotIndex];
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -269,7 +269,7 @@ namespace ComPDFKit.Controls.PDFControlUI
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- return String.Empty;
|
|
|
+ return string.Empty;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -279,9 +279,73 @@ namespace ComPDFKit.Controls.PDFControlUI
|
|
|
get => annotationData.Content;
|
|
|
}
|
|
|
|
|
|
- public C_ANNOTATION_TYPE CurrentAnnotationType
|
|
|
+ public CPDFAnnotationType CurrentAnnotationType
|
|
|
{
|
|
|
- get => annotationData.CurrentType;
|
|
|
+ get
|
|
|
+ {
|
|
|
+ switch(Annotation.Type)
|
|
|
+ {
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_CIRCLE:
|
|
|
+ return CPDFAnnotationType.Circle;
|
|
|
+
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_SQUARE:
|
|
|
+ return CPDFAnnotationType.Square;
|
|
|
+
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
|
|
|
+ {
|
|
|
+ if(Annotation.IsMeasured())
|
|
|
+ return CPDFAnnotationType.LineMeasure;
|
|
|
+ else
|
|
|
+ return CPDFAnnotationType.Line;
|
|
|
+ }
|
|
|
+
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_FREETEXT:
|
|
|
+ return CPDFAnnotationType.FreeText;
|
|
|
+
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_HIGHLIGHT:
|
|
|
+ return CPDFAnnotationType.Highlight;
|
|
|
+
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY:
|
|
|
+ return CPDFAnnotationType.Squiggly;
|
|
|
+
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_STRIKEOUT:
|
|
|
+ return CPDFAnnotationType.Strikeout;
|
|
|
+
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_UNDERLINE:
|
|
|
+ return CPDFAnnotationType.Underline;
|
|
|
+
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_INK:
|
|
|
+ return CPDFAnnotationType.Freehand;
|
|
|
+
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_TEXT:
|
|
|
+ return CPDFAnnotationType.Note;
|
|
|
+
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_STAMP:
|
|
|
+ return CPDFAnnotationType.Stamp;
|
|
|
+
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_POLYLINE:
|
|
|
+ {
|
|
|
+ if (Annotation.IsMeasured())
|
|
|
+ return CPDFAnnotationType.PolyLineMeasure;
|
|
|
+ else
|
|
|
+ return CPDFAnnotationType.PolyLine;
|
|
|
+ }
|
|
|
+
|
|
|
+ case C_ANNOTATION_TYPE.C_ANNOTATION_POLYGON:
|
|
|
+ {
|
|
|
+ if (Annotation.IsMeasured())
|
|
|
+ return CPDFAnnotationType.PolygonMeasure;
|
|
|
+ else
|
|
|
+ return CPDFAnnotationType.Polygon;
|
|
|
+ }
|
|
|
+
|
|
|
+ default:
|
|
|
+ return CPDFAnnotationType.Note;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
public AnnotParam annotationData { get; set; }
|
|
@@ -291,8 +355,8 @@ namespace ComPDFKit.Controls.PDFControlUI
|
|
|
{
|
|
|
get
|
|
|
{
|
|
|
- CPDFAnnotation annotCore = pdfViewer?.GetCPDFViewer()?.GetAnnotForIndex(annotationData.PageIndex, annotationData.AnnotIndex)?.GetAnnotData()?.Annot;
|
|
|
- return annotCore;
|
|
|
+ List<CPDFAnnotation> annotCoreList = pdfViewer?.GetCPDFViewer()?.GetDocument()?.PageAtIndex(annotationData.PageIndex, false)?.GetAnnotations();
|
|
|
+ return annotCoreList[annotationData.AnnotIndex];
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -313,8 +377,6 @@ namespace ComPDFKit.Controls.PDFControlUI
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
private ObservableCollection<AnnotationBindData> annotationList = new ObservableCollection<AnnotationBindData>();
|
|
|
|
|
|
public event EventHandler<object> AnnotationSelectionChanged;
|