Просмотр исходного кода

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

OYXH\oyxh 2 лет назад
Родитель
Сommit
0309a9e125
28 измененных файлов с 1151 добавлено и 43 удалено
  1. 114 0
      PDF Office/Helper/CropPageUndoManager.cs
  2. 73 0
      PDF Office/MultilingualResources/PDF Office.en.xlf
  3. 73 0
      PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf
  4. 73 0
      PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf
  5. 25 2
      PDF Office/PDF Office.csproj
  6. 63 0
      PDF Office/Strings/HomePage/HomePage.Designer.cs
  7. 15 0
      PDF Office/Strings/HomePage/HomePage.en.resx
  8. 101 0
      PDF Office/Strings/HomePage/HomePage.resx
  9. 15 0
      PDF Office/Strings/HomePage/HomePage.zh-Hans.resx
  10. 15 0
      PDF Office/Strings/HomePage/HomePage.zh-Hant.resx
  11. 63 0
      PDF Office/Strings/MainPage/MainPage.Designer.cs
  12. 15 0
      PDF Office/Strings/MainPage/MainPage.en.resx
  13. 101 0
      PDF Office/Strings/MainPage/MainPage.resx
  14. 15 0
      PDF Office/Strings/MainPage/MainPage.zh-Hans.resx
  15. 15 0
      PDF Office/Strings/MainPage/MainPage.zh-Hant.resx
  16. 63 0
      PDF Office/Strings/Service/Service.Designer.cs
  17. 15 0
      PDF Office/Strings/Service/Service.en.resx
  18. 101 0
      PDF Office/Strings/Service/Service.resx
  19. 15 0
      PDF Office/Strings/Service/Service.zh-Hans.resx
  20. 15 0
      PDF Office/Strings/Service/Service.zh-Hant.resx
  21. 31 8
      PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs
  22. 61 8
      PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs
  23. 17 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml
  24. 2 0
      PDF Office/Views/MainWindow.xaml
  25. 18 0
      PDF Office/Views/MainWindow.xaml.cs
  26. 13 23
      PDF Office/Views/PageEdit/PageEditContent.xaml
  27. 13 1
      PDF Office/Views/Tools/ToolsBarContent.xaml
  28. 11 0
      PDF Office/Views/Tools/ToolsBarContent.xaml.cs

+ 114 - 0
PDF Office/Helper/CropPageUndoManager.cs

@@ -0,0 +1,114 @@
+using ComPDFKitViewer;
+using ComPDFKitViewer.PdfViewer;
+using Microsoft.Office.Core;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Helper
+{
+    public enum CropPageEnum
+    {
+        CropCurrentPageWM,
+        CropAllPagesWM
+    }
+
+    public class CropPageUndoManager : IHistory
+    {
+        public List<int> cropPageList = new List<int>();
+
+        private List<CropPageEnum> cropPageEnumList = new List<CropPageEnum>();
+
+        private int cropPageEnumIndex = -1;
+
+        private int cropPageListInterval = 0;
+
+        private CPDFViewer pdfviewer = null;
+
+        public CropPageUndoManager()
+        {
+
+        }
+
+        public void setPDFViewer(CPDFViewer pDFViewer)
+        {
+            pdfviewer = pDFViewer;
+        }
+
+        public void ADDCropCurrentPageWM()
+        {
+            cropPageEnumIndex++;
+            cropPageEnumList.Insert(cropPageEnumIndex, CropPageEnum.CropCurrentPageWM);
+            if (cropPageEnumIndex != cropPageEnumList.Count - 1)
+            {
+                cropPageEnumList.RemoveRange(cropPageEnumIndex + 1, cropPageEnumList.Count - cropPageEnumIndex-1);
+                cropPageList.RemoveRange(cropPageList.Count - cropPageListInterval-1, cropPageListInterval);
+                cropPageListInterval = 0;
+            }
+
+
+
+        }
+        public void ADDCropAllPagesWM()
+        {
+            cropPageEnumIndex++;
+            cropPageEnumList.Insert(cropPageEnumIndex, CropPageEnum.CropAllPagesWM);
+            if (cropPageEnumIndex != cropPageEnumList.Count - 1)
+            {
+                cropPageEnumList.RemoveRange(cropPageEnumIndex+1, cropPageEnumList.Count - cropPageEnumIndex-1);
+                cropPageList.RemoveRange(cropPageList.Count - cropPageListInterval-37, cropPageListInterval);
+                cropPageListInterval = 0;
+            }
+            
+        }
+
+        public void setPageList(List<int> CropPageList)
+        {
+            cropPageList = CropPageList;
+        }
+
+        public bool Redo()
+        {
+            cropPageEnumIndex++;
+            if (cropPageEnumIndex < cropPageEnumList.Count )
+            {
+                
+                if (cropPageEnumList[cropPageEnumIndex] == CropPageEnum.CropAllPagesWM) { cropPageListInterval -= pdfviewer.Document.PageCount; } else { cropPageListInterval--; }
+                
+                if (cropPageList.Count - cropPageListInterval == 0) { pdfviewer.SetCropMode(false); } else { pdfviewer.SetCropMode(true, cropPageList.GetRange(0, cropPageList.Count - cropPageListInterval)); }
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        public bool Undo()
+        {
+            if (cropPageEnumIndex > -1)
+            {
+                if (cropPageEnumList[cropPageEnumIndex] == CropPageEnum.CropAllPagesWM)
+                {
+                    cropPageListInterval += pdfviewer.Document.PageCount;
+                }
+                else
+                {
+                    cropPageListInterval++;
+                }
+                if (cropPageList.Count - cropPageListInterval == 0) { pdfviewer.SetCropMode(false); } else { pdfviewer.SetCropMode(true, cropPageList.GetRange(0, cropPageList.Count - cropPageListInterval)); }
+
+                cropPageEnumIndex--;
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+
+
+        }
+    }
+}

+ 73 - 0
PDF Office/MultilingualResources/PDF Office.en.xlf

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
+  <file datatype="xml" source-language="en-US" target-language="en" original="PDF OFFICE/PROPERTIES/RESOURCES.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/PROPERTIES/RESOURCES.RESX" datatype="resx">
+        <trans-unit id="excelex" translate="yes" xml:space="preserve">
+          <source>*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</source>
+          <target state="new">*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的excel文档文件格式</note>
+        </trans-unit>
+        <trans-unit id="htmlex" translate="yes" xml:space="preserve">
+          <source>*.html;</source>
+          <target state="new">*.html;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的html格式</note>
+        </trans-unit>
+        <trans-unit id="imageex" translate="yes" xml:space="preserve">
+          <source>*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</source>
+          <target state="new">*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</target>
+        </trans-unit>
+        <trans-unit id="OpenDialogFilter" translate="yes" xml:space="preserve">
+          <source>PDF Files (*.pdf)|*.pdf</source>
+          <target state="new">PDF Files (*.pdf)|*.pdf</target>
+        </trans-unit>
+        <trans-unit id="pptex" translate="yes" xml:space="preserve">
+          <source>*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</source>
+          <target state="new">*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的ppt文档文件格式</note>
+        </trans-unit>
+        <trans-unit id="SDKLisence" translate="yes" extype="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
+          <source>..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</source>
+          <target state="needs-review-translation">..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</target>
+        </trans-unit>
+        <trans-unit id="txtex" translate="yes" xml:space="preserve">
+          <source>*.txt;</source>
+          <target state="new">*.txt;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的txt格式</note>
+        </trans-unit>
+        <trans-unit id="wordex" translate="yes" xml:space="preserve">
+          <source>*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</source>
+          <target state="new">*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的word文档文件格式</note>
+        </trans-unit>
+      </group>
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="en" original="PDF OFFICE/STRINGS/HOMEPAGE/HOMEPAGE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/HOMEPAGE/HOMEPAGE.RESX" datatype="resx" />
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="en" original="PDF OFFICE/STRINGS/MAINPAGE/MAINPAGE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/MAINPAGE/MAINPAGE.RESX" datatype="resx" />
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="en" original="PDF OFFICE/STRINGS/SERVICE/SERVICE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/SERVICE/SERVICE.RESX" datatype="resx" />
+    </body>
+  </file>
+</xliff>

+ 73 - 0
PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
+  <file datatype="xml" source-language="en-US" target-language="zh-Hans" original="PDF OFFICE/PROPERTIES/RESOURCES.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/PROPERTIES/RESOURCES.RESX" datatype="resx">
+        <trans-unit id="excelex" translate="yes" xml:space="preserve">
+          <source>*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</source>
+          <target state="new">*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的excel文档文件格式</note>
+        </trans-unit>
+        <trans-unit id="htmlex" translate="yes" xml:space="preserve">
+          <source>*.html;</source>
+          <target state="new">*.html;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的html格式</note>
+        </trans-unit>
+        <trans-unit id="imageex" translate="yes" xml:space="preserve">
+          <source>*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</source>
+          <target state="new">*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</target>
+        </trans-unit>
+        <trans-unit id="OpenDialogFilter" translate="yes" xml:space="preserve">
+          <source>PDF Files (*.pdf)|*.pdf</source>
+          <target state="new">PDF Files (*.pdf)|*.pdf</target>
+        </trans-unit>
+        <trans-unit id="pptex" translate="yes" xml:space="preserve">
+          <source>*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</source>
+          <target state="new">*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的ppt文档文件格式</note>
+        </trans-unit>
+        <trans-unit id="SDKLisence" translate="yes" extype="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
+          <source>..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</source>
+          <target state="needs-review-translation">..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</target>
+        </trans-unit>
+        <trans-unit id="txtex" translate="yes" xml:space="preserve">
+          <source>*.txt;</source>
+          <target state="new">*.txt;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的txt格式</note>
+        </trans-unit>
+        <trans-unit id="wordex" translate="yes" xml:space="preserve">
+          <source>*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</source>
+          <target state="new">*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的word文档文件格式</note>
+        </trans-unit>
+      </group>
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="zh-Hans" original="PDF OFFICE/STRINGS/HOMEPAGE/HOMEPAGE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/HOMEPAGE/HOMEPAGE.RESX" datatype="resx" />
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="zh-Hans" original="PDF OFFICE/STRINGS/MAINPAGE/MAINPAGE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/MAINPAGE/MAINPAGE.RESX" datatype="resx" />
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="zh-Hans" original="PDF OFFICE/STRINGS/SERVICE/SERVICE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/SERVICE/SERVICE.RESX" datatype="resx" />
+    </body>
+  </file>
+</xliff>

+ 73 - 0
PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf

@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:oasis:names:tc:xliff:document:1.2 xliff-core-1.2-transitional.xsd">
+  <file datatype="xml" source-language="en-US" target-language="zh-Hant" original="PDF OFFICE/PROPERTIES/RESOURCES.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/PROPERTIES/RESOURCES.RESX" datatype="resx">
+        <trans-unit id="excelex" translate="yes" xml:space="preserve">
+          <source>*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</source>
+          <target state="new">*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的excel文档文件格式</note>
+        </trans-unit>
+        <trans-unit id="htmlex" translate="yes" xml:space="preserve">
+          <source>*.html;</source>
+          <target state="new">*.html;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的html格式</note>
+        </trans-unit>
+        <trans-unit id="imageex" translate="yes" xml:space="preserve">
+          <source>*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</source>
+          <target state="new">*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</target>
+        </trans-unit>
+        <trans-unit id="OpenDialogFilter" translate="yes" xml:space="preserve">
+          <source>PDF Files (*.pdf)|*.pdf</source>
+          <target state="new">PDF Files (*.pdf)|*.pdf</target>
+        </trans-unit>
+        <trans-unit id="pptex" translate="yes" xml:space="preserve">
+          <source>*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</source>
+          <target state="new">*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的ppt文档文件格式</note>
+        </trans-unit>
+        <trans-unit id="SDKLisence" translate="yes" extype="System.Resources.ResXFileRef, System.Windows.Forms" xml:space="preserve">
+          <source>..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</source>
+          <target state="needs-review-translation">..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</target>
+        </trans-unit>
+        <trans-unit id="txtex" translate="yes" xml:space="preserve">
+          <source>*.txt;</source>
+          <target state="new">*.txt;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的txt格式</note>
+        </trans-unit>
+        <trans-unit id="wordex" translate="yes" xml:space="preserve">
+          <source>*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</source>
+          <target state="new">*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</target>
+          <note from="MultilingualBuild" annotates="source" priority="2">支持的word文档文件格式</note>
+        </trans-unit>
+      </group>
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="zh-Hant" original="PDF OFFICE/STRINGS/HOMEPAGE/HOMEPAGE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/HOMEPAGE/HOMEPAGE.RESX" datatype="resx" />
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="zh-Hant" original="PDF OFFICE/STRINGS/MAINPAGE/MAINPAGE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/MAINPAGE/MAINPAGE.RESX" datatype="resx" />
+    </body>
+  </file>
+  <file datatype="xml" source-language="en-US" target-language="zh-Hant" original="PDF OFFICE/STRINGS/SERVICE/SERVICE.RESX" tool-id="MultilingualAppToolkit" product-name="n/a" product-version="n/a" build-num="n/a">
+    <header>
+      <tool tool-id="MultilingualAppToolkit" tool-name="Multilingual App Toolkit" tool-version="4.1.12.0" tool-company="Microsoft" />
+    </header>
+    <body>
+      <group id="PDF OFFICE/STRINGS/SERVICE/SERVICE.RESX" datatype="resx" />
+    </body>
+  </file>
+</xliff>

+ 25 - 2
PDF Office/PDF Office.csproj

@@ -15,7 +15,8 @@
     <WarningLevel>4</WarningLevel>
     <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
     <Deterministic>true</Deterministic>
-    <NuGetPackageImportStamp></NuGetPackageImportStamp>
+    <NuGetPackageImportStamp>
+    </NuGetPackageImportStamp>
     <IsWebBootstrapper>false</IsWebBootstrapper>
     <PublishUrl>publish\</PublishUrl>
     <Install>true</Install>
@@ -43,7 +44,8 @@
     <WarningLevel>4</WarningLevel>
     <Prefer32Bit>false</Prefer32Bit>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
-    <DocumentationFile></DocumentationFile>
+    <DocumentationFile>
+    </DocumentationFile>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -326,6 +328,7 @@
     <Compile Include="EventAggregators\SplitEvent.cs" />
     <Compile Include="Helper\CacheFilePath.cs" />
     <Compile Include="Helper\ConverterHelper.cs" />
+    <Compile Include="Helper\CropPageUndoManager.cs" />
     <Compile Include="Helper\Win32Helper.cs" />
     <Compile Include="Helper\DpiHelpers.cs" />
     <Compile Include="Helper\EditToolsHelper.cs" />
@@ -424,6 +427,9 @@
       <DesignTime>True</DesignTime>
       <AutoGen>True</AutoGen>
     </Compile>
+    <Compile Include="Strings\HomePage\HomePage.Designer.cs" />
+    <Compile Include="Strings\MainPage\MainPage.Designer.cs" />
+    <Compile Include="Strings\Service\Service.Designer.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\CreateFromHtmlDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\PropertiesDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\Redaction\MarkSettingDialogViewModel.cs" />
@@ -2475,6 +2481,18 @@
       <Generator>ResXFileCodeGenerator</Generator>
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
+    <EmbeddedResource Include="Strings\HomePage\HomePage.en.resx" />
+    <EmbeddedResource Include="Strings\HomePage\HomePage.resx" />
+    <EmbeddedResource Include="Strings\HomePage\HomePage.zh-Hans.resx" />
+    <EmbeddedResource Include="Strings\HomePage\HomePage.zh-Hant.resx" />
+    <EmbeddedResource Include="Strings\MainPage\MainPage.en.resx" />
+    <EmbeddedResource Include="Strings\MainPage\MainPage.resx" />
+    <EmbeddedResource Include="Strings\MainPage\MainPage.zh-Hans.resx" />
+    <EmbeddedResource Include="Strings\MainPage\MainPage.zh-Hant.resx" />
+    <EmbeddedResource Include="Strings\Service\Service.en.resx" />
+    <EmbeddedResource Include="Strings\Service\Service.resx" />
+    <EmbeddedResource Include="Strings\Service\Service.zh-Hans.resx" />
+    <EmbeddedResource Include="Strings\Service\Service.zh-Hant.resx" />
   </ItemGroup>
   <ItemGroup>
     <BootstrapperPackage Include=".NETFramework,Version=v4.6.2">
@@ -2488,6 +2506,11 @@
       <Install>false</Install>
     </BootstrapperPackage>
   </ItemGroup>
+  <ItemGroup>
+    <XliffResource Include="MultilingualResources\PDF Office.en.xlf" />
+    <XliffResource Include="MultilingualResources\PDF Office.zh-Hans.xlf" />
+    <XliffResource Include="MultilingualResources\PDF Office.zh-Hant.xlf" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
     <PropertyGroup>

+ 63 - 0
PDF Office/Strings/HomePage/HomePage.Designer.cs

@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace PDF_Office.Strings.HomePage {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class HomePage {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal HomePage() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PDF_Office.String.HomePage.HomePage", typeof(HomePage).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 15 - 0
PDF Office/Strings/HomePage/HomePage.en.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 101 - 0
PDF Office/Strings/HomePage/HomePage.resx

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+	<!-- 
+		Microsoft ResX Schema
+
+		Version 1.3
+
+		The primary goals of this format is to allow a simple XML format 
+		that is mostly human readable. The generation and parsing of the 
+		various data types are done through the TypeConverter classes 
+		associated with the data types.
+
+		Example:
+
+		... ado.net/XML headers & schema ...
+		<resheader name="resmimetype">text/microsoft-resx</resheader>
+		<resheader name="version">1.3</resheader>
+		<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+		<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+		<data name="Name1">this is my long string</data>
+		<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+		<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+			[base64 mime encoded serialized .NET Framework object]
+		</data>
+		<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+			[base64 mime encoded string representing a byte array form of the .NET Framework object]
+		</data>
+
+		There are any number of "resheader" rows that contain simple 
+		name/value pairs.
+
+		Each data row contains a name, and value. The row also contains a 
+		type or mimetype. Type corresponds to a .NET class that support 
+		text/value conversion through the TypeConverter architecture. 
+		Classes that don't support this are serialized and stored with the 
+		mimetype set.
+
+		The mimetype is used for serialized objects, and tells the 
+		ResXResourceReader how to depersist the object. This is currently not 
+		extensible. For a given mimetype the value must be set accordingly:
+
+		Note - application/x-microsoft.net.object.binary.base64 is the format 
+		that the ResXResourceWriter will generate, however the reader can 
+		read any of the formats listed below.
+
+		mimetype: application/x-microsoft.net.object.binary.base64
+		value   : The object must be serialized with 
+			: System.Serialization.Formatters.Binary.BinaryFormatter
+			: and then encoded with base64 encoding.
+
+		mimetype: application/x-microsoft.net.object.soap.base64
+		value   : The object must be serialized with 
+			: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+			: and then encoded with base64 encoding.
+
+		mimetype: application/x-microsoft.net.object.bytearray.base64
+		value   : The object must be serialized into a byte array 
+			: using a System.ComponentModel.TypeConverter
+			: and then encoded with base64 encoding.
+	-->
+	
+	<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+		<xsd:element name="root" msdata:IsDataSet="true">
+			<xsd:complexType>
+				<xsd:choice maxOccurs="unbounded">
+					<xsd:element name="data">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+								<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+							<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+							<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+						</xsd:complexType>
+					</xsd:element>
+					<xsd:element name="resheader">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" use="required" />
+						</xsd:complexType>
+					</xsd:element>
+				</xsd:choice>
+			</xsd:complexType>
+		</xsd:element>
+	</xsd:schema>
+	<resheader name="resmimetype">
+		<value>text/microsoft-resx</value>
+	</resheader>
+	<resheader name="version">
+		<value>1.3</value>
+	</resheader>
+	<resheader name="reader">
+		<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+	</resheader>
+	<resheader name="writer">
+		<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+	</resheader>
+</root>

+ 15 - 0
PDF Office/Strings/HomePage/HomePage.zh-Hans.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 15 - 0
PDF Office/Strings/HomePage/HomePage.zh-Hant.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 63 - 0
PDF Office/Strings/MainPage/MainPage.Designer.cs

@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace PDF_Office.Strings.MainPage {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class MainPage {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal MainPage() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PDF_Office.String.MainPage.MainPage", typeof(MainPage).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 15 - 0
PDF Office/Strings/MainPage/MainPage.en.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 101 - 0
PDF Office/Strings/MainPage/MainPage.resx

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+	<!-- 
+		Microsoft ResX Schema
+
+		Version 1.3
+
+		The primary goals of this format is to allow a simple XML format 
+		that is mostly human readable. The generation and parsing of the 
+		various data types are done through the TypeConverter classes 
+		associated with the data types.
+
+		Example:
+
+		... ado.net/XML headers & schema ...
+		<resheader name="resmimetype">text/microsoft-resx</resheader>
+		<resheader name="version">1.3</resheader>
+		<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+		<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+		<data name="Name1">this is my long string</data>
+		<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+		<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+			[base64 mime encoded serialized .NET Framework object]
+		</data>
+		<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+			[base64 mime encoded string representing a byte array form of the .NET Framework object]
+		</data>
+
+		There are any number of "resheader" rows that contain simple 
+		name/value pairs.
+
+		Each data row contains a name, and value. The row also contains a 
+		type or mimetype. Type corresponds to a .NET class that support 
+		text/value conversion through the TypeConverter architecture. 
+		Classes that don't support this are serialized and stored with the 
+		mimetype set.
+
+		The mimetype is used for serialized objects, and tells the 
+		ResXResourceReader how to depersist the object. This is currently not 
+		extensible. For a given mimetype the value must be set accordingly:
+
+		Note - application/x-microsoft.net.object.binary.base64 is the format 
+		that the ResXResourceWriter will generate, however the reader can 
+		read any of the formats listed below.
+
+		mimetype: application/x-microsoft.net.object.binary.base64
+		value   : The object must be serialized with 
+			: System.Serialization.Formatters.Binary.BinaryFormatter
+			: and then encoded with base64 encoding.
+
+		mimetype: application/x-microsoft.net.object.soap.base64
+		value   : The object must be serialized with 
+			: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+			: and then encoded with base64 encoding.
+
+		mimetype: application/x-microsoft.net.object.bytearray.base64
+		value   : The object must be serialized into a byte array 
+			: using a System.ComponentModel.TypeConverter
+			: and then encoded with base64 encoding.
+	-->
+	
+	<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+		<xsd:element name="root" msdata:IsDataSet="true">
+			<xsd:complexType>
+				<xsd:choice maxOccurs="unbounded">
+					<xsd:element name="data">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+								<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+							<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+							<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+						</xsd:complexType>
+					</xsd:element>
+					<xsd:element name="resheader">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" use="required" />
+						</xsd:complexType>
+					</xsd:element>
+				</xsd:choice>
+			</xsd:complexType>
+		</xsd:element>
+	</xsd:schema>
+	<resheader name="resmimetype">
+		<value>text/microsoft-resx</value>
+	</resheader>
+	<resheader name="version">
+		<value>1.3</value>
+	</resheader>
+	<resheader name="reader">
+		<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+	</resheader>
+	<resheader name="writer">
+		<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+	</resheader>
+</root>

+ 15 - 0
PDF Office/Strings/MainPage/MainPage.zh-Hans.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 15 - 0
PDF Office/Strings/MainPage/MainPage.zh-Hant.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 63 - 0
PDF Office/Strings/Service/Service.Designer.cs

@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     此代码由工具生成。
+//     运行时版本:4.0.30319.42000
+//
+//     对此文件的更改可能会导致不正确的行为,并且如果
+//     重新生成代码,这些更改将会丢失。
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace PDF_Office.Strings.Service {
+    using System;
+    
+    
+    /// <summary>
+    ///   一个强类型的资源类,用于查找本地化的字符串等。
+    /// </summary>
+    // 此类是由 StronglyTypedResourceBuilder
+    // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+    // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+    // (以 /str 作为命令选项),或重新生成 VS 项目。
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+    internal class Service {
+        
+        private static global::System.Resources.ResourceManager resourceMan;
+        
+        private static global::System.Globalization.CultureInfo resourceCulture;
+        
+        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+        internal Service() {
+        }
+        
+        /// <summary>
+        ///   返回此类使用的缓存的 ResourceManager 实例。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Resources.ResourceManager ResourceManager {
+            get {
+                if (object.ReferenceEquals(resourceMan, null)) {
+                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PDF_Office.String.Service.Service", typeof(Service).Assembly);
+                    resourceMan = temp;
+                }
+                return resourceMan;
+            }
+        }
+        
+        /// <summary>
+        ///   重写当前线程的 CurrentUICulture 属性,对
+        ///   使用此强类型资源类的所有资源查找执行重写。
+        /// </summary>
+        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+        internal static global::System.Globalization.CultureInfo Culture {
+            get {
+                return resourceCulture;
+            }
+            set {
+                resourceCulture = value;
+            }
+        }
+    }
+}

+ 15 - 0
PDF Office/Strings/Service/Service.en.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 101 - 0
PDF Office/Strings/Service/Service.resx

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+	<!-- 
+		Microsoft ResX Schema
+
+		Version 1.3
+
+		The primary goals of this format is to allow a simple XML format 
+		that is mostly human readable. The generation and parsing of the 
+		various data types are done through the TypeConverter classes 
+		associated with the data types.
+
+		Example:
+
+		... ado.net/XML headers & schema ...
+		<resheader name="resmimetype">text/microsoft-resx</resheader>
+		<resheader name="version">1.3</resheader>
+		<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+		<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+		<data name="Name1">this is my long string</data>
+		<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+		<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+			[base64 mime encoded serialized .NET Framework object]
+		</data>
+		<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+			[base64 mime encoded string representing a byte array form of the .NET Framework object]
+		</data>
+
+		There are any number of "resheader" rows that contain simple 
+		name/value pairs.
+
+		Each data row contains a name, and value. The row also contains a 
+		type or mimetype. Type corresponds to a .NET class that support 
+		text/value conversion through the TypeConverter architecture. 
+		Classes that don't support this are serialized and stored with the 
+		mimetype set.
+
+		The mimetype is used for serialized objects, and tells the 
+		ResXResourceReader how to depersist the object. This is currently not 
+		extensible. For a given mimetype the value must be set accordingly:
+
+		Note - application/x-microsoft.net.object.binary.base64 is the format 
+		that the ResXResourceWriter will generate, however the reader can 
+		read any of the formats listed below.
+
+		mimetype: application/x-microsoft.net.object.binary.base64
+		value   : The object must be serialized with 
+			: System.Serialization.Formatters.Binary.BinaryFormatter
+			: and then encoded with base64 encoding.
+
+		mimetype: application/x-microsoft.net.object.soap.base64
+		value   : The object must be serialized with 
+			: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+			: and then encoded with base64 encoding.
+
+		mimetype: application/x-microsoft.net.object.bytearray.base64
+		value   : The object must be serialized into a byte array 
+			: using a System.ComponentModel.TypeConverter
+			: and then encoded with base64 encoding.
+	-->
+	
+	<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+		<xsd:element name="root" msdata:IsDataSet="true">
+			<xsd:complexType>
+				<xsd:choice maxOccurs="unbounded">
+					<xsd:element name="data">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+								<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+							<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+							<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+						</xsd:complexType>
+					</xsd:element>
+					<xsd:element name="resheader">
+						<xsd:complexType>
+							<xsd:sequence>
+								<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+							</xsd:sequence>
+							<xsd:attribute name="name" type="xsd:string" use="required" />
+						</xsd:complexType>
+					</xsd:element>
+				</xsd:choice>
+			</xsd:complexType>
+		</xsd:element>
+	</xsd:schema>
+	<resheader name="resmimetype">
+		<value>text/microsoft-resx</value>
+	</resheader>
+	<resheader name="version">
+		<value>1.3</value>
+	</resheader>
+	<resheader name="reader">
+		<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+	</resheader>
+	<resheader name="writer">
+		<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+	</resheader>
+</root>

+ 15 - 0
PDF Office/Strings/Service/Service.zh-Hans.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 15 - 0
PDF Office/Strings/Service/Service.zh-Hant.resx

@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 31 - 8
PDF Office/ViewModels/PageEdit/PageEditContentViewModel.cs

@@ -186,6 +186,10 @@ namespace PDF_Office.ViewModels.PageEdit
             set
             {
                 SetProperty(ref tbPageRange, value);
+                if(string.IsNullOrEmpty(TbPageRange))
+                {
+                    TbPageRange = "请输入范围";
+                }
             }
         }
 
@@ -307,6 +311,15 @@ namespace PDF_Office.ViewModels.PageEdit
             }
         }
 
+        /// <summary>
+        /// 页面缩放的范围
+        /// </summary>
+        private List<Size> ItemSizes = new List<Size>() { 
+            new Size(104,142),
+            new Size(208, 294),
+            new Size(312,441)
+        };
+
 
         #endregion
 
@@ -792,8 +805,8 @@ namespace PDF_Office.ViewModels.PageEdit
         /// </summary>
         private void ZoomInCommandEvent()
         {
-            ChangeItemSize(new Size(PageEditItems[0].ItemSize.Width *2, PageEditItems[0].ItemSize.Height *2));
             ZoomIndex++;
+            ChangeItemSize(ItemSizes[ZoomIndex+1]);
 
             NotifyUIToRefresh();
         }
@@ -803,8 +816,8 @@ namespace PDF_Office.ViewModels.PageEdit
         /// </summary>
         private void ZoomOutCommandEvent()
         {
-            ChangeItemSize(new Size(PageEditItems[0].ItemSize.Width / 2, PageEditItems[0].ItemSize.Height / 2));
             ZoomIndex--;
+            ChangeItemSize(ItemSizes[ZoomIndex+1]);
             NotifyUIToRefresh();
         }
 
@@ -886,9 +899,16 @@ namespace PDF_Office.ViewModels.PageEdit
                 //    ComboxSelectIndex = 0;
                 //    return;
                 //}
-
-                string pageparm = CommonHelper.GetPageParmFromList(pagelist);
-                TbPageRange = pageparm;
+                //只选中单个页面是,listselectedIndex 更准确
+                if (pagelist.Count == 1)
+                {
+                    TbPageRange = (listSelecedIndex + 1).ToString();
+                }
+                else
+                {
+                    string pageparm = CommonHelper.GetPageParmFromList(pagelist);
+                    TbPageRange = pageparm;
+                }
             }
 
             //Ctrl+A时让所有item选中
@@ -927,7 +947,7 @@ namespace PDF_Office.ViewModels.PageEdit
                 return;
             }
 
-            if (args.Key != Key.Enter && args.Key != Key.Back && args.Key != Key.OemComma && args.Key != Key.Subtract && !((args.Key >= Key.D0 && args.Key <= Key.D9) || (args.Key >= Key.NumPad0 && args.Key <= Key.NumPad9)))
+            if (args.Key != Key.Enter && args.Key != Key.Back && args.Key != Key.OemComma && args.Key!=Key.OemMinus && args.Key != Key.Subtract && !((args.Key >= Key.D0 && args.Key <= Key.D9) || (args.Key >= Key.NumPad0 && args.Key <= Key.NumPad9)))
             {
                 args.Handled = true;
             }
@@ -1064,7 +1084,7 @@ namespace PDF_Office.ViewModels.PageEdit
             //    return;
             //}
             IsLoading = Visibility.Visible;
-            int insertindex = maxSelectedIndex;
+            int insertindex = maxSelectedIndex > listSelecedIndex ? maxSelectedIndex : listSelecedIndex;
             insertindex++;
             int pagecount = CacheFilePath.Instance.CopyDoc.PageCount;
             bool result = PDFViewer.Document.ImportPagesAtIndex(CacheFilePath.Instance.CopyDoc, "1-" + pagecount, insertindex);
@@ -1871,6 +1891,9 @@ namespace PDF_Office.ViewModels.PageEdit
                 }
             }
 
+            //旋转页面后取消选中
+            PDFViewer.ClearSelectPDFEdit(true);
+
             //如果是undo,Redo里调用的方法,则不记录到栈里
             if (!isFromUndoRedo)
             {
@@ -2076,7 +2099,7 @@ namespace PDF_Office.ViewModels.PageEdit
         {
             for (int i = startIndex; i <= endIndex; i++)
             {
-                if (i <= PDFViewer.Document.PageCount - 1 && i >= 0 && PageEditItems.Count > 0)
+                if (i <= PageEditItems.Count- 1 && i >= 0 && PageEditItems.Count > 0)
                 {
                     //宽高为样式中图片控件宽高
                     if (PageEditItems[i].isVertical)

+ 61 - 8
PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs

@@ -21,6 +21,7 @@ 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;
+using ComPDFKitViewer;
 
 namespace PDF_Office.ViewModels.Tools
 {
@@ -31,13 +32,13 @@ namespace PDF_Office.ViewModels.Tools
         private ViewContentViewModel viewContentViewModel;
 
         public IDialogService dialogs;
-
+        public CropPageUndoManager UndoManager=new CropPageUndoManager();
         public IEventAggregator eventAggregator;
-
+        List<int> cropCurrentPageList = new List<int>();
+        
        
-
         private CPDFDocument.GetPageIndexDelegate indexDelegate = null;
-    
+
 
         public string unicode = null;
 
@@ -60,8 +61,8 @@ namespace PDF_Office.ViewModels.Tools
         //        App.mainWindowViewModel.Value = int.Parse(PageIndex);
         //    }
         //}
-    //private CPDFDocument tempDocument;
-    //private IntPtr compressingIntpr = IntPtr.Zero;
+        //private CPDFDocument tempDocument;
+        //private IntPtr compressingIntpr = IntPtr.Zero;
         //private string _pageNumber = "";
         ///// <value>
         ///// 总页数
@@ -81,7 +82,8 @@ namespace PDF_Office.ViewModels.Tools
         public DelegateCommand CancelPasswordCommand { get; set; }
         public DelegateCommand<object> SetEditToolsCommand { get; set; }
         public DelegateCommand SetWatermarkCommand { get; set; }
-
+        public DelegateCommand CropCurrentPageWMCommand { get; set; }
+        public DelegateCommand CropAllPagesWMCommand { get; set; }
         public ToolsBarContentViewModel(IDialogService dialogService, IEventAggregator eventAggregator)
         {
             dialogs = dialogService;
@@ -92,6 +94,8 @@ namespace PDF_Office.ViewModels.Tools
             SetPasswordCommand = new DelegateCommand(OpenSetPasswordDialog);
             CancelPasswordCommand = new DelegateCommand(OpenCancelPasswordDialog);
             SetEditToolsCommand = new DelegateCommand<object>(SetEditTools);
+            CropCurrentPageWMCommand = new DelegateCommand(CropCurrentPageWM);
+            CropAllPagesWMCommand = new DelegateCommand(CropAllPagesWM);
         }
 
         private void SetEditTools(object e)
@@ -112,7 +116,7 @@ namespace PDF_Office.ViewModels.Tools
             {
                 CompressDialogModel compressDialogModel = new CompressDialogModel();
                 compressDialogModel.OnOpened((Prism.Services.Dialogs.DialogResult)e);
-               // OnOpened((Prism.Services.Dialogs.DialogResult)e);
+                // OnOpened((Prism.Services.Dialogs.DialogResult)e);
             });
         }
 
@@ -221,6 +225,53 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        private async void CropCurrentPageWM()
+        {
+            viewContentViewModel.IsLoading = Visibility.Visible;
+           await WaitCropCurrentPageWM();
+            viewContentViewModel.IsLoading = Visibility.Collapsed;
+        }
+        private async void  CropAllPagesWM()
+        {
+            viewContentViewModel.IsLoading = Visibility.Visible;
+            await WaitCropAllPagesWM();
+            viewContentViewModel.IsLoading = Visibility.Collapsed;
+
+            //PDFViewer.UndoManager.AddHistory();
+        }
+
+        private async Task WaitCropCurrentPageWM() {
+            await Task.Run(() => {
+                if (PDFViewer.CurrentIndex > 0)
+                {
+                    UndoManager.cropPageList.Add(PDFViewer.CurrentIndex);
+                }
+                UndoManager.ADDCropCurrentPageWM();
+                PDFViewer?.SetCropMode(true, UndoManager.cropPageList);
+                PDFViewer.UndoManager.AddHistory(UndoManager);
+                PDFViewer.UndoManager.CanSave = true;
+            });
+            
+        }
+
+        private async Task WaitCropAllPagesWM() {
+            await Task.Run(() => {
+                List<int> cropPagesList = new List<int>();
+                for (int i = 0; i < PDFViewer.Document.PageCount; i++)
+                {
+                    cropPagesList.Add(i);
+                }
+
+                UndoManager.cropPageList.AddRange(cropPagesList);
+                UndoManager.ADDCropAllPagesWM();
+                PDFViewer?.SetCropMode(true, UndoManager.cropPageList);
+                PDFViewer.UndoManager.AddHistory(UndoManager);
+                PDFViewer.UndoManager.CanSave = true;
+            });
+        }
+
+
+
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
             return true;
@@ -236,6 +287,8 @@ namespace PDF_Office.ViewModels.Tools
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             if (PDFViewer != null)
             {
+                UndoManager.setPDFViewer(PDFViewer);
+                //DFViewer.UndoManager.AddHistory(UndoManager);
                 isFirstLoad = false;
             }
         }

Разница между файлами не показана из-за своего большого размера
+ 17 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml


+ 2 - 0
PDF Office/Views/MainWindow.xaml

@@ -23,6 +23,7 @@
     Closed="Window_Closed"
     Closing="Window_Closing"
     SizeChanged="Window_SizeChanged"
+    PreviewMouseLeftButtonDown="Window_PreviewMouseLeftButtonDown"
     Style="{StaticResource WindowStyle}"
     UseLayoutRounding="True"
     WindowStartupLocation="CenterScreen"
@@ -219,6 +220,7 @@
             </dragablz:TabablzControl.HeaderSuffixContent>
             <dragablz:TabablzControl.HeaderPrefixContent>
                 <Grid
+                    Name="GridRoot"
                     Width="16"
                     Height="38"
                     Margin="0,0,0,0"

+ 18 - 0
PDF Office/Views/MainWindow.xaml.cs

@@ -150,5 +150,23 @@ namespace PDF_Office.Views
                 e.Cancel = true;
             }
         }
+
+        private void Window_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            //通过转移焦点来使文本框触发失去焦点事件
+            //var uiElement = FocusManager.GetFocusedElement(this);
+            //if (uiElement != null)
+            //{
+            //    var textBox = uiElement as TextBox;
+            //    //如果是下拉框里的文本框则不失去焦点
+            //    var parent = CommonHelper.FindVisualParent<ComboBox>(textBox);
+            //    var result = VisualTreeHelper.HitTest(parent,e.GetPosition());
+            //    if (textBox != null&&parent==null)
+            //    {
+            //        GridRoot.Focusable = true;
+            //        GridRoot.Focus();
+            //    }
+            //}
+        }
     }
 }

+ 13 - 23
PDF Office/Views/PageEdit/PageEditContent.xaml

@@ -20,6 +20,7 @@
     d:DesignHeight="450"
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
+    FocusVisualStyle="{x:Null}"
     IsVisibleChanged="PageEdit_IsVisibleChanged"
     SizeChanged="PageEdit_SizeChanged"
     mc:Ignorable="d">
@@ -173,26 +174,10 @@
                         <ComboBox
                             Width="117"
                             Height="23"
+                            IsEditable="True"
                             ItemsSource="{Binding PageRangeItems}"
-                            SelectedIndex="{Binding ComboxSelectIndex, Mode=TwoWay}" />
-                        <TextBlock
-                            Width="90"
-                            Margin="3,0"
-                            HorizontalAlignment="Left"
-                            VerticalAlignment="Center"
-                            Background="White"
-                            Text="{Binding TbPageRange}"
-                            Visibility="{Binding TbPageRangeVisibility}" />
-                        <TextBox
-                            Width="90"
-                            Height="20"
-                            Margin="3,0"
-                            HorizontalAlignment="Left"
-                            VerticalContentAlignment="Center"
-                            BorderThickness="0"
-                            InputMethod.IsInputMethodEnabled="False"
-                            IsVisibleChanged="TextBox_IsVisibleChanged"
-                            Visibility="{Binding TxtPageInputVisibility}">
+                            SelectedIndex="{Binding ComboxSelectIndex, Mode=TwoWay}"
+                            Text="{Binding TbPageRange}">
                             <i:Interaction.Triggers>
                                 <i:EventTrigger EventName="PreviewKeyDown">
                                     <i:InvokeCommandAction Command="{Binding PreviewKeyDown}" PassEventArgsToCommand="True" />
@@ -200,8 +185,11 @@
                                 <i:EventTrigger EventName="KeyDown">
                                     <i:InvokeCommandAction Command="{Binding KeyDown}" PassEventArgsToCommand="True" />
                                 </i:EventTrigger>
+                                <i:EventTrigger EventName="LostFocus">
+                                    <i:InvokeCommandAction Command="{Binding KeyDown}" PassEventArgsToCommand="True" />
+                                </i:EventTrigger>
                             </i:Interaction.Triggers>
-                        </TextBox>
+                        </ComboBox>
                     </Grid>
                     <Button Margin="5" Command="{Binding LeftRotateCommand}">
                         <Path
@@ -353,6 +341,7 @@
                     <Style TargetType="{x:Type ListBoxItem}">
                         <Setter Property="Template" Value="{StaticResource ListBoxItemControlTemplate}" />
                         <Setter Property="Margin" Value="0,10" />
+                        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                         <Setter Property="Visibility" Value="{Binding Visible}" />
                         <Setter Property="IsSelected" Value="{Binding Selected, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged}" />
                         <Setter Property="HorizontalAlignment" Value="Center" />
@@ -364,7 +353,7 @@
                         <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown" />
                         <EventSetter Event="PreviewMouseDoubleClick" Handler="ListBoxItem_PreviewMouseDoubleClick" />
                         <Style.Triggers>
-                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl,Mode=FindAncestor}, Path=DataContext.IsBOTAThumb}" Value="Visible">
+                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}, Path=DataContext.IsBOTAThumb}" Value="Visible">
                                 <Setter Property="Template" Value="{StaticResource BOTAListBoxItemTemplate}" />
                             </DataTrigger>
                         </Style.Triggers>
@@ -445,13 +434,14 @@
                 StringContent="{Binding ToastText}"
                 Visibility="{Binding ShowTip, Mode=TwoWay}"
                 Duration="0:0:0:3" />
-            <ProgressBar
+
+            <!--<ProgressBar
                 Grid.Row="1"
                 Width="400"
                 Height="10"
                 Foreground="Blue"
                 IsIndeterminate="True"
-                Visibility="{Binding IsLoading}" />
+                Visibility="{Binding IsLoading}" />-->
         </Grid>
     </Border>
 </UserControl>

+ 13 - 1
PDF Office/Views/Tools/ToolsBarContent.xaml

@@ -202,11 +202,23 @@
                             </Path>
                         </StackPanel>
                     </Button>
-                    <Button Style="{StaticResource InsideBarBtnStyle}" Visibility="Visible">
+                    <Button Style="{StaticResource InsideBarBtnStyle}" Visibility="Visible" IsEnabled="{Binding ElementName=SecurityMenuMore, Path=IsOpen, Converter={StaticResource InvertBoolConvert}}" Click="CropPageMore_Click" Initialized="CropPageMore_Initialized" Name="CropPageMenuMore">
                         <StackPanel Orientation="Horizontal" Margin="4,0,4,0">
                             <Path Data="M13 16L5 16C4.44771 16 4 15.5523 4 15V7L4 2V0H2L2 2H0V4H2L2 15C2 16.6569 3.34315 18 5 18L16 18V20H18V18H20V16H18H16H13ZM16 14V5C16 4.44771 15.5523 4 15 4H6V2H15C16.6569 2 18 3.34315 18 5V14H16Z" Fill="#273C62"></Path>
                             <TextBlock VerticalAlignment="Center" Text="裁剪" />
+                            <Path
+                        Width="12"
+                        Height="12"
+                        Margin="4,0"
+                        Data="M6.5 10L11.5 4H1.5L6.5 10Z"
+                        Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
                         </StackPanel>
+                        <Button.ContextMenu>
+                            <ContextMenu Name="CropPageMenu" Placement="Bottom">
+                                <MenuItem Header="Crop Current Page - White Margins" Command="{Binding CropCurrentPageWMCommand}"/>
+                                <MenuItem Header="Crop All Pages - White Margins" Command="{Binding CropAllPagesWMCommand}" />
+                            </ContextMenu>
+                        </Button.ContextMenu>
                     </Button>
                 </StackPanel>
             </Grid>

+ 11 - 0
PDF Office/Views/Tools/ToolsBarContent.xaml.cs

@@ -21,6 +21,17 @@ namespace PDF_Office.Views.Tools
         private void SecurityButtonMore_Initialized(object sender, System.EventArgs e)
         {
             this.SecurityButtonMore.ContextMenu = null;
+        }
+
+        private void CropPageMore_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            CropPageMenu.PlacementTarget = this.SecurityButtonMore;
+            CropPageMenu.IsOpen = true;
+        }
+
+        private void CropPageMore_Initialized(object sender, System.EventArgs e)
+        {
+            this.CropPageMenuMore.ContextMenu = null;
         }
     }
 }