如何摆放桌子的圆角?我正在使用c#和migradoc
MigraDoc.DocumentObjectModel.Tables.Table myTable = section.AddTable();
myTable.Borders.Visible = true;
MigraDoc.DocumentObjectModel.Tables.Column myColumn = myTable.AddColumn();
MigraDoc.DocumentObjectModel.Tables.Row myRow = myTable.AddRow();
myRow[0].AddParagraph("Some text");
答案 0 :(得分:1)
PdfSharp可以做到。不确定MigraDoc。
http://www.nudoq.org/#!/Packages/PDFsharp-MigraDoc-GDI/PdfSharp/XGraphicsPath/M/AddRoundedRectangle
http://www.nudoq.org/#!/Packages/PDFsharp-MigraDoc-GDI/PdfSharp/XGraphics/M/DrawRoundedRectangle
答案 1 :(得分:1)
MigraDoc表单元格具有RoundedCorner
属性。
我现在没有时间创建功能齐全的示例,但是AIUI必须在顶部和底部添加虚拟行以及在左侧和右侧添加虚拟列以为圆角留出空间。您必须设置单元格阴影才能看到圆角的效果。而且很可能这些圆角仅适用于PDF,不适用于RTF。
显示如何使用属性的代码段:
public static void SetRoundedCorners(Table table)
{
int rowCount = table.Rows.Count;
int colCount = table.Columns.Count;
if (rowCount < 2 || colCount < 2)
return;
table.Rows[0].Cells[0].RoundedCorner = RoundedCorner.TopLeft;
table.Rows[0].Cells[colCount - 1].RoundedCorner = RoundedCorner.TopRight;
table.Rows[rowCount - 1].Cells[colCount - 1].RoundedCorner = RoundedCorner.BottomRight;
table.Rows[rowCount - 1].Cells[0].RoundedCorner = RoundedCorner.BottomLeft;
}