Browse Source

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

liyuxuan 1 year ago
parent
commit
9887d5bc93

+ 20 - 1
PDF Office/App.xaml.cs

@@ -71,6 +71,7 @@ using System.Text;
 using Prism.Services.Dialogs;
 using NetSparkleUpdater;
 using NetSparkleUpdater.SignatureVerifiers;
+using System.Threading;
 
 namespace PDF_Master
 {
@@ -352,6 +353,24 @@ namespace PDF_Master
             {
             }
 
+            #region 设置软件语系
+            List<string> lang = new List<string>() { "zh-CN", "zh-TW", "en-US" };
+            CultureInfo cultureInfo = new CultureInfo("en-US");
+            //if (lang.Contains(Settings.Default.AppProperties.culture))
+            //{
+            //    cultureInfo = new CultureInfo(Settings.Default.AppProperties.culture);
+            //}
+
+            //以防万一  极少数机器可能报错
+            try
+            {
+                Thread.CurrentThread.CurrentUICulture = new CultureInfo(cultureInfo.Name);
+                Thread.CurrentThread.CurrentCulture = new CultureInfo(cultureInfo.Name);
+            }
+            catch { }
+
+            #endregion
+
             //启动循环检查更新线程
             CheckUpdate();
 
@@ -745,7 +764,7 @@ namespace PDF_Master
                         lang = "en_Us";
                         break;
                 }
-#if DEBUG
+#if !DEBUG
                 var appcastUrl = string.Format("http://test-pdf-pro.kdan.cn:3021/downloads/pdfmaster_win_{0}.xml", lang);
 #else
                 //var appcastUrl = string.Format("http://test-pdf-pro.kdan.cn:3021/downloads/pdfmaster_win_{0}.xml", lang);

+ 1 - 1
PDF Office/Helper/PDFToolsHelper.cs

@@ -215,7 +215,7 @@ namespace PDF_Master.Helper
             var pDFToImage = new PDFToolsInit();
             pDFToImage.SetFnType(PDFFnType.PDFToImage);
             pDFToImage.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/pdf-to-image.png");
-            pDFToImage.SetContent("To Image", "Convert PDF to image, such as JPEG, JPG, PNG, GIF, TIFF, TAG,BMP.");
+            pDFToImage.SetContent("To Image", "Convert PDF to image, such as JPEG, JPG, PNG, GIF, TIFF, TGA,BMP.");
             //水印
             var waterMark = new PDFToolsInit();
             waterMark.SetFnType(PDFFnType.WaterMark);

+ 3 - 2
PDF Office/Model/Dialog/ToolsDialogs/CompressDialogModel/CompressDialogModel.cs

@@ -58,6 +58,7 @@ namespace PDF_Master.Model.Dialog.ToolsDialogs
                 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;
@@ -66,11 +67,11 @@ namespace PDF_Master.Model.Dialog.ToolsDialogs
                     document.UnlockWithPassword(password);
                     indexDelegate += GetIndex;
                     compressingIntpr = document.CompressFile_Init(compressquality, indexDelegate);
-                    //GC.KeepAlive(indexDelegate);
+                    GC.KeepAlive(indexDelegate);//关键  防止委托过早回收
                     tempDocument = document;
                     Trace.WriteLine("compressDialogModel.CompressQuality" + compressquality);
                     App.mainWindowViewModel.ProcessCloseAction = CompressClear;
-                    if (await Task.Run<bool>(() => { return document.CompressFile_Start(compressingIntpr, filepath); })) { CommonHelper.ShowFileBrowser(filepath); }
+                    if (await Task.Run<bool>(() => { return document.CompressFile_Start(compressingIntpr, filepath); })) { CommonHelper.ShowFileBrowser(filepath);  }
 
                     document.Release();
                 }

+ 8 - 8
PDF Office/MultilingualResources/PDF Office.en.xlf

@@ -520,10 +520,10 @@
         <trans-unit id="GuidContentP1" translate="yes" xml:space="preserve">
           <source>Enjoy All Advanced Features!
 
-View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity.</source>
+View, Annotate, Fill and Convert PDFs with PDF Master to boost your productivity.</source>
           <target state="new">Enjoy All Advanced Features!
 
-View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity.</target>
+View, Annotate, Fill and Convert PDFs with PDF Master to boost your productivity.</target>
         </trans-unit>
         <trans-unit id="GuidContentP2" translate="yes" xml:space="preserve">
           <source>Add highlights, freehand, text, stamps, links, shapes, and notes to your documents. Easily mark up your PDFs anytime!</source>
@@ -719,8 +719,8 @@ View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity
           <target state="new">Crop</target>
         </trans-unit>
         <trans-unit id="ContentSelection_Output" translate="yes" xml:space="preserve">
-          <source>Output</source>
-          <target state="new">Output</target>
+          <source>Export</source>
+          <target state="new">Export</target>
         </trans-unit>
         <trans-unit id="ContentSelection_Print" translate="yes" xml:space="preserve">
           <source>Print</source>
@@ -902,11 +902,11 @@ View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity
         </trans-unit>
         <trans-unit id="Merge_Hint" translate="yes" xml:space="preserve">
           <source>Selected files
-Drop files here or Click “Add Files” at bottom right button. 
-Drag files to reorder as you need.</source>
+Drop files here or Click “+”. Drag files to reorder as you need.
+You can also add files or folders via the lower left button.</source>
           <target state="new">Selected files
-Drop files here or Click “Add Files” at bottom right button. 
-Drag files to reorder as you need.</target>
+Drop files here or Click “+”. Drag files to reorder as you need.
+You can also add files or folders via the lower left button.</target>
         </trans-unit>
         <trans-unit id="Merge_ItemPages" translate="yes" xml:space="preserve">
           <source>Pages</source>

+ 8 - 8
PDF Office/MultilingualResources/PDF Office.zh-Hans.xlf

@@ -520,10 +520,10 @@
         <trans-unit id="GuidContentP1" translate="yes" xml:space="preserve">
           <source>Enjoy All Advanced Features!
 
-View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity.</source>
+View, Annotate, Fill and Convert PDFs with PDF Master to boost your productivity.</source>
           <target state="new">Enjoy All Advanced Features!
 
-View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity.</target>
+View, Annotate, Fill and Convert PDFs with PDF Master to boost your productivity.</target>
         </trans-unit>
         <trans-unit id="GuidContentP2" translate="yes" xml:space="preserve">
           <source>Add highlights, freehand, text, stamps, links, shapes, and notes to your documents. Easily mark up your PDFs anytime!</source>
@@ -719,8 +719,8 @@ View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity
           <target state="new">Crop</target>
         </trans-unit>
         <trans-unit id="ContentSelection_Output" translate="yes" xml:space="preserve">
-          <source>Output</source>
-          <target state="new">Output</target>
+          <source>Export</source>
+          <target state="new">Export</target>
         </trans-unit>
         <trans-unit id="ContentSelection_Print" translate="yes" xml:space="preserve">
           <source>Print</source>
@@ -902,11 +902,11 @@ View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity
         </trans-unit>
         <trans-unit id="Merge_Hint" translate="yes" xml:space="preserve">
           <source>Selected files
-Drop files here or Click “Add Files” at bottom right button. 
-Drag files to reorder as you need.</source>
+Drop files here or Click “+”. Drag files to reorder as you need.
+You can also add files or folders via the lower left button.</source>
           <target state="new">Selected files
-Drop files here or Click “Add Files” at bottom right button. 
-Drag files to reorder as you need.</target>
+Drop files here or Click “+”. Drag files to reorder as you need.
+You can also add files or folders via the lower left button.</target>
         </trans-unit>
         <trans-unit id="Merge_ItemPages" translate="yes" xml:space="preserve">
           <source>Pages</source>

+ 8 - 8
PDF Office/MultilingualResources/PDF Office.zh-Hant.xlf

@@ -520,10 +520,10 @@
         <trans-unit id="GuidContentP1" translate="yes" xml:space="preserve">
           <source>Enjoy All Advanced Features!
 
-View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity.</source>
+View, Annotate, Fill and Convert PDFs with PDF Master to boost your productivity.</source>
           <target state="new">Enjoy All Advanced Features!
 
-View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity.</target>
+View, Annotate, Fill and Convert PDFs with PDF Master to boost your productivity.</target>
         </trans-unit>
         <trans-unit id="GuidContentP2" translate="yes" xml:space="preserve">
           <source>Add highlights, freehand, text, stamps, links, shapes, and notes to your documents. Easily mark up your PDFs anytime!</source>
@@ -719,8 +719,8 @@ View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity
           <target state="new">Crop</target>
         </trans-unit>
         <trans-unit id="ContentSelection_Output" translate="yes" xml:space="preserve">
-          <source>Output</source>
-          <target state="new">Output</target>
+          <source>Export</source>
+          <target state="new">Export</target>
         </trans-unit>
         <trans-unit id="ContentSelection_Print" translate="yes" xml:space="preserve">
           <source>Print</source>
@@ -902,11 +902,11 @@ View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity
         </trans-unit>
         <trans-unit id="Merge_Hint" translate="yes" xml:space="preserve">
           <source>Selected files
-Drop files here or Click “Add Files” at bottom right button. 
-Drag files to reorder as you need.</source>
+Drop files here or Click “+”. Drag files to reorder as you need.
+You can also add files or folders via the lower left button.</source>
           <target state="new">Selected files
-Drop files here or Click “Add Files” at bottom right button. 
-Drag files to reorder as you need.</target>
+Drop files here or Click “+”. Drag files to reorder as you need.
+You can also add files or folders via the lower left button.</target>
         </trans-unit>
         <trans-unit id="Merge_ItemPages" translate="yes" xml:space="preserve">
           <source>Pages</source>

BIN
PDF Office/Resources/GuidItems/Guid_Office.png


+ 1 - 1
PDF Office/Strings/HomePage/HomePage.Designer.cs

@@ -99,7 +99,7 @@ namespace PDF_Master.Strings.HomePage {
         /// <summary>
         ///   查找类似 Enjoy All Advanced Features!
         ///
-        ///View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity. 的本地化字符串。
+        ///View, Annotate, Fill and Convert PDFs with PDF Master to boost your productivity. 的本地化字符串。
         /// </summary>
         public static string GuidContentP1 {
             get {

+ 1 - 1
PDF Office/Strings/HomePage/HomePage.resx

@@ -126,7 +126,7 @@
   <data name="GuidContentP1" xml:space="preserve">
     <value>Enjoy All Advanced Features!
 
-View, Annotate, Fill and Convert PDFs with PDF Office to boost your productivity.</value>
+View, Annotate, Fill and Convert PDFs with PDF Master to boost your productivity.</value>
   </data>
   <data name="GuidContentP2" xml:space="preserve">
     <value>Add highlights, freehand, text, stamps, links, shapes, and notes to your documents. Easily mark up your PDFs anytime!</value>

+ 3 - 3
PDF Office/Strings/MainPage/MainPage.Designer.cs

@@ -439,7 +439,7 @@ namespace PDF_Master.Strings.MainPage {
         }
         
         /// <summary>
-        ///   查找类似 Output 的本地化字符串。
+        ///   查找类似 Export 的本地化字符串。
         /// </summary>
         public static string ContentSelection_Output {
             get {
@@ -1264,8 +1264,8 @@ namespace PDF_Master.Strings.MainPage {
         
         /// <summary>
         ///   查找类似 Selected files
-        ///Drop files here or Click “Add Files” at bottom right button. 
-        ///Drag files to reorder as you need. 的本地化字符串。
+        ///Drop files here or Click “+”. Drag files to reorder as you need.
+        ///You can also add files or folders via the lower left button. 的本地化字符串。
         /// </summary>
         public static string Merge_Hint {
             get {

+ 3 - 3
PDF Office/Strings/MainPage/MainPage.resx

@@ -250,7 +250,7 @@
     <value>Crop</value>
   </data>
   <data name="ContentSelection_Output" xml:space="preserve">
-    <value>Output</value>
+    <value>Export</value>
   </data>
   <data name="ContentSelection_Print" xml:space="preserve">
     <value>Print</value>
@@ -555,8 +555,8 @@ The file format you selected is not supported by this feature, please select the
   </data>
   <data name="Merge_Hint" xml:space="preserve">
     <value>Selected files
-Drop files here or Click “Add Files” at bottom right button. 
-Drag files to reorder as you need.</value>
+Drop files here or Click “+”. Drag files to reorder as you need.
+You can also add files or folders via the lower left button.</value>
   </data>
   <data name="Merge_ItemPages" xml:space="preserve">
     <value>Pages</value>

+ 1 - 0
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs

@@ -331,6 +331,7 @@ namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
                 default:
                     break;
             }
+            this.ConverterImgModel.Options.ImageDpi = 150;
         }
 
         private void cancel()

+ 2 - 17
PDF Office/ViewModels/Dialog/ServiceDialog/IAPCompareDialogViewModel.cs

@@ -354,7 +354,6 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
         public DelegateCommand GoRegisterCommand { get; set; }
 
 
-
        public IAPCompareDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
            
@@ -363,17 +362,14 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             GoRegisterCommand = new DelegateCommand(GoRegisterd);
             InitString();
 
-            
-
-            
-
             Items.Add(new User() { Use = Text_CreatePDFfrom, UnRe = true, Re=true, UseType = UseType.CreatePDF });
             Items.Add(new User() { Use = Text_CreatePDFfromscanner, UnRe = true, Re = true, UseType = UseType.CreatePDF });
             Items.Add(new User() { Use = Text_ConvertPDFtoMicrosoft, UnRe = false, Re = true, UseType = UseType.ConvertPDF });
             Items.Add(new User() { Use = Text_TurnPDF, UnRe = false, Re = true, UseType = UseType.ConvertPDF });
             Items.Add(new User() { Use = Text_Compress, UnRe = false, Re = true, UseType = UseType.AdvancedEditTools });
             Items.Add(new User() { Use = Text_Merge, UnRe = false, Re = true, UseType = UseType.AdvancedEditTools });
-            Items.Add(new User() { Use = Text_Fill, UnRe = false, Re = true, UseType = UseType.AdvancedEditTools });
+            //初版先不显示填写与签名
+            //Items.Add(new User() { Use = Text_Fill, UnRe = false, Re = true, UseType = UseType.AdvancedEditTools });
             Items.Add(new User() { Use = Text_Crop, UnRe = false, Re = true, UseType = UseType.AdvancedEditTools });
             Items.Add(new User() { Use = Text_Rotate, UnRe = false, Re = true, UseType = UseType.AdvancedEditTools });
             Items.Add(new User() { Use = Text_Basic, UnRe = true, Re = true, UseType = UseType.AnnotatePDF });
@@ -388,21 +384,14 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             IAPConvert iAPConverter = new IAPConvert();
             PropertyGroupDescription groupDescription = new PropertyGroupDescription("UseType", iAPConverter);
             view.GroupDescriptions.Add(groupDescription);
-           
-
         }
 
-
-
-
         private void GoRegisterd()
         {
 
             RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
             App.mainWindowViewModel.OpenRegister();
         }
-
-
         private void GoLogin()
         {
 
@@ -411,9 +400,5 @@ namespace PDF_Master.ViewModels.Dialog.ServiceDialog
             App.mainWindowViewModel.OpenLogin();
 
         }
-
-
-
-      
     }
 }

+ 11 - 1
PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs

@@ -1,5 +1,6 @@
 using ComPDFKitViewer.PdfViewer;
 using Microsoft.Office.Core;
+using PDF_Master.CustomControl;
 using PDF_Master.Helper;
 using PDF_Master.Model;
 using PDF_Master.Model.Dialog.ConverterDialogs;
@@ -233,6 +234,12 @@ namespace PDF_Master.ViewModels.HomePanel.PDFTools
                         //dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, securitypdf, e => { });
                         CPDFViewer cPDFViewer = new CPDFViewer();
                         cPDFViewer.InitDocument(dlg.FileName);
+                        if (cPDFViewer.Document == null) {
+                            AlertsMessage alertsMessage = new AlertsMessage();
+                            alertsMessage.ShowDialog("", App.MainPageLoader.GetString("Main_OpenFileFailedWarning"), App.ServiceLoader.GetString("Text_ok"));
+
+                            return ;
+                        }
                         VerifyPasswordResult result = SecurityHelper.VerifyPasswordByPasswordKind(cPDFViewer.Document, EnumPasswordKind.StatusPermissionsPassword, dialogs);
                         if (result.IsDiscryptied)
                         {
@@ -411,7 +418,10 @@ namespace PDF_Master.ViewModels.HomePanel.PDFTools
         private bool CheckPassword(CPDFViewer viewer) {
             if (viewer.Document == null)
             {
-                //MessageBoxEx.Show(App.MainPageLoader.GetString("Main_OpenFileFailedWarning"));
+
+                AlertsMessage alertsMessage = new AlertsMessage();
+                alertsMessage.ShowDialog("", App.MainPageLoader.GetString("Main_OpenFileFailedWarning"), App.ServiceLoader.GetString("Text_ok"));
+               
                 return false;
             }
             if (viewer.Document.IsLocked)

+ 4 - 4
PDF Office/Views/BOTA/BookmarkContent.xaml

@@ -46,11 +46,11 @@
                         Height="16"
                         Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />-->
                         <Path
-                            VerticalAlignment="Top"
                             Grid.Column="0"
                             Width="16"
-                            Margin="0 9 0 0"
                             Height="16"
+                            Margin="0,9,0,0"
+                            VerticalAlignment="Top"
                             Data="M3 3.47368C3 2.65979 3.65979 2 4.47368 2H11.5263C12.3402 2 13 2.65979 13 3.47368V14.3044C13 14.9486 12.2314 15.2826 11.7604 14.843L8.50276 11.8026C8.21966 11.5384 7.78034 11.5384 7.49724 11.8026L4.2396 14.843C3.7686 15.2826 3 14.9486 3 14.3044V3.47368Z"
                             Fill="#94989C">
                             <Path.RenderTransform>
@@ -83,8 +83,8 @@
                             Padding="5"
                             Background="Transparent"
                             FontSize="14"
-                            TextWrapping="Wrap"
                             Text="{Binding Title}"
+                            TextWrapping="Wrap"
                             Visibility="Visible" />
                     </Grid>
                 </StackPanel>
@@ -121,7 +121,7 @@
                     FontSize="14"
                     FontWeight="SemiBold"
                     Foreground="{StaticResource color.sys.text.neutral.lv1}"
-                    Text="Bookmarks" />
+                    Text="Bookmark" />
                 <Button
                     Name="BtnAddBookmark"
                     Width="40"

+ 2 - 1
PDF Office/Views/BOTA/OutLineControl.xaml

@@ -9,6 +9,7 @@
     xmlns:mainPageLoader="clr-namespace:PDF_Master.Strings.MainPage"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:model="clr-namespace:PDF_Master.Model.BOTA"
+    Width="400"
     d:DataContext="{d:DesignInstance Type=bota:OutLineControlViewModel}"
     KeyDown="UserControl_KeyDown"
     mc:Ignorable="d">
@@ -203,7 +204,7 @@
                     FontFamily="Segoe UI"
                     FontSize="12"
                     Foreground="#94989C"
-                    Text="Please right-click on the selected page and select 'Add Outline', or click the 'Add' button on the upper right to create a outline."
+                    Text="No Outlines Please right-click on the selected text or click the 'Add' button on the upper right to create an outline."
                     TextWrapping="Wrap" />
             </StackPanel>
             <TreeView

+ 3 - 2
PDF Office/Views/ViewContent.xaml

@@ -493,7 +493,7 @@
                         Height="40"
                         Header="编辑"
                         Style="{StaticResource ToolbarTabs}"
-                        Visibility="Visible">
+                        Visibility="Collapsed">
                         <Grid Grid.Row="1" Height="40" />
                     </cus:IconAndTextTabItem>
                     <cus:IconAndTextTabItem
@@ -508,7 +508,8 @@
                         x:Name="TabItemFill"
                         Height="40"
                         Header="{Binding T_FillSign}"
-                        Style="{StaticResource ToolbarTabs}">
+                        Style="{StaticResource ToolbarTabs}"
+                        Visibility="Collapsed">
                         <Grid Grid.Row="1" Height="40" />
                     </cus:IconAndTextTabItem>
                     <cus:IconAndTextTabItem