Bläddra i källkod

其他 - 替换form和注释相关控件

zhuyi 1 år sedan
förälder
incheckning
a10ea73ae1

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Annotation/AnnotationControl/AnnotationControl.xaml.cs

@@ -176,7 +176,7 @@ namespace Compdfkit_Tools.PDFControl
 
         public void InitialPDFViewControl(PDFViewControl newPDFViewer)
         {
-            PDFAnnotationControl.SetPDFViewer(newPDFViewer.PDFView);
+            PDFAnnotationControl.SetPDFViewer(newPDFViewer);
             PDFAnnotationControl.AnnotationCancel();
             AnnotationBarControl.ClearAllToolState();
             ExpandRightPropertyPanel(null, Visibility.Collapsed);

+ 132 - 132
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationControl/CPDFAnnotationControl.xaml.cs

@@ -658,7 +658,7 @@ namespace Compdfkit_Tools.PDFControl
                     {
                         pdfLinkUI = new CPDFLinkUI();
                     }
-                    InkParam linkAnnotArgs = new InkParam();
+                    LinkParam linkAnnotArgs = new LinkParam();
                     if (this.pdfViewerControl != null&& pdfViewerControl.PDFViewTool!=null && pdfViewerControl.PDFViewTool.GetCPDFViewer().GetDocument() != null)
                     {
                         pdfViewerControl.PDFToolManager.SetToolType(ToolType.CreateAnnot);
@@ -711,145 +711,145 @@ namespace Compdfkit_Tools.PDFControl
 
         private void PdfFreehandUI_EraseChangeHandler(object sender, double e)
         {
-            if (pdfViewerControl != null && eraseArgs != null)
-            {
-                eraseArgs.Thickness = e;
-            }
+            //if (pdfViewerControl != null && eraseArgs != null)
+            //{
+            //    eraseArgs.Thickness = e;
+            //}
         }
 
         private void PdfFreehandUI_EraseClickHandler(object sender, bool e)
         {
-            if (pdfViewerControl != null)
-            {
-                CPDFFreehandUI freehandUI = sender as CPDFFreehandUI;
-                if (e)
-                {
-                    annotArgs = pdfViewerControl.ToolManager.CurrentAnnotArgs;
-                    eraseArgs = new EraseArgs();
-                    eraseArgs.UIBorderColor = Color.FromArgb(0x1A, 0x00, 0x00, 0x00);
-                    eraseArgs.UIFillColor = Color.FromArgb(0x1A, 0x00, 0x00, 0x00);
-
-                    if (freehandUI != null)
-                    {
-                        eraseArgs.Thickness = freehandUI.GetEraseThickness();
-                    }
-                    else
-                    {
-                        eraseArgs.Thickness = 1;
-                    }
-
-                    disableClean = true;
-                    pdfViewerControl.PDFToolManager.SetToolType(ToolType.CreateAnnot);
-                    pdfViewerControl.SetToolParam(eraseArgs);
-                    disableClean = false;
-                    EmptyMessage.Visibility = Visibility.Collapsed;
-                }
-                else
-                {
-                    pdfViewerControl.PDFToolManager.SetToolType(ToolType.CreateAnnot);
-                    FreehandAnnotArgs freehandAnnotArgs = annotArgs as FreehandAnnotArgs;
-                    if (freehandAnnotArgs == null)
-                    {
-                        freehandAnnotArgs = new FreehandAnnotArgs();
-
-                        freehandAnnotArgs.InkColor = Colors.Red;
-                        freehandAnnotArgs.Transparency = 1;
-                        freehandAnnotArgs.LineWidth = 1;
-                        annotArgs = freehandAnnotArgs;
-                    }
-
-                    if (freehandUI != null)
-                    {
-                        freehandUI.PropertyChanged -= CPDFAnnotationControl_PropertyChanged;
-                        Dictionary<AnnotAttrib, object> attribDict = new Dictionary<AnnotAttrib, object>();
-                        attribDict[AnnotAttrib.Color] = freehandAnnotArgs.InkColor;
-                        attribDict[AnnotAttrib.Transparency] = freehandAnnotArgs.Transparency;
-                        attribDict[AnnotAttrib.Thickness] = freehandAnnotArgs.LineWidth;
-                        attribDict[AnnotAttrib.NoteText] = freehandAnnotArgs.Content;
-
-                        AnnotAttribEvent annotEvent = AnnotAttribEvent.GetAnnotAttribEvent(freehandAnnotArgs, attribDict);
-                        freehandUI.SetPresentAnnotAttrib(annotEvent);
-                        freehandUI.PropertyChanged += CPDFAnnotationControl_PropertyChanged;
-                        freehandUI.ClearAnnotAttribEvent();
-                    }
-                    pdfViewerControl.SetToolParam(freehandAnnotArgs);
-                }
-            }
+            //if (pdfViewerControl != null)
+            //{
+            //    CPDFFreehandUI freehandUI = sender as CPDFFreehandUI;
+            //    if (e)
+            //    {
+            //        annotArgs = pdfViewerControl.ToolManager.CurrentAnnotArgs;
+            //        eraseArgs = new EraseArgs();
+            //        eraseArgs.UIBorderColor = Color.FromArgb(0x1A, 0x00, 0x00, 0x00);
+            //        eraseArgs.UIFillColor = Color.FromArgb(0x1A, 0x00, 0x00, 0x00);
+
+            //        if (freehandUI != null)
+            //        {
+            //            eraseArgs.Thickness = freehandUI.GetEraseThickness();
+            //        }
+            //        else
+            //        {
+            //            eraseArgs.Thickness = 1;
+            //        }
+
+            //        disableClean = true;
+            //        pdfViewerControl.PDFToolManager.SetToolType(ToolType.CreateAnnot);
+            //        pdfViewerControl.SetToolParam(eraseArgs);
+            //        disableClean = false;
+            //        EmptyMessage.Visibility = Visibility.Collapsed;
+            //    }
+            //    else
+            //    {
+            //        pdfViewerControl.PDFToolManager.SetToolType(ToolType.CreateAnnot);
+            //        FreehandAnnotArgs freehandAnnotArgs = annotArgs as FreehandAnnotArgs;
+            //        if (freehandAnnotArgs == null)
+            //        {
+            //            freehandAnnotArgs = new FreehandAnnotArgs();
+
+            //            freehandAnnotArgs.InkColor = Colors.Red;
+            //            freehandAnnotArgs.Transparency = 1;
+            //            freehandAnnotArgs.LineWidth = 1;
+            //            annotArgs = freehandAnnotArgs;
+            //        }
+
+            //        if (freehandUI != null)
+            //        {
+            //            freehandUI.PropertyChanged -= CPDFAnnotationControl_PropertyChanged;
+            //            Dictionary<AnnotAttrib, object> attribDict = new Dictionary<AnnotAttrib, object>();
+            //            attribDict[AnnotAttrib.Color] = freehandAnnotArgs.InkColor;
+            //            attribDict[AnnotAttrib.Transparency] = freehandAnnotArgs.Transparency;
+            //            attribDict[AnnotAttrib.Thickness] = freehandAnnotArgs.LineWidth;
+            //            attribDict[AnnotAttrib.NoteText] = freehandAnnotArgs.Content;
+
+            //            AnnotAttribEvent annotEvent = AnnotAttribEvent.GetAnnotAttribEvent(freehandAnnotArgs, attribDict);
+            //            freehandUI.SetPresentAnnotAttrib(annotEvent);
+            //            freehandUI.PropertyChanged += CPDFAnnotationControl_PropertyChanged;
+            //            freehandUI.ClearAnnotAttribEvent();
+            //        }
+            //        pdfViewerControl.SetToolParam(freehandAnnotArgs);
+            //    }
+            //}
         }
 
         public void CreatTempAnnotationPanel(BaseAnnot baseAnnot)
         {
-            switch (baseAnnot.CurrentType)
-            {
-                case C_ANNOTATION_TYPE.C_ANNOTATION_HIGHLIGHT:
-                    tempAnnotationPanel = new CPDFMarkupUI();
-                    (tempAnnotationPanel as CPDFMarkupUI).InitWithAnnotationType(CPDFAnnotationType.Highlight);
-                    (tempAnnotationPanel as CPDFMarkupUI).SetPresentAnnotAttrib(annotAttribEvent);
-                    break;
-                case C_ANNOTATION_TYPE.C_ANNOTATION_UNDERLINE:
-                    tempAnnotationPanel = new CPDFMarkupUI();
-                    (tempAnnotationPanel as CPDFMarkupUI).InitWithAnnotationType(CPDFAnnotationType.Underline);
-                    (tempAnnotationPanel as CPDFMarkupUI).SetPresentAnnotAttrib(annotAttribEvent);
-                    break;
-                case C_ANNOTATION_TYPE.C_ANNOTATION_STRIKEOUT:
-                    tempAnnotationPanel = new CPDFMarkupUI();
-                    (tempAnnotationPanel as CPDFMarkupUI).InitWithAnnotationType(CPDFAnnotationType.Strikeout);
-                    (tempAnnotationPanel as CPDFMarkupUI).SetPresentAnnotAttrib(annotAttribEvent);
-                    break;
-                case C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY:
-                    tempAnnotationPanel = new CPDFMarkupUI();
-                    (tempAnnotationPanel as CPDFMarkupUI).InitWithAnnotationType(CPDFAnnotationType.Squiggly);
-                    (tempAnnotationPanel as CPDFMarkupUI).SetPresentAnnotAttrib(annotAttribEvent);
-                    break;
-
-                case C_ANNOTATION_TYPE.C_ANNOTATION_SQUARE:
-                    tempAnnotationPanel = new CPDFShapeUI();
-                    (tempAnnotationPanel as CPDFShapeUI).InitWithAnnotationType(CPDFAnnotationType.Square);
-                    (tempAnnotationPanel as CPDFShapeUI).SetPresentAnnotAttrib(annotAttribEvent);
-                    break;
-                case C_ANNOTATION_TYPE.C_ANNOTATION_CIRCLE:
-                    tempAnnotationPanel = new CPDFShapeUI();
-                    (tempAnnotationPanel as CPDFShapeUI).InitWithAnnotationType(CPDFAnnotationType.Circle);
-                    (tempAnnotationPanel as CPDFShapeUI).SetPresentAnnotAttrib(annotAttribEvent);
-                    break;
-                case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
-                    tempAnnotationPanel = new CPDFShapeUI();
-                    (tempAnnotationPanel as CPDFShapeUI).InitWithAnnotationType(CPDFAnnotationType.Line);
-                    (tempAnnotationPanel as CPDFShapeUI).SetPresentAnnotAttrib(annotAttribEvent);
-                    break;
-
-                case C_ANNOTATION_TYPE.C_ANNOTATION_INK:
-                    CPDFFreehandUI tempFreehandPanel = new CPDFFreehandUI();
-                    tempFreehandPanel.SetPresentAnnotAttrib(annotAttribEvent);
-                    tempFreehandPanel.EraseClickHandler += PdfFreehandUI_EraseClickHandler;
-                    tempFreehandPanel.EraseChangeHandler += PdfFreehandUI_EraseChangeHandler;
-                    tempAnnotationPanel = tempFreehandPanel;
-                    break;
-
-                case C_ANNOTATION_TYPE.C_ANNOTATION_FREETEXT:
-                    tempAnnotationPanel = new CPDFFreeTextUI();
-                    (tempAnnotationPanel as CPDFFreeTextUI).SetPresentAnnotAttrib(annotAttribEvent);
-                    break;
-
-                case C_ANNOTATION_TYPE.C_ANNOTATION_TEXT:
-                    tempAnnotationPanel = new CPDFNoteUI();
-                    (tempAnnotationPanel as CPDFNoteUI).SetPresentAnnotAttrib(annotAttribEvent);
-                    break;
-
-                case C_ANNOTATION_TYPE.C_ANNOTATION_STAMP:
-                    tempAnnotationPanel = new CPDFTempStampUI();
-                    (tempAnnotationPanel as CPDFTempStampUI).SetPresentAnnotAttrib(annotAttribEvent);
-                    break;
-                case C_ANNOTATION_TYPE.C_ANNOTATION_LINK:
-                    tempAnnotationPanel = new CPDFLinkUI();
-                    (tempAnnotationPanel as CPDFLinkUI).SetPresentAnnotAttrib(annotAttribEvent, pdfViewerControl.Document.PageCount);
-                    break;
-                case C_ANNOTATION_TYPE.C_ANNOTATION_SOUND:
-                    tempAnnotationPanel = null;
-                    break;
-                default:
-                    break;
-            }
+            //switch (baseAnnot.CurrentType)
+            //{
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_HIGHLIGHT:
+            //        tempAnnotationPanel = new CPDFMarkupUI();
+            //        (tempAnnotationPanel as CPDFMarkupUI).InitWithAnnotationType(CPDFAnnotationType.Highlight);
+            //        (tempAnnotationPanel as CPDFMarkupUI).SetPresentAnnotAttrib(annotAttribEvent);
+            //        break;
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_UNDERLINE:
+            //        tempAnnotationPanel = new CPDFMarkupUI();
+            //        (tempAnnotationPanel as CPDFMarkupUI).InitWithAnnotationType(CPDFAnnotationType.Underline);
+            //        (tempAnnotationPanel as CPDFMarkupUI).SetPresentAnnotAttrib(annotAttribEvent);
+            //        break;
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_STRIKEOUT:
+            //        tempAnnotationPanel = new CPDFMarkupUI();
+            //        (tempAnnotationPanel as CPDFMarkupUI).InitWithAnnotationType(CPDFAnnotationType.Strikeout);
+            //        (tempAnnotationPanel as CPDFMarkupUI).SetPresentAnnotAttrib(annotAttribEvent);
+            //        break;
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_SQUIGGLY:
+            //        tempAnnotationPanel = new CPDFMarkupUI();
+            //        (tempAnnotationPanel as CPDFMarkupUI).InitWithAnnotationType(CPDFAnnotationType.Squiggly);
+            //        (tempAnnotationPanel as CPDFMarkupUI).SetPresentAnnotAttrib(annotAttribEvent);
+            //        break;
+
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_SQUARE:
+            //        tempAnnotationPanel = new CPDFShapeUI();
+            //        (tempAnnotationPanel as CPDFShapeUI).InitWithAnnotationType(CPDFAnnotationType.Square);
+            //        (tempAnnotationPanel as CPDFShapeUI).SetPresentAnnotAttrib(annotAttribEvent);
+            //        break;
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_CIRCLE:
+            //        tempAnnotationPanel = new CPDFShapeUI();
+            //        (tempAnnotationPanel as CPDFShapeUI).InitWithAnnotationType(CPDFAnnotationType.Circle);
+            //        (tempAnnotationPanel as CPDFShapeUI).SetPresentAnnotAttrib(annotAttribEvent);
+            //        break;
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_LINE:
+            //        tempAnnotationPanel = new CPDFShapeUI();
+            //        (tempAnnotationPanel as CPDFShapeUI).InitWithAnnotationType(CPDFAnnotationType.Line);
+            //        (tempAnnotationPanel as CPDFShapeUI).SetPresentAnnotAttrib(annotAttribEvent);
+            //        break;
+
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_INK:
+            //        CPDFFreehandUI tempFreehandPanel = new CPDFFreehandUI();
+            //        tempFreehandPanel.SetPresentAnnotAttrib(annotAttribEvent);
+            //        tempFreehandPanel.EraseClickHandler += PdfFreehandUI_EraseClickHandler;
+            //        tempFreehandPanel.EraseChangeHandler += PdfFreehandUI_EraseChangeHandler;
+            //        tempAnnotationPanel = tempFreehandPanel;
+            //        break;
+
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_FREETEXT:
+            //        tempAnnotationPanel = new CPDFFreeTextUI();
+            //        (tempAnnotationPanel as CPDFFreeTextUI).SetPresentAnnotAttrib(annotAttribEvent);
+            //        break;
+
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_TEXT:
+            //        tempAnnotationPanel = new CPDFNoteUI();
+            //        (tempAnnotationPanel as CPDFNoteUI).SetPresentAnnotAttrib(annotAttribEvent);
+            //        break;
+
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_STAMP:
+            //        tempAnnotationPanel = new CPDFTempStampUI();
+            //        (tempAnnotationPanel as CPDFTempStampUI).SetPresentAnnotAttrib(annotAttribEvent);
+            //        break;
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_LINK:
+            //        tempAnnotationPanel = new CPDFLinkUI();
+            //        (tempAnnotationPanel as CPDFLinkUI).SetPresentAnnotAttrib(annotAttribEvent, pdfViewerControl.Document.PageCount);
+            //        break;
+            //    case C_ANNOTATION_TYPE.C_ANNOTATION_SOUND:
+            //        tempAnnotationPanel = null;
+            //        break;
+            //    default:
+            //        break;
+            //}
         }
 
         public void LoadAnnotationPanel(CPDFAnnotationType annotationType)

+ 4 - 3
Demo/Examples/Compdfkit_Tools/Annotation/PDFAnnotationPanel/PDFAnnotationUI/CPDFSignatureUI.xaml.cs

@@ -1,4 +1,5 @@
 using ComPDFKit.Import;
+using ComPDFKit.PDFAnnotation;
 using ComPDFKit.PDFAnnotation.Form;
 using ComPDFKit.Tool;
 using Compdfkit_Tools.Data;
@@ -28,11 +29,11 @@ namespace Compdfkit_Tools.Annotation.PDFAnnotationPanel.PDFAnnotationUI
         {
             InitializeComponent();
         }
-        public void SetFormProperty(SignatureParam param, PDFViewControl view,CPDFSignatureWidget sign)
+        public void SetFormProperty(AnnotParam param, PDFViewControl view, CPDFAnnotation sign)
         {
-            signatureParam = param;
+            signatureParam = (SignatureParam) param;
             viewControl = view;
-            signatureWidget = sign;
+            signatureWidget = (CPDFSignatureWidget)sign;
         }
         private void UserControl_Loaded(object sender, RoutedEventArgs e)
         {

+ 62 - 54
Demo/Examples/Compdfkit_Tools/Common/BarControl/FormBarControl.xaml.cs

@@ -1,6 +1,8 @@
 using ComPDFKit.PDFAnnotation;
 using ComPDFKit.PDFAnnotation.Form;
 using ComPDFKit.PDFDocument.Action;
+using ComPDFKit.Tool;
+using ComPDFKit.Tool.SettingParam;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
@@ -169,7 +171,7 @@ namespace Compdfkit_Tools.PDFControl
         private void FormBtn_Click(object sender, RoutedEventArgs e)
         {
             ClearToolState(sender as ToggleButton);
-            fromPropertyControl.SetPropertyForType(null, null);
+            fromPropertyControl.SetPropertyForType(null, null,null);
             if ((bool)(sender as ToggleButton).IsChecked)
             {
                 switch (StringToType((sender as ToggleButton).Tag.ToString()))
@@ -199,11 +201,11 @@ namespace Compdfkit_Tools.PDFControl
                     default:
                         break;
                 }
-                pdfViewer.SetMouseMode(MouseModes.FormEditTool);
+                pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
             }
             else
             {
-                pdfViewer.SetMouseMode(MouseModes.FormEditTool);
+                pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
             }
         }
 
@@ -242,81 +244,87 @@ namespace Compdfkit_Tools.PDFControl
 
         private void CreateTextBox()
         {
-            pdfViewer.SetMouseMode(MouseModes.FormEditTool);
-            WidgetTextBoxArgs textArgs = new WidgetTextBoxArgs();
-            textArgs.LineWidth = 1;
-            textArgs.FontName = "Helvetica";
-            textArgs.LineColor = Colors.Black;
-            textArgs.FieldName = "Text"+ GetTime();
-            pdfViewer.SetToolParam(textArgs);
+            pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
+           TextBoxParam textBoxParam = new TextBoxParam();
+            textBoxParam.LineWidth = 1;
+            textBoxParam.FontName = "Helvetica";
+            textBoxParam.LineColor =new byte[] {0,0,0 };
+            textBoxParam.FieldName = "Text"+ GetTime();
+            DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();
+            defaultSettingParam.SetAnnotParam(textBoxParam);
         }
 
         private void CreateRadioBtn()
         {
-            pdfViewer.SetMouseMode(MouseModes.FormEditTool);
-            WidgetRadioButtonArgs radioArgs = new WidgetRadioButtonArgs();
-            radioArgs.CheckStyle = C_CHECK_STYLE.CK_CIRCLE;
-            radioArgs.BorderStyle = C_BORDER_STYLE.BS_SOLID;
-            radioArgs.LineColor = Colors.Black;
-            radioArgs.LineWidth = 2;
-            radioArgs.FieldName = "Radio button" + GetTime();
-            pdfViewer.SetToolParam(radioArgs);
+            pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
+            RadioButtonParam radioButtonParam = new RadioButtonParam();
+            radioButtonParam.CheckStyle = C_CHECK_STYLE.CK_CIRCLE;
+            radioButtonParam.BorderStyle = C_BORDER_STYLE.BS_SOLID;
+            radioButtonParam.LineColor = new byte[] { 0, 0, 0 };
+            radioButtonParam.LineWidth = 2;
+            radioButtonParam.FieldName = "Radio button" + GetTime();
+            DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();
+            defaultSettingParam.SetAnnotParam(radioButtonParam);
         }
 
         private void CreateCheckBox()
         {
-            pdfViewer.SetMouseMode(MouseModes.FormEditTool);
-            WidgetCheckBoxArgs checkBoxArgs = new WidgetCheckBoxArgs();
-            checkBoxArgs.CheckStyle = C_CHECK_STYLE.CK_CHECK;
-            checkBoxArgs.BorderStyle = C_BORDER_STYLE.BS_SOLID;
-            checkBoxArgs.LineColor = Colors.Black;
-            checkBoxArgs.LineWidth = 1;
-            checkBoxArgs.FieldName = "Checkbox" + GetTime();
-            pdfViewer.SetToolParam(checkBoxArgs);
+            pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
+            CheckBoxParam checkBoxParam = new CheckBoxParam();
+            checkBoxParam.CheckStyle = C_CHECK_STYLE.CK_CHECK;
+            checkBoxParam.BorderStyle = C_BORDER_STYLE.BS_SOLID;
+            checkBoxParam.LineColor = new byte[] { 0, 0, 0 };
+            checkBoxParam.LineWidth = 1;
+            checkBoxParam.FieldName = "Checkbox" + GetTime();
+            DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();
+            defaultSettingParam.SetAnnotParam(checkBoxParam);
         }
 
         private void CreateComboBox()
         {
-            pdfViewer.SetMouseMode(MouseModes.FormEditTool);
-            WidgetComboBoxArgs dropDownArgs = new WidgetComboBoxArgs();
-            dropDownArgs.LineColor = Colors.Black;
-            dropDownArgs.LineWidth = 1;
-            dropDownArgs.FieldName = "Combobox" + GetTime();
-            pdfViewer.SetToolParam(dropDownArgs);
+            pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
+            ComboBoxParam comboBoxParam = new ComboBoxParam();
+            comboBoxParam.LineColor = new byte[] { 0, 0, 0 };
+            comboBoxParam.LineWidth = 1;
+            comboBoxParam.FieldName = "Combobox" + GetTime();
+            DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();
+            defaultSettingParam.SetAnnotParam(comboBoxParam);
         }
 
         private void CreateListBox()
         {
-            pdfViewer.SetMouseMode(MouseModes.FormEditTool);
-            WidgetListBoxArgs listArgs = new WidgetListBoxArgs();
-            listArgs.LineColor = Colors.Black;
-            listArgs.LineWidth = 1;
-            listArgs.FieldName = "List" + GetTime();
-            pdfViewer.SetToolParam(listArgs);
+            pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
+            ListBoxParam listBoxParam = new ListBoxParam();
+            listBoxParam.LineColor = new byte[] { 0, 0, 0 };
+            listBoxParam.LineWidth = 1;
+            listBoxParam.FieldName = "List" + GetTime();
+            DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();
+            defaultSettingParam.SetAnnotParam(listBoxParam);
         }
 
         private void CreatePushBtn()
         {
-            pdfViewer.SetMouseMode(MouseModes.FormEditTool);
-            WidgetPushButtonArgs pushButtonArgs = new WidgetPushButtonArgs();
-            pushButtonArgs.Text = "Push Button";
-            pushButtonArgs.LineWidth = 1;
-            Dictionary<C_ACTION_TYPE, string> ActionDict = new Dictionary<C_ACTION_TYPE, string>();
-            ActionDict[C_ACTION_TYPE.ACTION_TYPE_URI] = @"https://www.compdf.com";
-            pushButtonArgs.ActionDict = ActionDict;
-            pushButtonArgs.LineColor = Colors.Black;
-            pushButtonArgs.FieldName = "Button" + GetTime();
-            pdfViewer.SetToolParam(pushButtonArgs);
+            pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
+            PushButtonParam pushButtonParam = new PushButtonParam();
+            pushButtonParam.Text = "Push Button";
+            pushButtonParam.LineWidth = 1;
+            pushButtonParam.Action = C_ACTION_TYPE.ACTION_TYPE_URI;
+            pushButtonParam.Uri = @"https://www.compdf.com";
+            pushButtonParam.LineColor = new byte[] { 0, 0, 0 };
+            pushButtonParam.FieldName = "Button" + GetTime();
+            DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();
+            defaultSettingParam.SetAnnotParam(pushButtonParam);
         }
 
         private void CreateSign()
         {
-            pdfViewer.SetMouseMode(MouseModes.FormEditTool);
-            WidgetSignArgs signArgs = new WidgetSignArgs();
-            signArgs.LineWidth = 1;
-            signArgs.LineColor = Colors.Black;
-            signArgs.FieldName= "Signature" + GetTime();
-            pdfViewer.SetToolParam(signArgs);
+            pdfViewer.PDFToolManager.SetToolType(ComPDFKit.Tool.CPDFToolManager.ToolType.FormEdit);
+            SignatureParam signatureParam = new SignatureParam();
+            signatureParam.LineWidth = 1;
+            signatureParam.LineColor = new byte[] { 0, 0, 0 };
+            signatureParam.FieldName= "Signature" + GetTime();
+            DefaultSettingParam defaultSettingParam = pdfViewer.PDFViewTool.GetDefaultSettingParam();
+            defaultSettingParam.SetAnnotParam(signatureParam);
         }
 
         #endregion

+ 1 - 1
Demo/Examples/Compdfkit_Tools/Form/FromPropertyControl.xaml.cs

@@ -65,7 +65,7 @@ namespace Compdfkit_Tools.PDFControl
                     if (pdfViewerControl.PDFToolManager.GetToolType()==CPDFToolManager.ToolType.FormEdit)
                     {
                         CPDFSignatureUI signatureProperty = new CPDFSignatureUI();
-                        signatureProperty.SetFormProperty(Args, pdfViewerControl);
+                        signatureProperty.SetFormProperty(annotParam, pdfViewerControl, annotation);
                         currentPanel = signatureProperty;
                     }
                     else

+ 4 - 0
Demo/Examples/Forms/Forms.csproj

@@ -92,6 +92,10 @@
     <None Include="packages.config" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\..\..\compdfkit_windows\ComPDFKit.Tool\ComPDFKit.Tool.csproj">
+      <Project>{a061ee7a-6704-4bd9-86ee-48ed5df75e2f}</Project>
+      <Name>ComPDFKit.Tool</Name>
+    </ProjectReference>
     <ProjectReference Include="..\Compdfkit_Tools\Compdfkit_Tools.csproj">
       <Project>{9363bcb1-3a67-446a-8093-5708b86bf418}</Project>
       <Name>Compdfkit_Tools</Name>

+ 0 - 10
Demo/Examples/Forms/MainWindow.xaml.cs

@@ -1,23 +1,13 @@
-using ComPDFKit.PDFDocument;
-using Compdfkit_Tools.Data;
 using Compdfkit_Tools.Helper;
 using Compdfkit_Tools.PDFControl;
-using ComPDFKitViewer;
-using ComPDFKitViewer.AnnotEvent;
-using ComPDFKitViewer.PdfViewer;
 using Microsoft.Win32;
 using System;
 using System.Collections.Generic;
 using System.ComponentModel;
-using System.Diagnostics;
-using System.Drawing;
-using System.IO;
 using System.Runtime.CompilerServices;
 using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Controls.Primitives;
-using System.Windows.Input;
-using System.Windows.Media.Imaging;
 using Compdfkit_Tools.PDFView;
 
 namespace FormViewControl