|
@@ -393,14 +393,13 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
/// </summary>
|
|
|
public void SetPaper()
|
|
|
{
|
|
|
- if (true)
|
|
|
- {
|
|
|
PrintSettingsInfo.PrintDocument.PrinterSettings.PrinterName = PrinterName;
|
|
|
pageSetupDialog.Document = PrintSettingsInfo.PrintDocument;
|
|
|
pageSetupDialog.Document.DefaultPageSettings.Margins = new Margins((int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Left * 2.54), (int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Right * 2.54), (int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Top * 2.54), (int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Bottom * 2.54));
|
|
|
|
|
|
if (pageSetupDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
|
|
|
{
|
|
|
+ PrintSettingsInfo.IsPaperSizeChanged= true;
|
|
|
PrintSettingsInfo.PrintDocument.DefaultPageSettings = pageSetupDialog.PageSettings;
|
|
|
|
|
|
if (!PrintSettingsInfo.PrintDocument.DefaultPageSettings.Landscape)
|
|
@@ -412,30 +411,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
PrintOrientationIndex = 1;
|
|
|
}
|
|
|
this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- printQueue = localDefaultPrintServer.GetPrintQueue(PrinterName);
|
|
|
- LoadPrinterSettings();
|
|
|
- DialogParameters value = new DialogParameters();
|
|
|
- value.Add("Unicode", Unicode);
|
|
|
- value.Add(ParameterNames.PrintQueue, printQueue);
|
|
|
- printDialogs.ShowDialog(DialogNames.HomePagePrinterPaperSettingsDialog, value, e =>
|
|
|
- {
|
|
|
- if (e.Result == ButtonResult.OK)
|
|
|
- {
|
|
|
- PrintSettingsInfo.PageMediaSize = e.Parameters.GetValue<PageMediaSize>("PageMediaSize");
|
|
|
- PrintSettingsInfo.Margin.Clear();
|
|
|
- PrintSettingsInfo.Margin.Add(e.Parameters.GetValue<int>("MarginLeft"));
|
|
|
- PrintSettingsInfo.Margin.Add(e.Parameters.GetValue<int>("MarginTop"));
|
|
|
- PrintSettingsInfo.Margin.Add(e.Parameters.GetValue<int>("MarginRight"));
|
|
|
- PrintSettingsInfo.Margin.Add(e.Parameters.GetValue<int>("MarginBottom"));
|
|
|
- this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
|
|
|
- }
|
|
|
- });
|
|
|
+ PrintSettingsInfo.IsPaperSizeChanged= false;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
public void ChangePrintMod(object e)
|
|
@@ -716,7 +693,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
if (printModInfoWithUnicode.printModInfo.EnumPrintMod == currentHomePagePrinterMod)
|
|
|
{
|
|
|
PrintSettingsInfo.PrintModInfo = printModInfoWithUnicode.printModInfo;
|
|
|
- this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
|
|
|
+ this.printEvent.GetEvent<SendPrintSettingsInfoEvent>().Publish(new PrintSettingsInfoWithUnicode { printSettingsInfo = this.PrintSettingsInfo, Unicode = this.Unicode });
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -741,7 +718,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
param.Add(ParameterNames.PDFViewer, PDFViewer);
|
|
|
param.Add(ParameterNames.PrintSettingsInfo, PrintSettingsInfo);
|
|
|
param.Add("Unicode", Unicode);
|
|
|
- printRegion.RequestNavigate(HomePagePrinterDocumentRegionName, HomePagePrinterDocumentName, param);
|
|
|
+ printRegion.RequestNavigate(HomePagePrinterDocumentRegionName, HomePagePrinterDocumentName, param);
|
|
|
PageSetupDialog pageSetupDialog = new PageSetupDialog();
|
|
|
PrintSettingsInfo.PrintDocument.PrinterSettings.PrinterName = PrinterName;
|
|
|
pageSetupDialog.Document = PrintSettingsInfo.PrintDocument;
|