Prechádzať zdrojové kódy

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

ZhouJieSheng 2 rokov pred
rodič
commit
65f2db2207

BIN
PDF Office/ComPDFKit.Viewer.dll


+ 14 - 2
PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml.cs

@@ -22,14 +22,20 @@ namespace PDF_Office.CustomControl.CompositeControl
     //默认:字体集合、IsValueContent为false、Value作为集合某项的值
 
 
-    public class ComboDataItem
+    public class ComboDataItem : Prism.Mvvm.BindableBase
     {
         //字符串类型的值
         public string ValueStr { get; private set; }
         //数字类型的值
         public double Value { get; private set; }
+        //public string Content { get; private set; }
         //下拉框显示的内容
-        public string Content { get; private set; }
+        private string _content = "";
+        public string Content
+        {
+            get { return _content; }
+            private set { SetProperty(ref _content, value); }
+        }
         //下拉框显示的内容+单位:限数字值的单位
         public string Unit { get; private set; }
         //数字类型
@@ -45,6 +51,11 @@ namespace PDF_Office.CustomControl.CompositeControl
             ValueStr = valueStr;
         }
 
+        public void SetContent(string content)
+        {
+            Content = content;
+        }
+
     }
     /// <summary>
     /// CustomComboControl.xaml 的交互逻辑
@@ -250,6 +261,7 @@ namespace PDF_Office.CustomControl.CompositeControl
                         {
                             control.Value = selectedItems.Value;
                         }
+                        control.title.Text = selectedItems.Content;
                     }
 
                     if (control.comBox.Items == null || control.comBox.Items.Count == 0)

+ 140 - 0
PDF Office/Model/Dialog/ConverterDialogs/ConverterDialogsModel.cs

@@ -6,6 +6,8 @@ using System.Text;
 using System.Threading.Tasks;
 using ComDocumentAIKit;
 using ComPDFKit_Conversion.Options;
+using Microsoft.Office.Interop.Word;
+using PDF_Office.Helper;
 
 namespace PDF_Office.Model.Dialog.ConverterDialogs
 {
@@ -64,6 +66,144 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
         /// </summary>
         public ConvertOptions Options=new ConvertOptions();
 
+        private void ConverterClear()
+        {
+            ConverterHelper.Clear();
+            App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed;
+        }
+        private void SetProgress(int pageIndex)
+        {
+            App.mainWindowViewModel.Value = pageIndex;
+            
+            if (App.mainWindowViewModel.Value == App.mainWindowViewModel.MaxValue) { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }
+        }
+
+        public async void OnOpened(Prism.Services.Dialogs.DialogResult e)
+        {
+            if (e.Result == Prism.Services.Dialogs.ButtonResult.Cancel) { return; }
+            bool result = false;
+            string convertType = "";
+            OnProgress GetProgress = null;
+            GetProgress += SetProgress;
+            App.mainWindowViewModel.ProcessCloseAction = ConverterClear;
+            convertType = e.Parameters.GetValue<string>(ParameterNames.ConverterType).ToString();
+            App.mainWindowViewModel.ProgressTitle = "Converting";
+            App.mainWindowViewModel.Value = 0;
+            App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Visible;
+            switch (convertType)
+            {
+                case "CSV":
+                    ConverterCSVDialogModel ConverterCSVModel = e.Parameters.GetValue<ConverterCSVDialogModel>(ParameterNames.ConverterTypeModel);
+
+                    if (ConverterCSVModel != null)
+                    {
+                        App.mainWindowViewModel.MaxValue = ConverterCSVModel.PageIndexLists.Count();
+
+                        for (int i = 0; ConverterCSVModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterCSVModel.PageIndexLists[i] = ConverterCSVModel.PageIndexLists[i] + 1;
+                        }
+                        result = await ConverterHelper.CSVConvert(ConverterCSVModel.InputPath, ConverterCSVModel.OutputPath, GetProgress, ConverterCSVModel.PageIndexLists, ConverterCSVModel.Pawssword, ConverterCSVModel.csvOptions);
+
+                    }
+                    else { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }
+                    break;
+                case "Excel":
+                    ConverterExcelDialogModel ConverterExcelModel = e.Parameters.GetValue<ConverterExcelDialogModel>(ParameterNames.ConverterTypeModel);
+                    if (ConverterExcelModel != null)
+                    {
+                        App.mainWindowViewModel.MaxValue = ConverterExcelModel.PageIndexLists.Count();
+                        for (int i = 0; ConverterExcelModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterExcelModel.PageIndexLists[i] = ConverterExcelModel.PageIndexLists[i] + 1;
+                        }
+                        result = await ConverterHelper.ExcelConvert(ConverterExcelModel.InputPath, ConverterExcelModel.OutputPath, GetProgress, ConverterExcelModel.PageIndexLists, ConverterExcelModel.Pawssword, ConverterExcelModel.excelOptions);
+                    }
+                    else { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }
+                    break;
+                case "HTML":
+                    ConverterHTMLDialogModel ConverterHTMLModel = e.Parameters.GetValue<ConverterHTMLDialogModel>(ParameterNames.ConverterTypeModel);
+                    if (ConverterHTMLModel != null)
+                    {
+                        App.mainWindowViewModel.MaxValue = ConverterHTMLModel.PageIndexLists.Count();
+                        for (int i = 0; ConverterHTMLModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterHTMLModel.PageIndexLists[i] = ConverterHTMLModel.PageIndexLists[i] + 1;
+                        }
+                        result = await ConverterHelper.HTMLConvert(ConverterHTMLModel.InputPath, ConverterHTMLModel.OutputPath, GetProgress, ConverterHTMLModel.PageIndexLists, ConverterHTMLModel.Pawssword, ConverterHTMLModel.htmlOptions);
+                    }
+                    else { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }
+                    break;
+                case "Img":
+                    ConverterImgDialogModel ConverterImgModel = e.Parameters.GetValue<ConverterImgDialogModel>(ParameterNames.ConverterTypeModel);
+                    if (ConverterImgModel != null)
+                    {
+                        App.mainWindowViewModel.MaxValue = ConverterImgModel.PageIndexLists.Count();
+                        for (int i = 0; ConverterImgModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterImgModel.PageIndexLists[i] = ConverterImgModel.PageIndexLists[i] + 1;
+                        }
+                        result = await ConverterHelper.ImgConvert(ConverterImgModel.InputPath, ConverterImgModel.OutputPath, GetProgress, ConverterImgModel.PageIndexLists, ConverterImgModel.Pawssword, ConverterImgModel.imageType, ConverterImgModel.imgOptions);
+                    }
+                    else { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }
+                    break;
+                case "PPT":
+                    ConverterPPTDialogModel ConverterPPTModel = e.Parameters.GetValue<ConverterPPTDialogModel>(ParameterNames.ConverterTypeModel);
+                    if (ConverterPPTModel != null)
+                    {
+                        App.mainWindowViewModel.MaxValue = ConverterPPTModel.PageIndexLists.Count();
+                        for (int i = 0; ConverterPPTModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterPPTModel.PageIndexLists[i] = ConverterPPTModel.PageIndexLists[i] + 1;
+                        }
+                        result = await ConverterHelper.PPTConvert(ConverterPPTModel.InputPath, ConverterPPTModel.OutputPath, GetProgress, ConverterPPTModel.PageIndexLists, ConverterPPTModel.Pawssword, ConverterPPTModel.pPTOptions);
+                    }
+                    else { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }
+                    break;
+                case "RTF":
+                    ConverterRTFDialogModel ConverterRTFModel = e.Parameters.GetValue<ConverterRTFDialogModel>(ParameterNames.ConverterTypeModel);
+                    if (ConverterRTFModel != null)
+                    {
+                        App.mainWindowViewModel.MaxValue = ConverterRTFModel.PageIndexLists.Count();
+                        for (int i = 0; ConverterRTFModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterRTFModel.PageIndexLists[i] = ConverterRTFModel.PageIndexLists[i] + 1;
+                        }
+                        result = await ConverterHelper.RTFConvert(ConverterRTFModel.InputPath, ConverterRTFModel.OutputPath, GetProgress, ConverterRTFModel.PageIndexLists, ConverterRTFModel.Pawssword, ConverterRTFModel.rTFOptions);
+                    }
+                    else { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }
+                    break;
+                case "Text":
+                    ConverterTextDialogModel ConverterTextModel = e.Parameters.GetValue<ConverterTextDialogModel>(ParameterNames.ConverterTypeModel);
+                    if (ConverterTextModel != null)
+                    {
+                        App.mainWindowViewModel.MaxValue = ConverterTextModel.PageIndexLists.Count();
+                        for (int i = 0; ConverterTextModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterTextModel.PageIndexLists[i] = ConverterTextModel.PageIndexLists[i] + 1;
+                        }
+                        result = await ConverterHelper.TxtConvert(ConverterTextModel.InputPath, ConverterTextModel.OutputPath, GetProgress, ConverterTextModel.PageIndexLists, ConverterTextModel.Pawssword, ConverterTextModel.txtOptions);
+                    }
+                    else { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }
+                    break;
+                case "Word":
+                    ConverterWordDialogModel ConverterWordModel = e.Parameters.GetValue<ConverterWordDialogModel>(ParameterNames.ConverterTypeModel);
+                    if (ConverterWordModel != null)
+                    {
+                        App.mainWindowViewModel.MaxValue = ConverterWordModel.PageIndexLists.Count();
+                        for (int i = 0; ConverterWordModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterWordModel.PageIndexLists[i] = ConverterWordModel.PageIndexLists[i] + 1;
+                        }
+                        result = await ConverterHelper.WordConvert(ConverterWordModel.InputPath, ConverterWordModel.OutputPath, GetProgress, ConverterWordModel.PageIndexLists, ConverterWordModel.Pawssword, ConverterWordModel.wordOptions);
+                    }
+                    else { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }
+                    break;
+                default:
+                    break;
+            }
+        }
+
     }
 
 }

+ 59 - 5
PDF Office/Model/Dialog/ToolsDialogs/CompressDialogModel/CompressDialogModel.cs

@@ -1,14 +1,21 @@
-using System;
+using ComPDFKit.PDFDocument;
+using Microsoft.Office.Interop.Word;
+using PDF_Office.Helper;
+using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
-
+using Task = System.Threading.Tasks.Task;
+
 namespace PDF_Office.Model.Dialog.ToolsDialogs
 {
     public class CompressDialogModel
-    {
-       public enum EnumQualityLevel {  
+    {
+        CPDFDocument tempDocument = null;
+        IntPtr compressingIntpr = IntPtr.Zero;
+        public enum EnumQualityLevel {  
         StatusLarge=100,
         StatusStandard=80,
         StatusDefault=40,
@@ -19,5 +26,52 @@ namespace PDF_Office.Model.Dialog.ToolsDialogs
         public EnumQualityLevel CompressQuality { get; set; }
 
         public static string PageIndex { get; set; }
-    }
+
+        public void CompressClear()
+        {
+            tempDocument.CompressFile_Cancel(compressingIntpr);
+            App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed;
+        }
+        private int GetIndex(int pageindex)
+        {
+            App.mainWindowViewModel.Value = (pageindex + 1);
+           
+            if (App.mainWindowViewModel.Value == App.mainWindowViewModel.MaxValue) { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }
+            return 0;
+        }
+
+        public async void OnOpened(Prism.Services.Dialogs.DialogResult e)
+        {
+            if (e.Result == Prism.Services.Dialogs.ButtonResult.Cancel) { return; }
+            CPDFDocument doc = null;
+            CPDFDocument.GetPageIndexDelegate indexDelegate = null;
+           
+            string filepath = "";
+            string password = "";
+            int compressquality = 45;
+            doc = e.Parameters.GetValue<CPDFDocument>(ParameterNames.PDFDocument);
+            filepath = e.Parameters.GetValue<string>(ParameterNames.FilePath);
+            password = e.Parameters.GetValue<string>(ParameterNames.PassWord);
+            compressquality = e.Parameters.GetValue<int>("compressDialogModel.CompressQuality");
+            if (doc != null)
+            {
+                App.mainWindowViewModel.Value = 0;
+                App.mainWindowViewModel.ProgressTitle = "Compressing";
+                App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Visible;
+                App.mainWindowViewModel.MaxValue = doc.PageCount;
+                CPDFDocument document = CPDFDocument.InitWithFilePath(doc.FilePath);
+                document.UnlockWithPassword(password);
+                indexDelegate += GetIndex;
+                compressingIntpr = document.CompressFile_Init(compressquality, indexDelegate);
+                //GC.KeepAlive(indexDelegate);
+                tempDocument = document;
+                Trace.WriteLine("compressDialogModel.CompressQuality" + compressquality);
+                App.mainWindowViewModel.ProcessCloseAction = CompressClear;
+                await Task.Run<bool>(() => { return document.CompressFile_Start(compressingIntpr, filepath); });
+                CommonHelper.ShowFileBrowser(filepath);
+                document.Release();
+            }
+        }
+    }
+    
 }

+ 54 - 2
PDF Office/Model/PropertyPanel/AnnotPanel/FontStyleItem.cs

@@ -230,12 +230,64 @@ namespace PDF_Office.Model.PropertyPanel.AnnotPanel
             var FontFamilyItems = new List<ComboDataItem>();
             ComboDataItem item = new ComboDataItem("Courier", "Courier New");
             FontFamilyItems.Add(item);
-            item = new ComboDataItem("Helvetica", "Helvetica");
+            item = new ComboDataItem("Arial", "Helvetica");
             FontFamilyItems.Add(item);
-            item = new ComboDataItem("Times-Roman", "Times New Roman");
+            item = new ComboDataItem(/*"Times-Roman"*/"Times", "Times New Roman");
             FontFamilyItems.Add(item);
 
             return FontFamilyItems;
+        }
+
+        public static List<ComboDataItem> GetDateFormats()
+        {
+            var dateFormatItems = new List<ComboDataItem>();
+            foreach(var itemFormat in GetTimesFormats())
+            {
+                ComboDataItem item = new ComboDataItem(itemFormat, "format");
+                dateFormatItems.Add(item);
+            }
+
+            return dateFormatItems;
+        }
+
+        private static List<string> GetTimesFormats()
+        {
+            List<string> TimesItems = new List<string>();
+            TimesItems.Add("yyyy年M月d日");
+            TimesItems.Add("M/d");
+            TimesItems.Add("M/d/yy");
+            TimesItems.Add("M/d/yyyy");
+            TimesItems.Add("MM/dd/yy");
+            TimesItems.Add("MM/dd/yyyy");
+
+            TimesItems.Add("d/M/yy");
+            TimesItems.Add("d/M/yyyy");
+            TimesItems.Add("dd/MM/yy");
+            TimesItems.Add("dd/MM/yyyy");
+
+            TimesItems.Add("MM/yy");
+            TimesItems.Add("MM/yyyy");
+
+            TimesItems.Add("M.d.yy");
+            TimesItems.Add("M.d.yyyy");
+            TimesItems.Add("MM.dd.yy");
+            TimesItems.Add("MM.dd.yyyy");
+            TimesItems.Add("MM.yy");
+            TimesItems.Add("MM.yyyy");
+            TimesItems.Add("d.M.yy");
+            TimesItems.Add("d.M.yyyy");
+            TimesItems.Add("dd.MM.yy");
+            TimesItems.Add("dd.MM.yyyy");
+            TimesItems.Add("yy-MM-dd");
+            TimesItems.Add("yyyy-MM-dd");
+            return TimesItems;
+
+
+
+
+
+
+
         }
     }
    

+ 7 - 0
PDF Office/PDF Office.csproj

@@ -1030,6 +1030,9 @@
     <Compile Include="Views\PropertyPanel\AnnotPanel\StampAnnotProperty.xaml.cs">
       <DependentUpon>StampAnnotProperty.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\AnnotPanel\StickyNotePopup.xaml.cs">
+      <DependentUpon>StickyNotePopup.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\AnnotPanel\StickyNoteProperty.xaml.cs">
       <DependentUpon>StickyNoteProperty.xaml</DependentUpon>
     </Compile>
@@ -1787,6 +1790,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\PropertyPanel\AnnotPanel\StickyNotePopup.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\StickyNoteProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 15 - 3
PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs

@@ -178,7 +178,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                 case "RbtnPoint":
                     Shape = "DotShape";
                     ShapePoints = new List<List<Point>> { new List<Point> { new Point(12.19995, 10), new Point(12.19995, 10) } };
-                    LineWidthMultiple = 4;
+                    LineWidthMultiple = 5;
                     annotArgs = GetStamp();
                     break;
                 default://图章
@@ -447,7 +447,8 @@ namespace PDF_Office.ViewModels.FillAndSign
             annotAttribsList[AnnotAttrib.FontStyle] = freetextArgs.FontStyle;
             annotAttribsList[AnnotAttrib.FontWeight] = freetextArgs.FontWeight;
             annotAttribsList[AnnotAttrib.TextAlign] = textAlignment;
-            annotAttribsList[AnnotAttrib.NoteText] = freetextArgs.TextContent;
+            annotAttribsList[AnnotAttrib.NoteText] = freetextArgs.TextContent;
+            annotAttribsList[AnnotAttrib.Text] = freetextArgs.TextContent;
 
             AddToPropertyPanel("FreetextAnnotProperty", "Freetext", selectedArgs, annotAttribsList);
             return freetextArgs;
@@ -499,6 +500,15 @@ namespace PDF_Office.ViewModels.FillAndSign
                 }
             }
 
+            if (toolTag == "Freetext")
+            {
+                propertyPanel.SetIsTextFill(true);
+            }
+            else
+            {
+                propertyPanel.SetIsTextFill(false);
+            }
+
             if (string.IsNullOrEmpty(viewContent) == false)
             {
 
@@ -1052,7 +1062,9 @@ namespace PDF_Office.ViewModels.FillAndSign
             switch (annot.EventType)
             {
 
-
+                case AnnotArgsType.AnnotFreeText:
+                    GetFreetext(e.AnnotItemsList);
+                    break;
 
                 case AnnotArgsType.AnnotFreehand:
                     GetFreehand(e.AnnotItemsList);

+ 2 - 0
PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs

@@ -49,6 +49,7 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                 fillAndSignContentViewModel.SelectColor = value;
                 if (FillAndSignContentViewModel.IsEdit)
                 {
+                  //  PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
                     PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Color, (selectColor as SolidColorBrush).Color);
                 }
                 else { fillAndSignContentViewModel.SetStamp(); }
@@ -66,6 +67,7 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                 fillAndSignContentViewModel.FillOpacity = value;
 
                 if (FillAndSignContentViewModel.IsEdit) { PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, fillOpacity); }
+
                 else { fillAndSignContentViewModel.SetStamp(); }
 
             }

+ 75 - 30
PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs

@@ -1,7 +1,9 @@
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.Helper;
 using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
 using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using PDF_Office.Model.Dialog.ToolsDialogs;
 using PDF_Office.Model.PDFTool;
 using PDF_Office.Views;
 using PDFSettings;
@@ -142,12 +144,24 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
                         break;
 
                     case PDFFnType.Compress:
+
+                        viewer.InitDocument(dlg.FileName);
+                        if (!CheckPassword(viewer)) { return; }
                         DialogParameters compresspdf = new DialogParameters();
-                        compresspdf.Add(ParameterNames.BatchProcessing_Name, "1");
-                        HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
-                        HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
-                        compresspdf.Add(ParameterNames.FilePath, dlg.FileNames);
-                        dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, compresspdf, e => { });
+                        compresspdf.Add(ParameterNames.PDFViewer, viewer);
+                        dialogs.ShowDialog(DialogNames.CompressDialog, compresspdf, e =>
+                        {
+                            CompressDialogModel compressDialogModel = new CompressDialogModel();
+                            compressDialogModel.OnOpened((Prism.Services.Dialogs.DialogResult)e);
+                            // OnOpened((Prism.Services.Dialogs.DialogResult)e);
+                        });
+                        //批量
+                        //DialogParameters compresspdf = new DialogParameters();
+                        //compresspdf.Add(ParameterNames.BatchProcessing_Name, "1");
+                        //HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
+                        //HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
+                        //compresspdf.Add(ParameterNames.FilePath, dlg.FileNames);
+                        //dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, compresspdf, e => { });
                         break;
 
                     case PDFFnType.ImageToPDF:
@@ -183,12 +197,13 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
 
                         break;
                     case PDFFnType.ConvertPDF:
-                        DialogParameters convertpdf = new DialogParameters();
-                        convertpdf.Add(ParameterNames.BatchProcessing_Name, "0");
-                        HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
-                        HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
-                        convertpdf.Add(ParameterNames.FilePath, dlg.FileNames);
-                        dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdf, e => { });
+                        
+                        //DialogParameters convertpdf = new DialogParameters();
+                        //convertpdf.Add(ParameterNames.BatchProcessing_Name, "0");
+                        //HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
+                        //HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
+                        //convertpdf.Add(ParameterNames.FilePath, dlg.FileNames);
+                        //dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdf, e => { });
 
                         break;
                     case PDFFnType.BatchRemove:
@@ -241,31 +256,61 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
                         dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoimage, e => { });
                         break;
                     case PDFFnType.PDFToExcel:
+
+                        viewer.InitDocument(dlg.FileName);
+                        if (!CheckPassword(viewer)) { return; }
                         DialogParameters convertpdftoexcel = new DialogParameters();
-                        convertpdftoexcel.Add(ParameterNames.BatchProcessing_Name, "0");
-                        convertpdftoexcel.Add("ConverterTypeIndex", 1);
-                        HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
-                        HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
-                        convertpdftoexcel.Add(ParameterNames.FilePath, dlg.FileNames);
-                        dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoexcel, e => { });
+                        convertpdftoexcel.Add(ParameterNames.PDFViewer, viewer);
+                        dialogs.ShowDialog(DialogNames.ConverterExcelDialog, convertpdftoexcel, e =>
+                        {
+                            ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
+                            converterDialogsModel.OnOpened((DialogResult)e);
+                        });
+                        //DialogParameters convertpdftoexcel = new DialogParameters();
+                        //convertpdftoexcel.Add(ParameterNames.BatchProcessing_Name, "0");
+                        //convertpdftoexcel.Add("ConverterTypeIndex", 1);
+                        //HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
+                        //HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
+                        //convertpdftoexcel.Add(ParameterNames.FilePath, dlg.FileNames);
+                        //dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoexcel, e => { });
                         break;
                     case PDFFnType.PDFToPPT:
-                        DialogParameters convertpdftoppt = new DialogParameters();
-                        convertpdftoppt.Add(ParameterNames.BatchProcessing_Name, "0");
-                        convertpdftoppt.Add("ConverterTypeIndex", 2);
-                        HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
-                        HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
-                        convertpdftoppt.Add(ParameterNames.FilePath, dlg.FileNames);
-                        dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoppt, e => { });
+                        viewer.InitDocument(dlg.FileName);
+                        if (!CheckPassword(viewer)) { return; }
+                        DialogParameters convertpdf = new DialogParameters();
+                        convertpdf.Add(ParameterNames.PDFViewer, viewer);
+                        dialogs.ShowDialog(DialogNames.ConverterPPTDialog, convertpdf, e =>
+                        {
+                            ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
+                            converterDialogsModel.OnOpened((DialogResult)e);
+                        });
+                        //批量处理
+                        //DialogParameters convertpdftoppt = new DialogParameters();
+                        //convertpdftoppt.Add(ParameterNames.BatchProcessing_Name, "0");
+                        //convertpdftoppt.Add("ConverterTypeIndex", 2);
+                        //HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
+                        //HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
+                        //convertpdftoppt.Add(ParameterNames.FilePath, dlg.FileNames);
+                        //dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoppt, e => { });
                         break;
                     case PDFFnType.PDFToWord:
+                        viewer.InitDocument(dlg.FileName);
+                        if (!CheckPassword(viewer)) { return; }
                         DialogParameters convertpdftoword = new DialogParameters();
-                        convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
-                        convertpdftoword.Add("ConverterTypeIndex", 0);
-                        HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
-                        HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
-                        convertpdftoword.Add(ParameterNames.FilePath, dlg.FileNames);
-                        dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
+                        convertpdftoword.Add(ParameterNames.PDFViewer, viewer);
+                        dialogs.ShowDialog(DialogNames.ConverterWordDialog, convertpdftoword, e =>
+                        {
+                            ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
+                            converterDialogsModel.OnOpened((DialogResult)e);
+                        });
+                        //批量处理
+                        //DialogParameters convertpdftoword = new DialogParameters();
+                        //convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
+                        //convertpdftoword.Add("ConverterTypeIndex", 0);
+                        //HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
+                        //HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
+                        //convertpdftoword.Add(ParameterNames.FilePath, dlg.FileNames);
+                        //dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
                         break;
                     case PDFFnType.Batch:
                         DialogParameters batcpdf = new DialogParameters();

+ 143 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -35,6 +35,29 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             set => SetProperty(ref _basicVm, value);
         }
 
+        private bool _isFillFreeText = false;
+        public bool IsFillFreeTextAnnot
+        {
+            get { return _isFillFreeText; }
+            set => SetProperty(ref _isFillFreeText, value);
+        }
+
+        private bool _isCheckedTime = false;
+        public bool IsCheckedTime
+        {
+            get { return _isCheckedTime; }
+            set => SetProperty(ref _isCheckedTime, value);
+        }
+
+        private ComboDataItem _currrentDateFormat = new ComboDataItem("M/d", "format");
+        public ComboDataItem CurrrentDateFormat
+        {
+            get { return _currrentDateFormat; }
+            set => SetProperty(ref _currrentDateFormat, value);
+        }
+
+        public List<ComboDataItem> DateFormatItems { get; private set; }
+
         public AnnotAttribEvent AnnotEvent { get; set; }
         private FreeTextAnnotArgs Annot;
         private AnnotPropertyPanel PropertyPanel;
@@ -59,6 +82,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public DelegateCommand ReDefineFontStyleCommand { get; set; }
         public DelegateCommand RestoreDefaultStyleCommand { get; set; }
 
+        public DelegateCommand DateFormatChangedCommand { get; set; }
+        public DelegateCommand ShowTimeCheckedChnagedCommand { get; set; }
+
         public event EventHandler<object> LoadPropertyHandler;
 
         public FreetextAnnotPropertyViewModel()
@@ -87,15 +113,43 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             //内容对齐
             TextAlignCheckedCommand = new DelegateCommand<object>(TextAlignChecked);
 
+            //填写与签名:日期
+            DateFormatChangedCommand = new DelegateCommand(DateFormatChanged);
+            ShowTimeCheckedChnagedCommand = new DelegateCommand(ShowTimeCheckedChnaged);
             //MVP不上
             LineModeCheckedCommand = new DelegateCommand<object>(LineMode_Checked);
             SelectedOpacityValueCommand = new DelegateCommand<object>(SelectedOpacityValue);
             InitVariable();
         }
 
+      
         private void InitVariable()
         {
-            
+            DateFormatItems = new List<ComboDataItem>();
+            DateFormatItems = TextFont.GetDateFormats();
+            UpdateDateFormatLists();
+
+
+        }
+
+        private void UpdateDateFormatLists()
+        {
+            string strTime = " HH:mm:ss";
+            foreach (var item in DateFormatItems)
+            {
+                if (IsCheckedTime)
+                    strTime = item.ValueStr + " HH:mm:ss";
+                else
+                    strTime = item.ValueStr;
+
+                string stadate = System.DateTime.Now.ToString(strTime);
+                item.SetContent(stadate);
+
+                if (CurrrentDateFormat != null && item.ValueStr == CurrrentDateFormat.ValueStr)
+                    CurrrentDateFormat.SetContent(stadate);
+            }
+
+            CurrrentDateFormat = new ComboDataItem(CurrrentDateFormat.ValueStr, CurrrentDateFormat.Content);
         }
 
      
@@ -318,6 +372,28 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
            // var item = FontStyleList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
         }
 
+        private void DateFormatChanged()
+        {
+            if(CurrrentDateFormat != null)
+            {
+                if (IsCheckedTime)
+                    UpdateDateFormatLists();
+
+                PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.NoteText, CurrrentDateFormat.Content);
+            }
+
+        }
+
+        private void ShowTimeCheckedChnaged()
+        {
+            if (CurrrentDateFormat != null)
+            {
+                UpdateDateFormatLists();
+                PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.NoteText, CurrrentDateFormat.Content);
+            }
+        }
+
+
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
             return true;
@@ -326,6 +402,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
             BasicVm.IsMultiSelected = false;
+          //  IsCheckedTime = false;
         }
 
         public void OnNavigatedTo(NavigationContext navigationContext)
@@ -333,11 +410,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             navigationContext.Parameters.TryGetValue<AnnotPropertyPanel>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
             if (PropertyPanel != null)
             {
+               
                 AnnotEvent = PropertyPanel.AnnotEvent;
                 Annot = PropertyPanel.annot as FreeTextAnnotArgs;
                 LoadPropertyHandler?.Invoke(this, Annot);
                 BasicVm.AnnotTypeTitle = "文字";
                 BasicVm.IsMultiSelected = PropertyPanel.IsMultiSelected;
+                IsFillFreeTextAnnot = PropertyPanel.IsTextFill;
                 if (BasicVm.IsMultiSelected)
                 {
                     IsAttributeEquals();
@@ -347,6 +426,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 {
                     GetAnnotProperty();
                 }
+
+                IsFillFreeTextAnnot = PropertyPanel.IsTextFill;
             }
         }
 
@@ -473,7 +554,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             FontVm.GetCurrentFontFamily(Annot.FontFamily.ToString(), Annot.FontFamily.ToString());
             FontVm.GetFontWeights_Style(Annot.FontStyle, Annot.FontWeight);
 
-            string str = "";
+            GetTimeFormat();
+
+
+                string str = "";
             if (Annot.Align == TextAlignment.Left)
                 str = "AlignLeft";
             else if (Annot.Align == TextAlignment.Center)
@@ -489,6 +573,63 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         }
 
+        private void GetTimeFormat()
+        {
+            if (IsFillFreeTextAnnot == false)
+                return;
+
+            if(string.IsNullOrEmpty(Annot.TextContent))
+            {
+                if (CurrrentDateFormat != null)
+                {
+                    if (IsCheckedTime)
+                        UpdateDateFormatLists();
+
+                    PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.NoteText, CurrrentDateFormat.Content);
+                }
+                return;
+
+            }
+            DateTime dtDate;
+            bool isTime = false;
+            foreach (var item in DateFormatItems)
+            {
+                var strFormat = "";
+                var strArr = Annot.TextContent.Split(' ');
+                if (strArr != null && strArr.Count() == 2)
+                {
+                    strFormat = item.ValueStr + " HH:mm:ss";
+                }
+                else
+                {
+                    strFormat = item.ValueStr;
+                }
+
+                if (DateTime.TryParseExact(Annot.TextContent, strFormat, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.AdjustToUniversal, out dtDate))
+                {
+                    if (strArr != null && strArr.Count() == 2)
+                    {
+                        isTime = true;
+                    }
+
+                    foreach (var item2 in DateFormatItems)
+                    {
+                        string stadate = System.DateTime.Now.ToString(strFormat);
+                        item.SetContent(stadate);
+
+                    }
+
+                    CurrrentDateFormat = new ComboDataItem(item.ValueStr, item.Content);
+
+                    break;
+
+                }
+            }
+
+
+            IsCheckedTime = isTime;
+        }
+
 
     }
 }

+ 1 - 1
PDF Office/ViewModels/PropertyPanel/FontBoardVM.cs

@@ -375,7 +375,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
         #region 字体样式
 
         //下拉框列表
-        private ComboDataItem _currentFontFamily = new ComboDataItem("Helvetica", "Helvetica");
+        private ComboDataItem _currentFontFamily = new ComboDataItem("Arial", "Helvetica");
         public ComboDataItem CurrentFontFamily
         {
             get { return _currentFontFamily; }

+ 2 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs

@@ -56,6 +56,8 @@ namespace PDF_Office.ViewModels.Tools
                 }
             }
 
+            propertyPanel.SetIsTextFill(false);
+
             propertyPanel.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annots[0], annots[0].GetAnnotAttrib());
             if (annots[0] is LinkAnnotArgs && annotAttribEvent != null)
             {

+ 7 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs

@@ -24,9 +24,16 @@ namespace PDF_Office.ViewModels.Tools
     {
         public AnnotAttribEvent AnnotEvent { get; set; }
         public List<AnnotAttribEvent> AnnotEvents = new List<AnnotAttribEvent>();
+
         public AnnotHandlerEventArgs annot;
         public List<AnnotHandlerEventArgs> annotlists;
 
+        public bool IsTextFill { get; private set; }
+        public void SetIsTextFill(bool isTextFill)
+        {
+            IsTextFill = isTextFill;
+        }
+
         public event EventHandler<Dictionary<AnnotArgsType, object>> DataChanged;
 
         public event EventHandler<Dictionary<AnnotArgsType, object>> AnnotTypeChanged;

+ 30 - 9
PDF Office/ViewModels/Tools/ConverterBarContentViewModel.cs

@@ -74,30 +74,51 @@ namespace PDF_Office.ViewModels.Tools
                     case "ConverterWordBtn":
                         dialogs.ShowDialog(DialogNames.ConverterWordDialog, value, e =>
                         {
-                            
-                            OnOpened((DialogResult)e);
+                            ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
+                            converterDialogsModel. OnOpened((DialogResult)e);
                         });
                         break;
                     case "ConverterExcelBtn":
-                        dialogs.ShowDialog(DialogNames.ConverterExcelDialog, value, e => { OnOpened((DialogResult)e); });
+                        dialogs.ShowDialog(DialogNames.ConverterExcelDialog, value, e => {
+                            ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
+                            converterDialogsModel.OnOpened((DialogResult)e);
+                        });
                         break;
                     case "ConverterPPTBtn":
-                        dialogs.ShowDialog(DialogNames.ConverterPPTDialog, value, e => { OnOpened((DialogResult)e); });
+                        dialogs.ShowDialog(DialogNames.ConverterPPTDialog, value, e => {
+                            ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
+                            converterDialogsModel.OnOpened((DialogResult)e);
+                        });
                         break;
                     case "ConverterRTFBtn":
-                        dialogs.ShowDialog(DialogNames.ConverterRTFDialog, value, e => { OnOpened((DialogResult)e); });
+                        dialogs.ShowDialog(DialogNames.ConverterRTFDialog, value, e => {
+                            ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
+                            converterDialogsModel.OnOpened((DialogResult)e);
+                        });
                         break;
                     case "ConverterCSVBtn":
-                        dialogs.ShowDialog(DialogNames.ConverterCSVDialog, value, e => { OnOpened((DialogResult)e); });
+                        dialogs.ShowDialog(DialogNames.ConverterCSVDialog, value, e => {
+                            ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
+                            converterDialogsModel.OnOpened((DialogResult)e);
+                        });
                         break;
                     case "ConverterHTMLBtn":
-                        dialogs.ShowDialog(DialogNames.ConverterHTMLDialog, value, e => { OnOpened((DialogResult)e); });
+                        dialogs.ShowDialog(DialogNames.ConverterHTMLDialog, value, e => {
+                            ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
+                            converterDialogsModel.OnOpened((DialogResult)e);
+                        });
                         break;
                     case "ConverterTextBtn":
-                        dialogs.ShowDialog(DialogNames.ConverterTextDialog, value, e => { OnOpened((DialogResult)e); });
+                        dialogs.ShowDialog(DialogNames.ConverterTextDialog, value, e => {
+                            ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
+                            converterDialogsModel.OnOpened((DialogResult)e);
+                        });
                         break;
                     case "ConverterImgBtn":
-                        dialogs.ShowDialog(DialogNames.ConverterImgDialog, value, e => { OnOpened((DialogResult)e); });
+                        dialogs.ShowDialog(DialogNames.ConverterImgDialog, value, e => {
+                            ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
+                            converterDialogsModel.OnOpened((DialogResult)e);
+                        });
                         break;
                     default:
                         break;

+ 4 - 2
PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs

@@ -20,6 +20,7 @@ using System.Windows;
 using System.Threading.Tasks;
 using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
 using Task = System.Threading.Tasks.Task;
+using PDF_Office.Model.Dialog.ToolsDialogs;
 
 namespace PDF_Office.ViewModels.Tools
 {
@@ -108,8 +109,9 @@ namespace PDF_Office.ViewModels.Tools
             value.Add(ParameterNames.PDFViewer, PDFViewer);
             dialogs.ShowDialog(DialogNames.CompressDialog, value, e =>
             {
-
-                OnOpened((Prism.Services.Dialogs.DialogResult)e);
+                CompressDialogModel compressDialogModel = new CompressDialogModel();
+                compressDialogModel.OnOpened((Prism.Services.Dialogs.DialogResult)e);
+               // OnOpened((Prism.Services.Dialogs.DialogResult)e);
             });
         }
 

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 129 - 128
PDF Office/Views/BOTA/AnnotationContent.xaml


+ 30 - 28
PDF Office/Views/BOTA/BookmarkContent.xaml

@@ -103,36 +103,38 @@
     </UserControl.Resources>
     <Grid Background="{StaticResource color.sys.layout.mg}">
         <Grid.RowDefinitions>
-            <RowDefinition Height="40" />
+            <RowDefinition Height="48" />
             <RowDefinition />
         </Grid.RowDefinitions>
-        <Grid MinWidth="190">
-            <TextBlock
-                x:Name="TxtTitle"
-                Margin="16,0,0,0"
-                HorizontalAlignment="Left"
-                VerticalAlignment="Center"
-                FontSize="14"
-                FontWeight="SemiBold"
-                Foreground="{StaticResource color.sys.text.neutral.lv1}"
-                Text="Bookmarks" />
-            <Button
-                Name="BtnAddBookmark"
-                Width="40"
-                Height="40"
-                Margin="0,0,0,0"
-                HorizontalAlignment="Right"
-                Click="BtnAddBookmark_Click"
-                Style="{StaticResource PageEditToolBtn}">
-                <Path Data="M13.5 8C13.5 11.0376 11.0376 13.5 8 13.5C4.96243 13.5 2.5 11.0376 2.5 8C2.5 4.96243 4.96243 2.5 8 2.5C11.0376 2.5 13.5 4.96243 13.5 8ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM7.25005 4.80003V7.25003H4.80005V8.75003H7.25005V11.2H8.75005V8.75003H11.2V7.25003H8.75005V4.80003H7.25005Z" Fill="#616469">
-                    <Path.RenderTransform>
-                        <TransformGroup>
-                            <TranslateTransform Y="-3" />
-                        </TransformGroup>
-                    </Path.RenderTransform>
-                </Path>
-            </Button>
-        </Grid>
+        <Border BorderBrush="{StaticResource color.field.border.norm}" BorderThickness="0,0,0,1">
+            <Grid MinWidth="190">
+                <TextBlock
+                    x:Name="TxtTitle"
+                    Margin="16,0,0,0"
+                    HorizontalAlignment="Left"
+                    VerticalAlignment="Center"
+                    FontSize="14"
+                    FontWeight="SemiBold"
+                    Foreground="{StaticResource color.sys.text.neutral.lv1}"
+                    Text="Bookmarks" />
+                <Button
+                    Name="BtnAddBookmark"
+                    Width="40"
+                    Height="40"
+                    Margin="0,0,0,0"
+                    HorizontalAlignment="Right"
+                    Click="BtnAddBookmark_Click"
+                    Style="{StaticResource PageEditToolBtn}">
+                    <Path Data="M13.5 8C13.5 11.0376 11.0376 13.5 8 13.5C4.96243 13.5 2.5 11.0376 2.5 8C2.5 4.96243 4.96243 2.5 8 2.5C11.0376 2.5 13.5 4.96243 13.5 8ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM7.25005 4.80003V7.25003H4.80005V8.75003H7.25005V11.2H8.75005V8.75003H11.2V7.25003H8.75005V4.80003H7.25005Z" Fill="#616469">
+                        <Path.RenderTransform>
+                            <TransformGroup>
+                                <TranslateTransform Y="-3" />
+                            </TransformGroup>
+                        </Path.RenderTransform>
+                    </Path>
+                </Button>
+            </Grid>
+        </Border>
         <Grid Grid.Row="1">
             <ListView
                 Name="BookMarkListView"

+ 27 - 1
PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml

@@ -20,6 +20,7 @@
                 <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
             </ResourceDictionary.MergedDictionaries>
             <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
+            <Convert:BoolToVisible x:Key="BoolToVisible"/>
             <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert"/>
             <Style x:Key="line1Style" TargetType="{x:Type Line}">
                 <Setter Property="Visibility">
@@ -417,7 +418,32 @@
             </Grid>
 
 
-<!--MVP不上-->
+            <StackPanel Visibility="{Binding IsFillFreeTextAnnot,Converter={StaticResource BoolToVisible}}">
+                <TextBlock Margin="0,8,0,8" Text="Date Type" Foreground="{StaticResource color.sys.text.neutral.lv2}" />
+                <CompositeControl:CustomComboControl
+                                x:Name="DateTimeBox"
+                                Width="228"
+                                Height="32"
+                                HorizontalAlignment="Left"
+                                IsValueContent="True"
+                                ItemSource="{Binding DateFormatItems,Mode=OneWay}"
+                                SelectedItems="{Binding CurrrentDateFormat, Mode=TwoWay}">
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="ValueChanged">
+                            <i:InvokeCommandAction Command="{Binding DateFormatChangedCommand}"/>
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </CompositeControl:CustomComboControl>
+
+                <CheckBox x:Name="isShowTime" Margin="0,16,0,0" Content="Show Time" IsChecked="{Binding IsCheckedTime,Mode=TwoWay}"
+                      Command="{Binding ShowTimeCheckedChnagedCommand}"
+                      >
+
+                </CheckBox>
+
+            </StackPanel>
+        
+            <!--MVP不上-->
 
             <TextBlock x:Name="thicknessText" Visibility="Collapsed" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
 

+ 98 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml

@@ -0,0 +1,98 @@
+<annotview:StickyPopupExt x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.StickyNotePopup"
+             xmlns:annotview="clr-namespace:ComPDFKitViewer;assembly=ComPDFKit.Viewer"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
+             mc:Ignorable="d" Background="Transparent"
+             d:DesignHeight="450" d:DesignWidth="800">
+    <annotview:StickyPopupExt.Resources>
+        <DataTemplate x:Key="listboxData">
+            <Ellipse
+                    Width="20"
+                    Height="20"
+                    Fill="{Binding Color}" />
+        </DataTemplate>
+        <Style x:Key="listboxItemStyle" TargetType="{x:Type ListBoxItem}">
+            <Setter Property="HorizontalContentAlignment" Value="Center" />
+            <Setter Property="Height" Value="32" />
+            <Setter Property="Margin" Value="2,0,2,0" />
+        </Style>
+    </annotview:StickyPopupExt.Resources>
+    <Border  x:Name="border" Background="{StaticResource color.sys.layout.anti}" CornerRadius="8" BorderThickness="2" BorderBrush="#ffe49a" MinWidth="240" MinHeight="200" Width="240" Height="200" >
+        <Border.Effect>
+            <DropShadowEffect BlurRadius="8" Direction="0" Opacity="0.16" ShadowDepth="0" Color="#000000" />
+        </Border.Effect>
+        <Grid Name="GridUi" Margin="8">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="32"/>
+                <RowDefinition Height="1"/>
+                <RowDefinition />
+                <RowDefinition Height="32"/>
+            </Grid.RowDefinitions>
+            <Grid >
+                <TextBlock x:Name="AuthorText" Text="test" FontSize="12" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
+                <TextBlock x:Name="DateTextui" Text="date time" FontSize="12" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center" HorizontalAlignment="Right"/>
+            </Grid>
+            <Border MouseUp="CloseText_MouseUp"/>
+            <Rectangle Grid.Row="1" Fill="{StaticResource color.sys.layout.divider}" HorizontalAlignment="Stretch"  VerticalAlignment="Stretch"/>
+            <Grid Grid.Row="2" Margin="0,2,0,2">
+                <TextBox Name="ContentText" Grid.Row="2" Margin="4,0,4,0" Background="#CCFFFFFF" BorderThickness="0" 
+                     AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox>
+            </Grid>
+
+            <Grid Grid.Row="3">
+                <ListBox
+            x:Name="ListColor"
+            Background="Transparent"
+            BorderThickness="0"
+            ItemContainerStyle="{StaticResource listboxItemStyle}"
+            ItemTemplate="{StaticResource listboxData}"
+            SelectionChanged="ListColor_SelectionChanged"
+            >
+                    <ListBox.ItemsPanel>
+                        <ItemsPanelTemplate>
+                            <WrapPanel Orientation="Horizontal" />
+                        </ItemsPanelTemplate>
+                    </ListBox.ItemsPanel>
+                </ListBox>
+            </Grid>
+           
+            <!--<Grid.RowDefinitions>
+                <RowDefinition Height="auto"></RowDefinition>
+                <RowDefinition Height="auto"></RowDefinition>
+                <RowDefinition Height="*"></RowDefinition>
+                <RowDefinition Height="auto"></RowDefinition>
+            </Grid.RowDefinitions>
+            <Grid>
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="auto"></ColumnDefinition>
+                    <ColumnDefinition Width="auto"></ColumnDefinition>
+                    <ColumnDefinition Width="*"></ColumnDefinition>
+                    <ColumnDefinition Width="auto"></ColumnDefinition>
+                    <ColumnDefinition Width="auto"></ColumnDefinition>
+                </Grid.ColumnDefinitions>
+                <Path Fill="#000000" Margin="2,2,0,0" Width="20" Height="20">
+                    <Path.Data>M19,2 L19,15 L9.137,15 L4,18.383095 L4,15 L1,15 L1,2 L19,2 Z M18,3 L2,3 L2,14 L5,14 L5,16.616 L8.86150802,14 L18,14 L18,3 Z M15,9 L15,10 L5,10 L5,9 L15,9 Z M11,6 L11,7 L5,7 L5,6 L11,6 Z</Path.Data>
+                </Path>
+                <TextBlock Grid.Column="1" FontFamily="SegoeUI" FontSize="12" VerticalAlignment="Center" LineHeight="16" Margin="2,2,0,0">Note</TextBlock>
+                <TextBlock Name="DateText" Grid.Column="3" Foreground="#000000" VerticalAlignment="Center"  Margin="0,-2,0,0" FontFamily="SegoeUI" FontSize="12" LineHeight="16"></TextBlock>
+                <Border Grid.Column="4" MouseUp="CloseText_MouseUp" Background="#01000000" Margin="0,-8,-3,0">
+                    <Path Fill="#000000" Width="16" Height="16" >
+                        <Path.Data>
+                            M9.48528137,2.98528137 L9.48428137,8.48428137 L14.9852814,8.48528137 L14.9852814,9.48528137 L9.48428137,9.48428137 L9.48528137,14.9852814 L8.48528137,14.9852814 L8.48428137,9.48428137 L2.98528137,9.48528137 L2.98528137,8.48528137 L8.48428137,8.48428137 L8.48528137,2.98528137 L9.48528137,2.98528137 Z
+                        </Path.Data>
+                        <Path.LayoutTransform>
+                            <RotateTransform Angle="45"></RotateTransform>
+                        </Path.LayoutTransform>
+                    </Path>
+                </Border>
+            </Grid>
+            <TextBlock Name="AuthorText" Grid.Row="1" FontFamily="SegoeUI" FontSize="12" LineHeight="16" Margin="2,2,0,0"></TextBlock>
+            <TextBox Name="ContentText" Grid.Row="2" Margin="4,0,4,0" Background="#CCFFFFFF" BorderThickness="0" 
+                     AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox>-->
+            <!--<ResizeGrip Name="GripControl" Grid.Row="3" HorizontalAlignment="Right" Margin="0,2,0,0" Cursor="SizeNWSE" MouseMove="ResizeGrip_MouseMove"></ResizeGrip>-->
+        </Grid>
+    </Border>
+</annotview:StickyPopupExt>

+ 158 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml.cs

@@ -0,0 +1,158 @@
+using ComPDFKitViewer;
+using PDF_Office.CustomControl.CompositeControl;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.Views.PropertyPanel.AnnotPanel
+{
+    /// <summary>
+    /// StickyNotePopup.xaml 的交互逻辑
+    /// </summary>
+    public partial class StickyNotePopup : StickyPopupExt
+    {
+        private ObservableCollection<ColorItem> colors = new ObservableCollection<ColorItem>();
+        private Point PressPoint;
+        public Point OffsetParent;
+        private byte saveOpacity = 1;
+        public bool CanMove { get; set; } = true;
+        public StickyNotePopup()
+        {
+            InitializeComponent();
+            AddHandler(MouseUpEvent, new MouseButtonEventHandler(StickyPopupControl_MouseUp), true);
+            ContentText.AddHandler(MouseDownEvent, new MouseButtonEventHandler(StickyPopupControl_MouseDown), true);
+            Loaded += StickyPopupControl_Loaded;
+            Unloaded += StickyPopupControl_Unloaded;
+            ContentText.GotFocus += ContentText_GotFocus;
+            ContentText.LostFocus += ContentText_LostFocus;
+            colors.Add(new ColorItem(Color.FromArgb(0xFF, 0xFF, 0xFF, 0x10)));
+            colors.Add(new ColorItem(Color.FromArgb(0xFF, 0xFF, 0x10, 0x10)));
+            colors.Add(new ColorItem(Color.FromArgb(0xFF, 0x10, 0xFF, 0x10)));
+            colors.Add(new ColorItem(Color.FromArgb(0xFF, 0x10, 0x70, 0xFF)));
+            ListColor.ItemsSource = colors;
+        }
+
+
+        private void ContentText_LostFocus(object sender, RoutedEventArgs e)
+        {
+            e.Handled = true;
+            Color bkColor = (border.BorderBrush as SolidColorBrush).Color;
+            bkColor.A = saveOpacity;
+            border.BorderBrush = new SolidColorBrush(bkColor);
+            CloseText_MouseUp(this, null);
+            border.BorderBrush = this.Background;
+            this.Background = new SolidColorBrush(Colors.Transparent);
+            AuthorText.Text = this.Author;
+            DateTextui.Text = this.DateText;
+        }
+
+        private void ContentText_GotFocus(object sender, RoutedEventArgs e)
+        {
+            Color bkColor = (border.BorderBrush as SolidColorBrush).Color;
+            saveOpacity = bkColor.A;
+            bkColor.A = 255;
+            border.BorderBrush = new SolidColorBrush(bkColor);
+
+            border.BorderBrush = this.Background;
+            this.Background = new SolidColorBrush(Colors.Transparent);
+            AuthorText.Text = this.Author;
+            DateTextui.Text = this.DateText;
+        }
+
+        private void StickyPopupControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            ContentText.Focus();
+            ContentText.CaretIndex = ContentText.Text.Length;
+            ContentText.Text = this.StickyNote;
+           
+        }
+
+        private void StickyPopupControl_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            PressPoint = new Point(0, 0);
+        }
+
+        private void StickyPopupControl_MouseUp(object sender, MouseButtonEventArgs e)
+        {
+            CanMove = true;
+        }
+
+        public string StickyText
+        {
+            get
+            {
+                return ContentText.Text;
+            }
+            set
+            {
+                ContentText.Text = value;
+            }
+        }
+
+        public string StickyAuthor
+        {
+            get
+            {
+                return AuthorText.Text;
+            }
+            set
+            {
+                AuthorText.Text = value;
+            }
+        }
+
+        public string StickyDate
+        {
+            get
+            {
+                return DateTextui.Text;
+            }
+            set
+            {
+                DateTextui.Text = value;
+            }
+        }
+
+
+        private void CloseText_MouseUp(object sender, MouseButtonEventArgs e)
+        {
+            if (e != null)
+            {
+                e.Handled = true;
+            }
+            PlaceChange = null;
+            RemoveFromLayer();
+            if (Closed != null)
+            {
+                Closed.Invoke(sender, EventArgs.Empty);
+            }
+        }
+
+        private void ListColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            var color = ListColor.SelectedItem as ColorItem;
+            if(color != null)
+            {
+                this.SetStickyColor((color.Color as SolidColorBrush).Color);
+            }
+        }
+
+        private void StickyPopupControl_Unloaded(object sender, RoutedEventArgs e)
+        {
+            if (StickyNote != ContentText.Text)
+                this.SetStickyNote(ContentText.Text);
+        }
+    }
+}