|
@@ -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();
|
|
|
}
|
|
|
}
|