|
@@ -208,13 +208,13 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (pdfAnnotationData == null)
|
|
|
{
|
|
|
- pdfViewerControl.PDFToolManager.SetToolType(ToolType.Pan);
|
|
|
+ pdfViewerControl.SetToolType(ToolType.Pan);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
CPDFAnnotationType annotationType = pdfAnnotationData.AnnotationType;
|
|
|
AnnotParam annotHandlerEventArgs = null;
|
|
|
- pdfViewerControl.PDFToolManager.SetToolType(ToolType.CreateAnnot);
|
|
|
+ pdfViewerControl.SetToolType(ToolType.CreateAnnot);
|
|
|
switch (annotationType)
|
|
|
{
|
|
|
case CPDFAnnotationType.Highlight:
|
|
@@ -229,7 +229,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
(annotHandlerEventArgs as HighlightParam).Content = highlightData.Note;
|
|
|
(annotHandlerEventArgs as HighlightParam).Author = highlightData.Author;
|
|
|
(annotHandlerEventArgs as HighlightParam).Locked = highlightData.IsLocked;
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_HIGHLIGHT);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_HIGHLIGHT);
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -244,7 +244,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
(annotHandlerEventArgs as UnderlineParam).Author = underlineData.Author;
|
|
|
(annotHandlerEventArgs as UnderlineParam).Content = underlineData.Note;
|
|
|
(annotHandlerEventArgs as UnderlineParam).Locked = underlineData.IsLocked;
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_UNDERLINE);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_UNDERLINE);
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -259,7 +259,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
(annotHandlerEventArgs as StrikeoutParam).Locked = strikeoutData.IsLocked;
|
|
|
(annotHandlerEventArgs as StrikeoutParam).Author = strikeoutData.Author;
|
|
|
(annotHandlerEventArgs as StrikeoutParam).Content = strikeoutData.Note;
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_STRIKEOUT);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_STRIKEOUT);
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -274,7 +274,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
(annotHandlerEventArgs as SquigglyParam).Locked = squigglyData.IsLocked;
|
|
|
(annotHandlerEventArgs as SquigglyParam).Author = squigglyData.Author;
|
|
|
(annotHandlerEventArgs as SquigglyParam).Content = squigglyData.Note;
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY);
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -299,7 +299,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
|
|
|
(annotHandlerEventArgs as SquareParam).Author = squareData.Author;
|
|
|
(annotHandlerEventArgs as SquareParam).Content = squareData.Note;
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_SQUARE);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_SQUARE);
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -323,8 +323,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
(annotHandlerEventArgs as CircleParam).BorderStyle = BorderStyle;
|
|
|
(annotHandlerEventArgs as CircleParam).Author = cicleData.Author;
|
|
|
(annotHandlerEventArgs as CircleParam).Content = cicleData.Note;
|
|
|
-
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_CIRCLE);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_CIRCLE);
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -345,7 +344,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
(annotHandlerEventArgs as LineParam).TailLineType = lineData.LineType.TailLineType;
|
|
|
(annotHandlerEventArgs as LineParam).Author = lineData.Author;
|
|
|
(annotHandlerEventArgs as LineParam).Content = lineData.Note;
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_LINE);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_LINE);
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -359,7 +358,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
(annotHandlerEventArgs as StickyNoteParam).Content = noteData.Note;
|
|
|
(annotHandlerEventArgs as StickyNoteParam).Transparency = 255;
|
|
|
(annotHandlerEventArgs as StickyNoteParam).Author = noteData.Author;
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_TEXT);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_TEXT);
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -374,7 +373,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
(annotHandlerEventArgs as InkParam).Transparency = Convert.ToByte(freehandData.Opacity * 255);
|
|
|
(annotHandlerEventArgs as InkParam).Content = freehandData.Note;
|
|
|
(annotHandlerEventArgs as InkParam).Author = freehandData.Author;
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_INK);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_INK);
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -407,7 +406,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
}
|
|
|
(annotHandlerEventArgs as FreeTextParam).Content = freeTextData.Note;
|
|
|
(annotHandlerEventArgs as FreeTextParam).Author = freeTextData.Author;
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_FREETEXT);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_FREETEXT);
|
|
|
}
|
|
|
break;
|
|
|
|
|
@@ -418,7 +417,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
CPDFStampData stampData = pdfAnnotationData as CPDFStampData;
|
|
|
SetStamp(ref stampParam, stampData);
|
|
|
annotHandlerEventArgs = stampParam;
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP);
|
|
|
|
|
|
stampParam.ImageStream.Seek(0, SeekOrigin.Begin);
|
|
|
BitmapDecoder decoder = BitmapDecoder.Create(stampParam.ImageStream,
|
|
@@ -512,22 +511,21 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
if (annotHandlerEventArgs != null)
|
|
|
{
|
|
|
annotHandlerEventArgs.CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_LINK;
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_LINK);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_LINK);
|
|
|
}
|
|
|
break;
|
|
|
case CPDFAnnotationType.Unknow:
|
|
|
- pdfViewerControl.PDFToolManager.SetToolType(ToolType.Pan);
|
|
|
+ pdfViewerControl.SetToolType(ToolType.Pan);
|
|
|
return;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- pdfViewerControl.PDFToolManager.SetToolType(ToolType.CreateAnnot);
|
|
|
+ pdfViewerControl.SetToolType(ToolType.CreateAnnot);
|
|
|
if (annotationType != CPDFAnnotationType.Stamp && annotationType != CPDFAnnotationType.Signature)
|
|
|
{
|
|
|
- pdfViewerControl.PDFViewTool.GetCPDFViewer().SetIsShowStampMouse(false);
|
|
|
+ pdfViewerControl.SetIsShowStampMouse(false);
|
|
|
}
|
|
|
- DefaultSettingParam defaultSettingParam = pdfViewerControl.PDFViewTool.GetDefaultSettingParam();
|
|
|
- defaultSettingParam.SetAnnotParam(annotHandlerEventArgs);
|
|
|
+ pdfViewerControl.SetAnnotParam(annotHandlerEventArgs);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -652,7 +650,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
(annotParam as StampParam).ImageStream = memoryStream;
|
|
|
}
|
|
|
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP);
|
|
|
}
|
|
|
break;
|
|
|
case SignatureType.Drawing:
|
|
@@ -689,7 +687,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
byte[] InkColor = new byte[] { stamp.inkColor.R, stamp.inkColor.G, stamp.inkColor.B };
|
|
|
(annotParam as InkParam).InkColor = InkColor;
|
|
|
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_INK);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_INK);
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
@@ -751,7 +749,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
|
|
|
public void AnnotationCancel()
|
|
|
{
|
|
|
- this.pdfViewerControl.PDFToolManager.SetToolType(ToolType.Pan);
|
|
|
+ this.pdfViewerControl.SetToolType(ToolType.Pan);
|
|
|
pdfViewerControl.PDFViewTool.GetCPDFViewer().SetIsShowStampMouse(false);
|
|
|
ClearPanel();
|
|
|
}
|
|
@@ -874,8 +872,8 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
LinkParam linkAnnotArgs = new LinkParam();
|
|
|
if (this.pdfViewerControl != null && pdfViewerControl.PDFViewTool != null && pdfViewerControl.PDFViewTool.GetCPDFViewer().GetDocument() != null)
|
|
|
{
|
|
|
- pdfViewerControl.PDFToolManager.SetToolType(ToolType.CreateAnnot);
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_LINK);
|
|
|
+ pdfViewerControl.SetToolType(ToolType.CreateAnnot);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_LINK);
|
|
|
pdfLinkUI.InitLinkAnnotArgs(linkAnnotArgs, pdfViewerControl.PDFViewTool.GetCPDFViewer().GetDocument().PageCount);
|
|
|
}
|
|
|
annotationPanel = pdfLinkUI;
|
|
@@ -942,8 +940,8 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
}
|
|
|
DefaultSettingParam defaultSettingParam = pdfViewerControl.PDFViewTool.GetDefaultSettingParam();
|
|
|
defaultSettingParam.SetAnnotParam(stampParam);
|
|
|
- pdfViewerControl.PDFToolManager.SetToolType(ToolType.CreateAnnot);
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP);
|
|
|
+ pdfViewerControl.SetToolType(ToolType.CreateAnnot);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP);
|
|
|
}
|
|
|
catch
|
|
|
{
|
|
@@ -951,7 +949,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- pdfViewerControl.PDFToolManager.SetToolType(ToolType.Pan);
|
|
|
+ pdfViewerControl.SetToolType(ToolType.Pan);
|
|
|
ClearAnnotationBar?.Invoke(this, EventArgs.Empty);
|
|
|
}
|
|
|
ClearPanel();
|
|
@@ -974,12 +972,13 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
{
|
|
|
if (e)
|
|
|
{
|
|
|
+ //pdfViewerControl.PDFToolManager.ClearSelect();
|
|
|
pdfViewerControl.PDFViewTool.SetViewerModel(MouseModes.kCustomizeTool);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- pdfViewerControl.PDFToolManager.SetToolType(ToolType.CreateAnnot);
|
|
|
- pdfViewerControl.PDFToolManager.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_INK);
|
|
|
+ pdfViewerControl.SetToolType(ToolType.CreateAnnot);
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_INK);
|
|
|
}
|
|
|
//if (pdfViewerControl != null)
|
|
|
//{
|
|
@@ -1189,7 +1188,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
|
|
|
public void LoadAnnotationPanel(CPDFAnnotationType annotationType)
|
|
|
{
|
|
|
- this.pdfViewerControl.PDFToolManager.SetToolType(ToolType.Pan);
|
|
|
+ this.pdfViewerControl.SetToolType(ToolType.Pan);
|
|
|
currentAnnotationType = annotationType;
|
|
|
annotationPanel = GetAnnotationPanel();
|
|
|
InitAnnotationPanel(annotationType);
|