BackgroundTemplateList.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.CompilerServices;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace PDFSettings
  8. {
  9. public class BackgroundTemplateList : List<BackgroundItem>
  10. {
  11. }
  12. public class BackgroundItem : EventArgs
  13. {
  14. /// <summary>
  15. /// 模板名称
  16. /// </summary>
  17. public string templateName = "Background";
  18. /// <summary>
  19. /// 文档背景类型
  20. /// </summary>
  21. public ComPDFKit.PDFDocument.C_Background_Type type = ComPDFKit.PDFDocument.C_Background_Type.BG_TYPE_COLOR;
  22. public int listIndex = 0;
  23. /// <summary>
  24. /// 背景颜色
  25. /// </summary>
  26. public byte[] bgColor = new byte[] { 255, 0, 0 };
  27. /// <summary>
  28. /// 页码范围
  29. /// </summary>
  30. public string pageRange;
  31. /// <summary>
  32. /// 水平位置
  33. /// </summary>
  34. public ComPDFKit.PDFDocument.C_Background_Horizalign horizalign = ComPDFKit.PDFDocument.C_Background_Horizalign.BG_HORIZALIGN_CENTER;
  35. /// <summary>
  36. /// 水平偏移量
  37. /// </summary>
  38. public float horizOffset = 0;
  39. /// <summary>
  40. /// 图片水印内容
  41. /// </summary>
  42. public byte[] imageArray = null;
  43. /// <summary>
  44. /// 预览缓存路径
  45. /// </summary>
  46. public string previewImagePath = "";
  47. /// <summary>
  48. /// 图片数据缓存路径
  49. /// </summary>
  50. public string imagepath = "";
  51. /// <summary>
  52. /// 图片宽
  53. /// </summary>
  54. public int imageWidth;
  55. /// <summary>
  56. /// 图片高
  57. /// </summary>
  58. public int imageHeight;
  59. /// <summary>
  60. /// 透明度 0-255
  61. /// </summary>
  62. public byte opacity = 230;
  63. /// <summary>
  64. /// 旋转角度
  65. /// </summary>
  66. public float rotation = 0;
  67. /// <summary>
  68. /// 图片缩放比例
  69. /// </summary>
  70. public float scale = 1;
  71. /// <summary>
  72. /// 垂直位置
  73. /// </summary>
  74. public ComPDFKit.PDFDocument.C_Background_Vertalign vertalign = ComPDFKit.PDFDocument.C_Background_Vertalign.BG_VERTALIGN_CENTER;
  75. /// <summary>
  76. /// 垂直偏移量
  77. /// </summary>
  78. public float vertOffset = 0;
  79. /// <summary>
  80. /// 水平间距
  81. /// </summary>
  82. public float horizontalSpacing = (float)(10 * Helpers.Dpi / 25.4);
  83. /// <summary>
  84. /// 垂直间距
  85. /// </summary>
  86. public float verticalSpacing = (float)(20 * Helpers.Dpi / 25.4);
  87. /// <summary>
  88. /// 能否打印
  89. /// </summary>
  90. public bool isCanPrint = true;
  91. public bool isCanView = true;
  92. /// <summary>
  93. /// 页面范围索引;
  94. /// 0:全部页面
  95. /// 1:奇数页
  96. /// 2;偶数页
  97. /// 3:自定义页
  98. /// </summary>
  99. public int PageRangeIndex = 0;
  100. public bool isRelativeScale = true;
  101. }
  102. }