123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- 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
- {
- /// <summary>
- /// 灰度
- /// </summary>
- public bool IsGrayscale { get; set; }
- /// <summary>
- /// 纸张尺寸
- /// </summary>
- public PageMediaSize PageMediaSize;
- /// <summary>
- /// 页码范围
- /// </summary>
- public int EnumPageRange = 0;
- /// <summary>
- /// 逆页序
- /// </summary>
- public bool IsIndexReverse { get; set; }
- /// <summary>
- /// 双面打印
- /// </summary>
- public bool IsDuplex = false;
- /// <summary>
- /// 是否打印页面边框
- /// </summary>
- public bool IsPrintPageBorde = false;
- /// <summary>
- /// 打印方向
- /// </summary>
- public EnumPrintOrientation EnumPrintOrientation = EnumPrintOrientation.StatusPortrait;
- /// <summary>
- /// 带Annot
- /// </summary>
- public bool IsPrintWithAnnot = true;
- /// <summary>
- /// 带Form
- /// </summary>
- public bool IsPrintWithForm = true;
- /// <summary>
- /// Copies
- /// </summary>
- public int Copies { get; set; }
- /// <summary>
- /// 打印机名称
- /// </summary>
- public string PrinterName { get; set; }
- /// <summary>
- /// 自定义打印页码范围
- /// </summary>
- public List<int> PageRangeList = new List<int>();
- /// <summary>
- /// 打印Mod
- /// </summary>
- public PrintModInfo PrintModInfo = new SizeInfo();
- /// <summary>
- /// Document对象,用于打印
- /// </summary>
- public PrintDocument PrintDocument = new PrintDocument();
- /// <summary>
- /// 是否双面打印
- /// </summary>
- public bool IsBothSides = false;
- /// <summary>
- /// 边距
- /// </summary>
- public List<int> Margin = new List<int>();
- /// <summary>
- /// 需要重新渲染?
- /// </summary>
- public bool needRerendering = true;
- /// <summary>
- /// 解决一直获取纸张信息引发卡顿的问题
- /// </summary>
- public bool IsPaperSizeChanged = false;
- public PrintSettingsInfo()
- {
- PrintDocument.DefaultPageSettings.Landscape = false;
- }
- }
- public class HomePagePrinterDialogModel
- {
- }
- public enum EnumSizeType
- {
- StatusAdaptive,
- StatusActural,
- StatusCustomized,
- }
- /// <summary>
- /// 双面打印阶段
- /// </summary>
- 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;
- /// <summary>
- /// 双面打印
- /// </summary>
- 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;
- }
- }
|