This is a migrated thread and some comments may be shown as answers.

TableCell not honoring CanWrapContent

1 Answer 222 Views
PdfProcessing
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 16 May 2019, 03:30 PM

First cell of table should not allow wrapping but always does. Does it have anything to do with the fact that I'm using a flow document instead of fixed? There seems to be very little documentation or samples of flow documents.

 

public void Mvce()
{
    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;
 
    //AddBlock() not available??? Its in the documentation:
    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");
}

 

1 Answer, 1 is accepted

Sort by
0
Tanya
Telerik team
answered on 17 May 2019, 01:49 PM
Hi Robert,

The CanWrapContent property is currently supported when exporting to DOCX and RTF. The PdfFormatProvider class doesn't provide this functionality and we have logged in our backlog: WordsProcessing: Add support for TableCell.CanWrapContent property when exporting RadFlowDocument to Pdf. Please, make sure to cast your vote for the implementation of the task as this directly increases its priority. If you would like to receive notifications about status updates, you can subscribe to the item using the Follow button.

Regards,
Tanya
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
PdfProcessing
Asked by
Robert
Top achievements
Rank 1
Answers by
Tanya
Telerik team
Share this question
or