TextEditParam.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using ComPDFKit.PDFPage;
  2. using ComPDFKit.PDFPage.Edit;
  3. namespace ComPDFKit.Tool
  4. {
  5. public class TextEditParam:PDFEditParam
  6. {
  7. public TextEditParam()
  8. {
  9. EditType = CPDFEditType.EditText;
  10. }
  11. public double FontSize { get; set; }
  12. public byte[] FontColor { get; set; }
  13. public TextAlignType TextAlign { get; set; }
  14. public string FontName { get; set; } = string.Empty;
  15. public bool IsItalic { get; set; }
  16. public bool IsBold { get; set; }
  17. public override bool CopyTo(PDFEditParam transfer)
  18. {
  19. TextEditParam texteditTransfer = transfer as TextEditParam;
  20. if (texteditTransfer == null)
  21. {
  22. return false;
  23. }
  24. if (!base.CopyTo(texteditTransfer))
  25. {
  26. return false;
  27. }
  28. texteditTransfer.FontSize = FontSize;
  29. if (FontColor != null)
  30. {
  31. texteditTransfer.FontColor = (byte[])FontColor.Clone();
  32. }
  33. texteditTransfer.TextAlign = TextAlign;
  34. texteditTransfer.FontName = FontName;
  35. texteditTransfer.IsItalic = IsItalic;
  36. texteditTransfer.IsBold = IsBold;
  37. return true;
  38. }
  39. }
  40. }