LineMeasureParam.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using ComPDFKit.Import;
  2. using ComPDFKit.Measure;
  3. using ComPDFKit.PDFAnnotation;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Media;
  10. namespace ComPDFKit.Tool
  11. {
  12. public class LineMeasureParam : AnnotParam
  13. {
  14. public LineMeasureParam()
  15. {
  16. CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_LINE;
  17. }
  18. public byte[] LineColor { get; set; }
  19. public float LineWidth { get; set; }
  20. public float[] LineDash { get; set; }
  21. public CPoint HeadPoint { get; set; }
  22. public CPoint TailPoint { get; set; }
  23. public C_LINE_TYPE HeadLineType { get; set; }
  24. public C_LINE_TYPE TailLineType { get; set; }
  25. public string FontName { get; set; }
  26. public double FontSize { get; set; }
  27. public byte[] FontColor { get; set; }
  28. public bool IsBold { get; set; }
  29. public bool IsItalic { get; set; }
  30. public C_BORDER_STYLE BorderStyle { get; set; }
  31. public CPDFMeasureInfo measureInfo { get; set; }
  32. public double LeadLength { get; set; }
  33. public double LeadExtension { get; set; }
  34. public double LeadOffset { get; set; }
  35. public override bool CopyTo(AnnotParam transfer)
  36. {
  37. LineMeasureParam lineTransfer = transfer as LineMeasureParam;
  38. if (lineTransfer == null)
  39. {
  40. return false;
  41. }
  42. if (!base.CopyTo(lineTransfer))
  43. {
  44. return false;
  45. }
  46. if (LineColor != null)
  47. {
  48. lineTransfer.LineColor = (byte[])LineColor.Clone();
  49. }
  50. if (LineDash != null)
  51. {
  52. lineTransfer.LineDash = (float[])LineDash.Clone();
  53. }
  54. if (FontColor != null)
  55. {
  56. lineTransfer.FontColor = (byte[])FontColor.Clone();
  57. }
  58. if (measureInfo != null)
  59. {
  60. CPDFMeasureInfo cPDFMeasureInfo = new CPDFMeasureInfo()
  61. {
  62. Factor = measureInfo.Factor,
  63. Unit = measureInfo.Unit,
  64. DecimalSymbol = measureInfo.DecimalSymbol,
  65. ThousandSymbol = measureInfo.ThousandSymbol,
  66. Display = measureInfo.Display,
  67. Precision = measureInfo.Precision,
  68. UnitPrefix = measureInfo.UnitPrefix,
  69. UnitSuffix = measureInfo.UnitSuffix,
  70. UnitPosition = measureInfo.UnitPosition,
  71. RulerBase = measureInfo.RulerBase,
  72. RulerBaseUnit = measureInfo.RulerBaseUnit,
  73. RulerTranslateUnit = measureInfo.RulerTranslateUnit,
  74. RulerTranslate= measureInfo.RulerTranslate,
  75. CaptionType = measureInfo.CaptionType,
  76. };
  77. lineTransfer.measureInfo = cPDFMeasureInfo;
  78. }
  79. lineTransfer.LineWidth = LineWidth;
  80. lineTransfer.HeadLineType = HeadLineType;
  81. lineTransfer.TailLineType = TailLineType;
  82. lineTransfer.FontName = FontName;
  83. lineTransfer.FontSize = FontSize;
  84. lineTransfer.IsBold = IsBold;
  85. lineTransfer.IsItalic = IsItalic;
  86. lineTransfer.HeadPoint = HeadPoint;
  87. lineTransfer.TailPoint = TailPoint;
  88. lineTransfer.BorderStyle = BorderStyle;
  89. lineTransfer.LeadExtension=LeadExtension;
  90. lineTransfer.LeadLength = LeadLength;
  91. lineTransfer.LeadOffset = LeadOffset;
  92. return true;
  93. }
  94. }
  95. }