// จัดเตรียมเอกสารที่จะเพิ่มตรา
using (Signature signature = new Signature("input.docx"))
{
// เริ่มต้นตัวเลือกตราด้วยการตั้งค่าที่ต้องการ
StampSignOptions options = new StampSignOptions()
{
// กำหนดขนาดและตำแหน่งของตราบนหน้า
Height = 200,
Width = 200,
VerticalAlignment = VerticalAlignment.Bottom,
HorizontalAlignment = HorizontalAlignment.Right,
AllPages = true
};
// เพิ่มเส้นวงกลมด้านนอกพร้อมข้อความ
options.OuterLines.Add(
new StampLine()
{
Text = "* The best choice *",
TextRepeatType = StampTextRepeatType.FullTextRepeat,
Font = new SignatureFont() { Size = 12, FamilyName = "Arial" },
Height = 22,
TextBottomIntent = 6,
TextColor = Color.WhiteSmoke,
BackgroundColor = Color.DarkSlateBlue
}
);
// รวมเส้นสี่เหลี่ยมด้านในหากจำเป็น
options.InnerLines.Add(
new StampLine()
{
Text = "Company #1",
TextColor = Color.MediumVioletRed,
Font = new SignatureFont() { Size = 20, Bold = true },
Height = 40
}
);
// เสร็จสิ้นและบันทึกเอกสารที่มีตรา
SignResult result = signature.Sign("output.docx", options);
}