TextEditParam.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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 || !base.CopyTo(texteditTransfer))
  21. return false;
  22. texteditTransfer.FontSize = FontSize;
  23. if (FontColor != null)
  24. texteditTransfer.FontColor = (byte[])FontColor.Clone();
  25. texteditTransfer.TextAlign = TextAlign;
  26. texteditTransfer.FontName = FontName;
  27. texteditTransfer.IsItalic = IsItalic;
  28. texteditTransfer.IsBold = IsBold;
  29. return true;
  30. }
  31. }
  32. }