瀏覽代碼

其他- 开放另存为flatten入口

ZhouJieSheng 1 年之前
父節點
當前提交
07ac1e1e5b
共有 2 個文件被更改,包括 7 次插入6 次删除
  1. 6 2
      PDF Office/ViewModels/ViewContentViewModel.cs
  2. 1 4
      PDF Office/Views/ViewContent.xaml

+ 6 - 2
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -3006,18 +3006,22 @@ namespace PDF_Master.ViewModels
         {
             var dlg = new SaveFileDialog();
             dlg.Filter = Properties.Resources.OpenDialogFilter;
-            dlg.FileName = PDFViewer.Document.FileName.Substring(0, PDFViewer.Document.FileName.LastIndexOf(".")) + "_Flatten.pdf";
+            dlg.FileName = PDFViewer.Document.FileName + "_Flattened.pdf";
 
             if (dlg.ShowDialog() == true && !string.IsNullOrEmpty(dlg.FileName))
             {
                 saveFile();
-                CPDFDocument kmdoc = CPDFDocument.InitWithFilePath(PDFViewer.Document.FileName);
+                CPDFDocument kmdoc = CPDFDocument.InitWithFilePath(PDFViewer.Document.FilePath);
                 if (kmdoc == null)
+                {
                     return;
+                }
 
                 bool result = kmdoc.WriteFlattenToFilePath(dlg.FileName);
                 if (result)
+                {
                     System.Diagnostics.Process.Start("explorer", "/select,\"" + dlg.FileName + "\"");
+                }
                 kmdoc.Release();
             }
         }

+ 1 - 4
PDF Office/Views/ViewContent.xaml

@@ -233,10 +233,7 @@
                                 Command="{Binding SaveAsFile}"
                                 Header="Save As"
                                 InputGestureText="Ctrl+Shift+S" />
-                            <MenuItem
-                                Command="{Binding SaveAsFlattenCommand}"
-                                Header="Save as Flattened PDF"
-                                Visibility="Collapsed" />
+                            <MenuItem Command="{Binding SaveAsFlattenCommand}" Header="Save as Flattened PDF" />
                             <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
                             <MenuItem Command="{Binding CompressCommand}" Header="Compress" />
                             <MenuItem Header="Security">