如何为桌子设置圆角?我使用的是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");发布于 2014-12-09 19:43:25
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
发布于 2020-01-07 20:22:43
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;
}https://stackoverflow.com/questions/24578421
复制相似问题