Table size and breaklines

5 posts, 1 answers
  1. Colben
    Colben avatar
    3 posts
    Member since:
    Jul 2016

    Posted 13 Jul Link to this post

    I am using PDF processing to generate PDF's for invoicing. I am looking to use tables to hold general information on the other but curious as to what it can handle in terms of sizing capabilities.

    My first inquiry is with setting the table to be a specific size, I noticed in documentation that there is a TableLayoutType.FixedWidth; but I couldn't seem to find anything to set the width.

    My second inquiry is about the ability to have text in one cell go to a new line and continue. For example if one cell has a very long input of strings or numbers, if it reaches a certain length or the table, it could wrap down to the next cell and continue.

    I have been looking through and using the RadPdfProcessing > Editing > Table and haven't seen much to specifically help me with this.

    Any suggestions would be appreciated.
  2. Answer
    Boyko
    Admin
    Boyko avatar
    17 posts

    Posted 15 Jul Link to this post

    Hello Colben,

    You can set a fixed width of a cell through the PreferredWidth property. When the PreferredWidth of a cell is set to exact value, if the length of the text is longest that the width of the cell, it automatically goes to a new line. Here is an example how you could achieve this:

    Table table = new Table();
     
    TableRow firstRow = table.Rows.AddTableRow();
     
    TableCell c1 = firstRow.Cells.AddTableCell();
    c1.Blocks.AddBlock().InsertText("cell11");
    c1.PreferredWidth = 100;

    As for the whole table width - if you insert the Table with RadFixedDocumentEditor its size depends on the editor's SectionProperties. If you draw the Table with FixedContentEditor its size is specified by the Size argument value in DrawTable method. Looking at the example in "Inserting Table" documentation section you will see how to constrain the Table drawing with Width 180 and Height double.PositiveInfinity

    I hope this information is helpful. If you have any other questions or concerns please do not hesitate to contact us again.

    Regards,
    Boyko
    Telerik by Progress

  3. Colben
    Colben avatar
    3 posts
    Member since:
    Jul 2016

    Posted 19 Jul in reply to Boyko Link to this post

    Hello Boyko,

        
  4. Colben
    Colben avatar
    3 posts
    Member since:
    Jul 2016

    Posted 19 Jul in reply to Colben Link to this post

    Well I unexpectedly posted without finishing.

    My concern how is how can I achieve pagebreaks while using PDFProcessing.

    I am attempting to decouple an Object to represent products with the intention of using Telerik List class to display them.

    Is it possible to use lists inside of a table?
    Will it be possible to use page breaks within a list/table, or does the whole table have to be represented within another page?


    I am sure there is a straightforward method but I cant seem to find it.


    On a side note, would it be more realistic to use something like the Word Processing then convert/export as a PDF?


  5. Boyko
    Admin
    Boyko avatar
    17 posts

    Posted 22 Jul Link to this post

    Hi Colben,

    It is possible to insert a list into a table cell. There is no difference between inserting a list into a table cell or anywhere in the document. You could insert the list as a block. Here is the documentation article how you could insert the lists.

    We have demos in our feedback portal which shows how tables could be split. It depends on the type of the editor you use for the document. If you use RadFixedDocumentEditor just insert a page break. If using the FixedContentEditor you could decide how to split the document.

    Regards,
    Boyko
    Telerik by Progress

Back to Top