为什么用于PDF处理的Telerik UI TableCell不支持CanWrapContent?

时间:2019-05-16 15:46:39

标签: c# telerik pdf-generation

CanWrapContent未被兑现。当我将CanWrapContent设置为false时,不应包装内容为“ ClientName:”的第一列。

我正在使用Telerik UI R1 2019

生成的PDF屏幕截图:

enter image description here

public void Mcve()
{
    Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider provider = new Telerik.Windows.Documents.Flow.FormatProviders.Pdf.PdfFormatProvider();

    RadFlowDocument document = new RadFlowDocument();
    RadFlowDocumentEditor editor = new RadFlowDocumentEditor(document);

    Table t = editor.InsertTable();

    TableCell cell0 = new TableCell(document);            
    cell0.CanWrapContent = false; // <------------ Ignored?
    cell0.Blocks.AddParagraph().Inlines.AddRun("ClientName:");

    TableCell cellLong = new TableCell(document);
    cellLong.Blocks.AddParagraph().Inlines.AddRun("Nullam sit amet dui porta, imperdiet quam sit amet, consequat diam. In vel orci rutrum, vehicula purus ullamcorper, ornare lorem. Sed at arcu ultrices, fringilla augue in, condimentum quam. Sed pretium faucibus");

    var row = t.Rows.AddTableRow();
    row.Cells.Add(cell0);
    row.Cells.Add(cellLong);

    using (Stream output = File.OpenWrite("sample.pdf"))
    {
        provider.Export(document, output);
    }
    Process.Start("sample.pdf");
}