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

Table size and breaklines

4 Answers 922 Views
PdfProcessing
This is a migrated thread and some comments may be shown as answers.
Colben
Top achievements
Rank 1
Colben asked on 13 Jul 2016, 08:12 PM
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.

4 Answers, 1 is accepted

Sort by
0
Accepted
Boyko
Telerik team
answered on 15 Jul 2016, 02:29 PM
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

0
Colben
Top achievements
Rank 1
answered on 19 Jul 2016, 03:30 PM
Hello Boyko,

    
0
Colben
Top achievements
Rank 1
answered on 19 Jul 2016, 03:35 PM

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?


0
Boyko
Telerik team
answered on 22 Jul 2016, 01:56 PM
Hi ,

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

Tags
PdfProcessing
Asked by
Colben
Top achievements
Rank 1
Answers by
Boyko
Telerik team
Colben
Top achievements
Rank 1
Share this question
or