using System; using System.Collections.Generic; using System.Drawing.Printing; using System.Linq; using System.Numerics; using System.Printing; using System.Runtime.Remoting.Channels; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using static PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter.HomePagePrinterDialogModel; namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter { public class PrintSettingsInfo { /// /// 灰度 /// public bool IsGrayscale { get; set; } /// /// 纸张尺寸 /// public PageMediaSize PageMediaSize; /// /// 页码范围 /// public int EnumPageRange = 0; /// /// 逆页序 /// public bool IsIndexReverse { get; set; } /// /// 双面打印 /// public bool IsDuplex = false; /// /// 是否打印页面边框 /// public bool IsPrintPageBorde = false; /// /// 打印方向 /// public EnumPrintOrientation EnumPrintOrientation = EnumPrintOrientation.StatusPortrait; /// /// 带Annot /// public bool IsPrintWithAnnot = true; /// /// 带Form /// public bool IsPrintWithForm = true; /// /// Copies /// public int Copies { get; set; } /// /// 打印机名称 /// public string PrinterName { get; set; } /// /// 自定义打印页码范围 /// public List PageRangeList = new List(); /// /// 打印Mod /// public PrintModInfo PrintModInfo = new SizeInfo(); /// /// Document对象,用于打印 /// public PrintDocument PrintDocument = new PrintDocument(); /// /// 是否双面打印 /// public bool IsBothSides = false; /// /// 边距 /// public List Margin = new List(); /// /// 需要重新渲染? /// public bool needRerendering = true; /// /// 解决一直获取纸张信息引发卡顿的问题 /// public bool IsPaperSizeChanged = false; public PrintSettingsInfo() { PrintDocument.DefaultPageSettings.Landscape = false; } } public class HomePagePrinterDialogModel { } public enum EnumSizeType { StatusAdaptive, StatusActural, StatusCustomized, } /// /// 双面打印阶段 /// public enum EnumBothSidesStage { StatusNone, StatusFrontSide, StatusBackSide } public enum EnumPageRangeWithoutCurrentPage { StatusAllRange, StatusOddRange, StatusEvenRange, StatusCustomizedRange, } public enum EnumPageRangeWithCurrentPage { StatusAllRange, StatusCurrentPage, StatusOddRange, StatusEvenRange, StatusCustomizedRange, } public enum EnumPrintOrientation { StatusPortrait, StatusLandscape } public enum EnumPrintContent { StatusOnlyDocument, StatusDocumentAndMarkUps, StatusDocumentAndStamps, StatusDocumentAndForm } public enum EnumPrintMod { StatusSize, StatusPoster, StatusMultiple, StatusBooklet } public enum EnumPosterMod { StatusTile, StatusSplit } public enum EnumDisplayPageNumber { StatusTwo, StatusFour, StatusSix, StatusNine, StatusSixteen, StatusCustomized } public enum EnumPageOrder { StatusHorizontalOrder, StatusHorizontalReverseOrder, StatusVerticalOrder, StatusVerticalReverseOrder, } public enum EnumBookletSubset { StatusBothSides, StatusFrontSideOnly, StatusBackSideOnly } public enum EnumBookletBinding { StatusLeft, StatusRight } public enum EnumDuplexPrintMod { StatusNone, StatusFlipLongEdge, StatusFlipShortEdge } public class PrintModInfo { public EnumPrintMod EnumPrintMod = EnumPrintMod.StatusSize; /// /// 双面打印 /// public EnumDuplexPrintMod EnumDuplexPrintMod = EnumDuplexPrintMod.StatusNone; } public class SizeInfo : PrintModInfo { public EnumSizeType EnumSizeType = EnumSizeType.StatusAdaptive; public int DisplayRatio = 100; } public class PosterInfo : PrintModInfo { public EnumPosterMod EnumPosterMod; public bool HasCutMarks { get; set; } public bool HasLabel { get; set; } public double OverLap { get; set; } public EnumDisplayPageNumber EnumDisplayPageNumber { get; set; } public int HorizontalSheetNumber = 2; public int VerticalSheetNumber = 2; public int TileRatio { get; set; } public string Label; } public class MultipleInfo : PrintModInfo { public EnumPageOrder EnumPageOrder = EnumPageOrder.StatusHorizontalOrder; public EnumDisplayPageNumber EnumDisplayPageNumber = EnumDisplayPageNumber.StatusTwo; public int HorizontalPageNumber = 2; public int VerticalPageNumber = 1; public bool IsAutoRotate = false; } public class BookletInfo : PrintModInfo { public EnumBookletSubset EnumBookletSubset = EnumBookletSubset.StatusBothSides; public EnumBookletBinding EnumBookletBinding = EnumBookletBinding.StatusLeft; public int BeginPaperIndex = 1; public int EndPaperIndex = 1; public bool IsAutoRotate = false; } }