CPDFAnnotationData.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using ComPDFKit.PDFAnnotation;
  2. using compdfkit_tools.PDFControl;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows.Media;
  9. namespace compdfkit_tools.Data
  10. {
  11. public enum AnnotationType
  12. {
  13. None = 0,
  14. Highlight,
  15. Underline,
  16. Strikeout,
  17. Squiggly,
  18. Freetext,
  19. Note,
  20. Circle,
  21. Square,
  22. Arrow,
  23. Line,
  24. Stamp,
  25. Signature,
  26. Link,
  27. Sound
  28. }
  29. public static class CPDFAnnotationDictionary
  30. {
  31. public static Dictionary<string, AnnotationType> GetAnnotationFromTag = new Dictionary<string, AnnotationType>() {
  32. { "Highlight", AnnotationType.Highlight },
  33. { "Underline", AnnotationType.Underline },
  34. { "Strikeout", AnnotationType.Strikeout },
  35. { "Squiggly", AnnotationType.Squiggly },
  36. { "Square", AnnotationType.Square },
  37. { "Circle", AnnotationType.Circle },
  38. { "Line", AnnotationType.Line },
  39. { "Arrow", AnnotationType.Arrow }
  40. };
  41. }
  42. public abstract class CPDFAnnotationData
  43. {
  44. public AnnotationType AnnotationProperties;
  45. public string Note = string.Empty;
  46. public string Author = "ComPDFKit";
  47. public bool IsLocked = false;
  48. }
  49. public class CPDFMarkupData : CPDFAnnotationData
  50. {
  51. public double Opacity = 1;
  52. public Color Color = Color.FromRgb(255, 0, 0);
  53. }
  54. public class CPDFShapeData : CPDFAnnotationData
  55. {
  56. public Color BorderColor = Color.FromRgb(255, 0, 0);
  57. public Color FillColor = Color.FromRgb(255, 255, 255);
  58. public double Opacity = 1;
  59. public double Thickness = 1;
  60. public int DashSpacing = 1;
  61. }
  62. public class CPDFLineShapeData : CPDFAnnotationData
  63. {
  64. public Color BorderColor = Color.FromRgb(255, 0, 0);
  65. public C_LINE_TYPE HeadLineType = C_LINE_TYPE.LINETYPE_NONE;
  66. public C_LINE_TYPE TailLineType = C_LINE_TYPE.LINETYPE_NONE;
  67. public double Opacity = 1;
  68. public double Thickness = 1;
  69. public int DashSpacing = 1;
  70. }
  71. }