WatermarkTemplateList.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Security.Permissions;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows.Input;
  8. namespace PDFSettings
  9. {
  10. public class WatermarkTemplateList : List<WatermarkItem>
  11. {
  12. }
  13. public enum EnumPageRangeIndex
  14. {
  15. StatusOne = 0,
  16. StatusTwo,
  17. StatusThree,
  18. StatusFour,
  19. }
  20. public class WatermarkItem : EventArgs
  21. {
  22. /// <summary>
  23. /// 模板名称
  24. /// </summary>
  25. public string templateName = "Watermark";
  26. /// <summary>
  27. /// 水印类型
  28. /// </summary>
  29. public ComPDFKit.PDFWatermark.C_Watermark_Type type = ComPDFKit.PDFWatermark.C_Watermark_Type.WATERMARK_TYPE_TEXT;
  30. public int listIndex = 0;
  31. /// <summary>
  32. /// 字体名字
  33. /// </summary>
  34. public string fontName = "Helvetica";
  35. /// <summary>
  36. /// 字体大小
  37. /// </summary>
  38. public float fontSize = 48;
  39. /// <summary>
  40. /// 字体大小
  41. /// </summary>
  42. public float imageSize = 1;
  43. /// <summary>
  44. /// 页码范围
  45. /// </summary>
  46. public string pageRange;
  47. /// <summary>
  48. /// 水印页面范围索引;
  49. /// 0:全部页面
  50. /// 1:奇数页
  51. /// 2;偶数页
  52. /// 3:自定义页
  53. /// </summary>
  54. public int pageRangeIndex = 0;
  55. /// <summary>
  56. /// 水平位置
  57. /// </summary>
  58. public ComPDFKit.PDFWatermark.C_Watermark_Horizalign horizalign = ComPDFKit.PDFWatermark.C_Watermark_Horizalign.WATERMARK_HORIZALIGN_CENTER;
  59. /// <summary>
  60. /// 水平偏移量
  61. /// </summary>
  62. public float horizOffset = 0;
  63. /// <summary>
  64. /// 预览缓存路径
  65. /// </summary>
  66. public string previewImagePath = "";
  67. /// <summary>
  68. /// 图片数据缓存
  69. /// </summary>
  70. public byte[] imageArray = null;
  71. /// <summary>
  72. /// 图片数据缓存路径
  73. /// </summary>
  74. public string imagepath = "";
  75. /// <summary>
  76. /// 图片宽
  77. /// </summary>
  78. public int imageWidth;
  79. /// <summary>
  80. /// 图片高
  81. /// </summary>
  82. public int imageHeight;
  83. /// <summary>
  84. /// 透明度 0-255
  85. /// </summary>
  86. public byte opacity = 230;
  87. /// <summary>
  88. /// 旋转角度
  89. /// </summary>
  90. public float rotation = 0;
  91. /// <summary>
  92. /// 图片缩放比例
  93. /// </summary>
  94. public float scale = 1;
  95. /// <summary>
  96. /// 水印内容
  97. /// </summary>
  98. public string text = "Watermark";
  99. /// <summary>
  100. /// 本文颜色
  101. /// </summary>
  102. public byte[] textcolor = new byte[] { 255, 0, 0 };
  103. /// <summary>
  104. /// 垂直位置
  105. /// </summary>
  106. public ComPDFKit.PDFWatermark.C_Watermark_Vertalign vertalign = ComPDFKit.PDFWatermark.C_Watermark_Vertalign.WATERMARK_VERTALIGN_CENTER;
  107. /// <summary>
  108. /// 垂直偏移量
  109. /// </summary>
  110. public float vertOffset = 0;
  111. /// <summary>
  112. /// 是否平铺
  113. /// </summary>
  114. public bool isFullScreen = false;
  115. /// <summary>
  116. /// 水平间距
  117. /// </summary>
  118. public float horizontalSpacing = (float)(10 * Helpers.Dpi / 25.4);
  119. /// <summary>
  120. /// 垂直间距
  121. /// </summary>
  122. public float verticalSpacing = (float)(20 * Helpers.Dpi / 25.4);
  123. /// <summary>
  124. /// 水印是否在前
  125. /// </summary>
  126. public bool isfront = true;
  127. /// <summary>
  128. /// 页面选择的范围 ALL ODD EVEN 1-5(传入用户输入的字符串)
  129. /// </summary>
  130. public string pageangeMode = "ALL";
  131. /// <summary>
  132. /// 水印是否自适应比例;
  133. /// </summary>
  134. public bool isRelativeScale = false;
  135. }
  136. }