|
@@ -1,39 +1,26 @@
|
|
|
-using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePrinter;
|
|
|
using Prism.Commands;
|
|
|
using Prism.Mvvm;
|
|
|
using Prism.Regions;
|
|
|
using Prism.Services.Dialogs;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
-using System.Windows.Controls;
|
|
|
using System.Windows;
|
|
|
-using System.Diagnostics;
|
|
|
using System.Drawing.Printing;
|
|
|
-using PDFSettings;
|
|
|
using ComPDFKit.PDFDocument;
|
|
|
using PDF_Office.Model;
|
|
|
using System.Drawing;
|
|
|
using System.Reflection;
|
|
|
using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter;
|
|
|
using System.Threading.Tasks;
|
|
|
-using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.SetPasswordDialogModel;
|
|
|
using ComPDFKit.PDFPage;
|
|
|
using PDF_Office.Helper;
|
|
|
using System.Drawing.Drawing2D;
|
|
|
-using static PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter.HomePagePrinterDialogModel;
|
|
|
using ComPDFKitViewer.PdfViewer;
|
|
|
using System.Windows.Media.Imaging;
|
|
|
using System.Drawing.Imaging;
|
|
|
-using System.Text.RegularExpressions;
|
|
|
using PDF_Office.CustomControl;
|
|
|
-using System.IO;
|
|
|
using Prism.Events;
|
|
|
-using PrintMod = PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter.PrintMod;
|
|
|
-using FastExpressionCompiler.LightExpression;
|
|
|
using ImTools;
|
|
|
-using DryIoc;
|
|
|
-using System.Windows.Annotations;
|
|
|
-using System.Windows.Forms;
|
|
|
|
|
|
namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
{
|
|
@@ -45,7 +32,34 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
public IRegionManager PrintModRegion;
|
|
|
private Object locker = new Object();
|
|
|
private CPDFViewer currentViewer;
|
|
|
- private string currentPrintModName;
|
|
|
+
|
|
|
+ private string _currentPrintModName;
|
|
|
+ public string CurrentPrintModName
|
|
|
+ {
|
|
|
+ get { return _currentPrintModName; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ if (value == "ModSize")
|
|
|
+ {
|
|
|
+ IsEnableForModBooklet = true;
|
|
|
+ IsEnableForModMultiple = true;
|
|
|
+ IsEnableForModSize = false;
|
|
|
+ }
|
|
|
+ else if (value == "ModMultiple")
|
|
|
+ {
|
|
|
+ IsEnableForModBooklet = true;
|
|
|
+ IsEnableForModMultiple = false;
|
|
|
+ IsEnableForModSize = true;
|
|
|
+ }
|
|
|
+ else if (value == "ModBooklet")
|
|
|
+ {
|
|
|
+ IsEnableForModBooklet = false;
|
|
|
+ IsEnableForModMultiple = true;
|
|
|
+ IsEnableForModSize = true;
|
|
|
+ }
|
|
|
+ _currentPrintModName = value;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public HomePagePrinterDialogModel homePagePrinterDialogModel;
|
|
|
public HomePagePrinterPageSetDialogViewModel homePagePrinterPageSetDialogViewModel { get; set; }
|
|
@@ -86,7 +100,10 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
public List<string> PrintOrientationList
|
|
|
{
|
|
|
get { return _printerOrientationList; }
|
|
|
- set { _printerOrientationList = value; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ _printerOrientationList = value;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private bool _isEnableForGetNextPage = true;
|
|
@@ -110,6 +127,40 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
RaisePropertyChanged();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private bool _isEnableForModSize = false;
|
|
|
+ public bool IsEnableForModSize
|
|
|
+ {
|
|
|
+ get { return _isEnableForModSize; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref _isEnableForModSize, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool _isEnableForModPoster = false;
|
|
|
+ public bool IsEnableForModPoster
|
|
|
+ {
|
|
|
+ get { return _isEnableForModPoster; }
|
|
|
+ set { _isEnableForModPoster = value; }
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool _isEnableForModMultiple = true;
|
|
|
+ public bool IsEnableForModMultiple
|
|
|
+ {
|
|
|
+ get { return _isEnableForModMultiple; }
|
|
|
+ set { SetProperty(ref _isEnableForModMultiple, value); }
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool _isEnableForModBooklet = true;
|
|
|
+ public bool IsEnableForModBooklet
|
|
|
+ {
|
|
|
+ get { return _isEnableForModBooklet; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref _isEnableForModBooklet, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
#endregion
|
|
|
|
|
|
#region 属性设置
|
|
@@ -181,7 +232,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
set { _enumPaperSize = value; }
|
|
|
}
|
|
|
|
|
|
- private int _leftMargin;
|
|
|
+ private int _leftMargin = 0;
|
|
|
/// <summary>
|
|
|
/// 纸张左边距
|
|
|
/// </summary>
|
|
@@ -191,7 +242,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
set { _leftMargin = value; }
|
|
|
}
|
|
|
|
|
|
- private int _rightMargin;
|
|
|
+ private int _rightMargin = 0;
|
|
|
/// <summary>
|
|
|
/// 纸张右边距
|
|
|
/// </summary>
|
|
@@ -201,7 +252,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
set { _rightMargin = value; }
|
|
|
}
|
|
|
|
|
|
- private int _bottomMargin;
|
|
|
+ private int _bottomMargin = 0;
|
|
|
/// <summary>
|
|
|
/// 纸张下边距
|
|
|
/// </summary>
|
|
@@ -211,7 +262,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
set { _bottomMargin = value; }
|
|
|
}
|
|
|
|
|
|
- private int _topMargin;
|
|
|
+ private int _topMargin = 0;
|
|
|
/// <summary>
|
|
|
/// 纸张上边距
|
|
|
/// </summary>
|
|
@@ -377,12 +428,24 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
get { return _printOrientationIndex; }
|
|
|
set
|
|
|
{
|
|
|
+ if (value != _printOrientationIndex)
|
|
|
+ {
|
|
|
+ if(value == 0)
|
|
|
+ {
|
|
|
+ RotatePreviewPaperWhenPortrait();
|
|
|
+ }
|
|
|
+ if (value == 1)
|
|
|
+ {
|
|
|
+ RotatePreviewPaperWhenLandscape();
|
|
|
+ }
|
|
|
+ }
|
|
|
_printOrientationIndex = value;
|
|
|
if (flagIsAutoOrientation == true)
|
|
|
{
|
|
|
flagIsAutoOrientation = false;
|
|
|
}
|
|
|
RaisePropertyChanged(nameof(PrintOrientationIndex));
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
#endregion
|
|
@@ -596,8 +659,6 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
#region 组件初始化
|
|
|
private void InitComponent()
|
|
|
{
|
|
@@ -625,7 +686,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
|
|
|
lock (locker)
|
|
|
{
|
|
|
- switch (currentPrintModName)
|
|
|
+ switch (CurrentPrintModName)
|
|
|
{
|
|
|
case "ModPoster":
|
|
|
PreviewModPoster(CurrentPreviewIndex);
|
|
@@ -732,12 +793,31 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
#endregion
|
|
|
|
|
|
#region 打印预览
|
|
|
+
|
|
|
+ public void RotatePreviewPaperWhenLandscape()
|
|
|
+ {
|
|
|
+ RotateAngle = 90;
|
|
|
+ RotateCenterX = ViewBoxWidth / 2;
|
|
|
+ RotateCenterY = ViewBoxHeight / 2;
|
|
|
+ int temp;
|
|
|
+ temp = PaperWidth;
|
|
|
+ PaperWidth = PaperHeight;
|
|
|
+ PaperHeight = temp;
|
|
|
+ }
|
|
|
+ public void RotatePreviewPaperWhenPortrait()
|
|
|
+ {
|
|
|
+ RotateAngle = 0;
|
|
|
+ RotateCenterX = 0;
|
|
|
+ RotateCenterY = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 翻页刷新
|
|
|
/// </summary>
|
|
|
public void GetPagePreviewWhenIndexChanged()
|
|
|
{
|
|
|
- if (currentPrintModName == "ModSize" && currentPrintModName == "ModPoster")
|
|
|
+ if (CurrentPrintModName == "ModSize" && CurrentPrintModName == "ModPoster")
|
|
|
{
|
|
|
CurrentPreviewIndex = TargetPages[currentListIndex];
|
|
|
}
|
|
@@ -890,9 +970,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
{
|
|
|
double left = 0;
|
|
|
double top = 0;
|
|
|
- double rate = 0.55;
|
|
|
+ double ratio = 0.55;
|
|
|
int dpi = (int)GetDpiByGraphics();
|
|
|
- Bitmap bitmap = await ToolMethod.RenderPageBitmap(document, (int)(cPDFPage.PageSize.Width * rate * 1.4), (int)(cPDFPage.PageSize.Height * rate * 1.4), paperIndex, printSettingsInfo.PrintWithAnnot, printSettingsInfo.PrintWithForm);
|
|
|
+ Bitmap bitmap = await ToolMethod.RenderPageBitmap(document, (int)(cPDFPage.PageSize.Width * ratio * 1.4), (int)(cPDFPage.PageSize.Height * ratio * 1.4), paperIndex, printSettingsInfo.PrintWithAnnot, printSettingsInfo.PrintWithForm);
|
|
|
var pageBound = printDocument.DefaultPageSettings.Bounds;
|
|
|
|
|
|
if (printSettingsInfo.IsBlackAndWhite)
|
|
@@ -905,9 +985,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
if (printSettingsInfo.EnumPrintOrientation == EnumPrintOrientation.StatusLandscape)
|
|
|
{
|
|
|
bitmap.RotateFlip(RotateFlipType.Rotate270FlipNone);
|
|
|
- bitmap = (Bitmap)ResizeImage(bitmap, new System.Drawing.Size((int)(pageBound.Width * rate), (int)(pageBound.Height * rate)));
|
|
|
+ bitmap = (Bitmap)ResizeImage(bitmap, new System.Drawing.Size((int)(pageBound.Width * ratio), (int)(pageBound.Height * ratio)));
|
|
|
}
|
|
|
- else { }
|
|
|
+
|
|
|
System.Drawing.Size newSize = new System.Drawing.Size();
|
|
|
|
|
|
if (sizeInfo.EnumSizeType == EnumSizeType.StatusAdaptive)
|
|
@@ -915,8 +995,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
float zoompercent = 0;
|
|
|
float percentW = 0;
|
|
|
float percentH = 0;
|
|
|
- percentW = ((float)(pageBound.Width * rate) / (float)bitmap.Width);
|
|
|
- percentH = ((float)(pageBound.Height * rate) / (float)bitmap.Height);
|
|
|
+ percentW = ((float)(pageBound.Width * ratio) / (float)bitmap.Width);
|
|
|
+ percentH = ((float)(pageBound.Height * ratio) / (float)bitmap.Height);
|
|
|
zoompercent = percentH > percentW ? percentW : percentH;
|
|
|
|
|
|
newSize = new System.Drawing.Size((int)(bitmap.Width * zoompercent), (int)(bitmap.Height * zoompercent));
|
|
@@ -933,11 +1013,11 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
|
|
|
bitmap = (Bitmap)ResizeImage(bitmap, newSize);
|
|
|
|
|
|
- left = (pageBound.Width * rate - bitmap.Width) / 2;
|
|
|
- top = (pageBound.Height * rate - bitmap.Height) / 2;
|
|
|
+ left = (pageBound.Width * ratio - bitmap.Width) / 2;
|
|
|
+ top = (pageBound.Height * ratio - bitmap.Height) / 2;
|
|
|
|
|
|
- int pwidth = (int)(pageBound.Width * rate);
|
|
|
- int pheight = (int)(pageBound.Height * rate);
|
|
|
+ int pwidth = (int)(pageBound.Width * ratio);
|
|
|
+ int pheight = (int)(pageBound.Height * ratio);
|
|
|
|
|
|
Bitmap bmp = new Bitmap(pwidth, pheight);
|
|
|
Graphics g = Graphics.FromImage(bmp);
|
|
@@ -995,16 +1075,17 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
private async void PreviewModMultiple(int currentPreviewIndex)
|
|
|
{
|
|
|
MultipleInfo multipleInfo = (MultipleInfo)this.printSettingsInfo.printMod;
|
|
|
+
|
|
|
int pageCount = multipleInfo.HorizontalPageNumber * multipleInfo.VerticalPageNumber;
|
|
|
- printDocument.DefaultPageSettings.PaperSize = new PaperSize("CustomisePaperSize", PaperHeight * 4, PaperWidth * 4);
|
|
|
+ printDocument.DefaultPageSettings.PaperSize = new PaperSize("CustomisePaperSize", PaperWidth * 4, PaperHeight * 4);
|
|
|
Rectangle pageBound = printDocument.DefaultPageSettings.Bounds;
|
|
|
|
|
|
double ratio = 0.5;
|
|
|
double adjustRatio = 0.25;
|
|
|
|
|
|
//每个区域的大小
|
|
|
- double eachPageWidth = pageBound.Width * 1.0 / multipleInfo.HorizontalPageNumber;
|
|
|
- double eachPageHeight = pageBound.Height * 1.0 / multipleInfo.VerticalPageNumber;
|
|
|
+ double eachPageWidth = pageBound.Width * 1.0 * ratio / multipleInfo.HorizontalPageNumber;
|
|
|
+ double eachPageHeight = pageBound.Height * 1.0 * ratio / multipleInfo.VerticalPageNumber;
|
|
|
System.Drawing.Size newSize = new System.Drawing.Size(Convert.ToInt32(eachPageWidth), Convert.ToInt32(eachPageHeight));
|
|
|
|
|
|
int indexOfList = currentPreviewIndex;
|
|
@@ -1047,7 +1128,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
|
|
|
if (printSettingsInfo.IsBlackAndWhite == true)
|
|
|
{
|
|
|
- bitmapWhenDefault = ToGray(bitmapWhenDefault, 0);
|
|
|
+ bitmapWhenSuccessful = ToGray(bitmapWhenSuccessful, 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (printSettingsInfo.EnumPrintOrientation == EnumPrintOrientation.StatusLandscape)
|
|
|
+ {
|
|
|
+ bitmapWhenSuccessful.RotateFlip(RotateFlipType.Rotate270FlipNone);
|
|
|
}
|
|
|
|
|
|
if (multipleInfo.IsAutoRotate &&
|
|
@@ -1155,7 +1241,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
{
|
|
|
BookletInfo bookletInfo = (BookletInfo)printSettingsInfo.printMod;
|
|
|
|
|
|
- printDocument.DefaultPageSettings.PaperSize = new PaperSize("CustomisePaperSize", PaperHeight * 4, PaperWidth * 4);
|
|
|
+ printDocument.DefaultPageSettings.PaperSize = new PaperSize("CustomisePaperSize", PaperWidth * 4, PaperHeight * 4);
|
|
|
Rectangle pageBound = printDocument.DefaultPageSettings.Bounds;
|
|
|
double ratio = 0.5;
|
|
|
|
|
@@ -1202,7 +1288,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- Bitmap bmp = new Bitmap(pageBound.Width, pageBound.Height);
|
|
|
+ Bitmap bmp = new Bitmap(pageBound.Height, pageBound.Width);
|
|
|
if (!printDocument.DefaultPageSettings.Landscape)
|
|
|
bmp.RotateFlip(RotateFlipType.Rotate270FlipNone);
|
|
|
Graphics g = Graphics.FromImage(bmp);
|
|
@@ -1293,7 +1379,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
try
|
|
|
{
|
|
|
printerSettings.PrinterName = PrinterNameList[PrinterIndex];
|
|
|
- if (currentPrintModName == "ModBooklet")
|
|
|
+ if (CurrentPrintModName == "ModBooklet")
|
|
|
{
|
|
|
BookletInfo bookletInfo = (BookletInfo)printSettingsInfo.printMod;
|
|
|
pageSettings.Landscape = true;
|
|
@@ -1306,10 +1392,6 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
currentListIndex = 0;
|
|
|
CurrentPreviewIndex = 0;
|
|
|
printListIndex = 0;
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
await Task.Run(() =>
|
|
|
{
|
|
@@ -1333,7 +1415,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
|
|
|
private void PrintDocument_PrintPage(object sender, PrintPageEventArgs e)
|
|
|
{
|
|
|
- switch (currentPrintModName)
|
|
|
+ switch (CurrentPrintModName)
|
|
|
{
|
|
|
case "ModPoster":
|
|
|
PrintDocumentModPoster(e);
|
|
@@ -1446,7 +1528,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
{
|
|
|
|
|
|
//一张纸的页面数
|
|
|
- int h =multipleInfo.VerticalPageNumber;//行
|
|
|
+ int h = multipleInfo.VerticalPageNumber;//行
|
|
|
int v = multipleInfo.HorizontalPageNumber;//列
|
|
|
int num = h * v;
|
|
|
//纸张大小
|
|
@@ -1505,8 +1587,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
int top = 0;
|
|
|
int left = 0;
|
|
|
|
|
|
- left = (int)(new_size.Width - pagewidth) / 2;
|
|
|
- top = (int)(new_size.Height - pageheight) / 2;
|
|
|
+ left = (int)(new_size.Width - pagewidth) / 2;
|
|
|
+ top = (int)(new_size.Height - pageheight) / 2;
|
|
|
|
|
|
if (multipleInfo.EnumPageOrder == EnumPageOrder.StatusHorizontalOrder)
|
|
|
{
|
|
@@ -1560,8 +1642,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
int top = 0;
|
|
|
int left = 0;
|
|
|
|
|
|
- left = (new_size.Width - (int)pagewidth) / 2;
|
|
|
- top = (new_size.Height - (int)pageheight) / 2;
|
|
|
+ left = (new_size.Width - (int)pagewidth) / 2;
|
|
|
+ top = (new_size.Height - (int)pageheight) / 2;
|
|
|
|
|
|
if (multipleInfo.EnumPageOrder == EnumPageOrder.StatusVerticalOrder)//纵向
|
|
|
{
|
|
@@ -1655,10 +1737,10 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
int top = 0;
|
|
|
int left = 0;
|
|
|
|
|
|
- left = (new_size.Width - (int)pagewidth) / 2;
|
|
|
- top = (new_size.Height - (int)pageheight) / 2;
|
|
|
-
|
|
|
- if (bookletInfo.EnumBookletBinding == EnumBookletBinding.StatusLeft)//左装订
|
|
|
+ left = (new_size.Width - (int)pagewidth) / 2;
|
|
|
+ top = (new_size.Height - (int)pageheight) / 2;
|
|
|
+
|
|
|
+ if (bookletInfo.EnumBookletBinding == EnumBookletBinding.StatusLeft)//左装订
|
|
|
{
|
|
|
if ((int)bookletInfo.EnumBookletSubset < 2 || TargetPages.Count == 2)//仅双面打印的时候需要左右装订的方式交替打印,单面打印的时候不不需要
|
|
|
{
|
|
@@ -1704,7 +1786,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
bitmap.Dispose();
|
|
|
}
|
|
|
}
|
|
|
- int MaxPageIndex =( (document.PageCount%4==0)?(document.PageCount/4):(document.PageCount/4+1))*2;
|
|
|
+ int MaxPageIndex = ((document.PageCount % 4 == 0) ? (document.PageCount / 4) : (document.PageCount / 4 + 1)) * 2;
|
|
|
if (printListIndex + 1 < MaxPageIndex)
|
|
|
{
|
|
|
e.HasMorePages = true;
|
|
@@ -1778,12 +1860,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
private void SubscribeEvent(Model.Dialog.HomePageToolsDialogs.HomePagePrinter.PrintMod printMod)
|
|
|
{
|
|
|
this.printSettingsInfo.printMod = printMod;
|
|
|
- if (currentPrintModName == "ModMultiple")
|
|
|
+ if (CurrentPrintModName == "ModMultiple")
|
|
|
{
|
|
|
MultipleInfo multipleInfo = (MultipleInfo)this.printSettingsInfo.printMod;
|
|
|
MaxPageNumber = ((TargetPages.Count % (multipleInfo.HorizontalPageNumber * multipleInfo.VerticalPageNumber) == 0) ? (TargetPages.Count / (multipleInfo.HorizontalPageNumber * multipleInfo.VerticalPageNumber)) : (TargetPages.Count / (multipleInfo.HorizontalPageNumber * multipleInfo.VerticalPageNumber) + 1)).ToString();
|
|
|
}
|
|
|
- else if (currentPrintModName == "ModBooklet")
|
|
|
+ else if (CurrentPrintModName == "ModBooklet")
|
|
|
{
|
|
|
if (TargetPages.Count < 2)
|
|
|
{
|
|
@@ -2004,8 +2086,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
var args = e as System.Windows.Controls.Button;
|
|
|
if (args != null)
|
|
|
{
|
|
|
- currentPrintModName = args.Name;
|
|
|
- EnterSelectedMod(currentPrintModName);
|
|
|
+ CurrentPrintModName = args.Name;
|
|
|
+ EnterSelectedMod(CurrentPrintModName);
|
|
|
//TODO:
|
|
|
}
|
|
|
}
|
|
@@ -2025,7 +2107,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
{
|
|
|
if (ExistentPrintModName != "ModSize")
|
|
|
{
|
|
|
- currentPrintModName = "ModSize";
|
|
|
+ CurrentPrintModName = "ModSize";
|
|
|
NavigationParameters param = new NavigationParameters();
|
|
|
PrintModVisible = Visibility.Collapsed;
|
|
|
NavigationParameters keyValuePairs = param;
|
|
@@ -2046,11 +2128,11 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
|
|
|
{
|
|
|
currentViewer = viewer;
|
|
|
document = currentViewer.Document;
|
|
|
- if (currentPrintModName == null)
|
|
|
+ if (CurrentPrintModName == null)
|
|
|
{
|
|
|
- currentPrintModName = "ModSize";
|
|
|
+ CurrentPrintModName = "ModSize";
|
|
|
}
|
|
|
- PrintModRegion.RequestNavigate(PrintModRegionName, GetContentByPrintMod[currentPrintModName]);
|
|
|
+ PrintModRegion.RequestNavigate(PrintModRegionName, GetContentByPrintMod[CurrentPrintModName]);
|
|
|
InitPrintParams();
|
|
|
GetTargetPageIndexFromAll();
|
|
|
InitRender();
|