0
我有一個頁腳在每個頁面的左側和右側。頁腳中的每個段落都包含2行文字。我想要的是在頁腳的兩行文字之間添加一條水平線。Migra Doc PDF頁腳樣式
這裏是添加頁腳的代碼。
private void AddFooterData(Section section) {
// add prepared by. approved by etc
var rightFooterSection = new Paragraph {
Format = { Alignment = ParagraphAlignment.Right }
};
rightFooterSection.AddText("Prepared By Eng: " + _preparedBy);
rightFooterSection.AddLineBreak();
rightFooterSection.AddText("Page ");
rightFooterSection.AddPageField();
rightFooterSection.AddText("/");
rightFooterSection.AddNumPagesField();
section.Footers.Primary.Add(rightFooterSection);
var date = DateTime.Now.ToString("yyyy/MM/dd");
var leftSection = new Paragraph {
Format = { Alignment = ParagraphAlignment.Left }
};
leftSection.AddText("Approved By: " + _approvedBy);
leftSection.AddLineBreak();
leftSection.AddText(date);
section.Footers.Primary.Add(leftSection);
}
這裏是所需頁腳結果的圖片。