Drag the size handle in the lower-right corner of the table To change the size of a selected table, use one of the following tricks:ġ. Or right-click on the selected columns, and then click Distribute Columns Evenly. Click Distribute Columns in the Cell Size group.Select columns (or click anywhere in the table to distribute all columns).To distribute the width of the columns equally between them: Distribute Columns Evenly Or right-click on the selected rows, and then click Distribute Rows Evenly. Click Distribute Rows in the Cell Size group.Select rows (or click anywhere in the table for all rows). If rows are of different heights, follow these steps to distribute the height of the rows equally between them: Distribute Rows Evenly This option makes the column widths fixed unless you explicitly change them by dragging the mouse, or by using the Table Properties dialog box etc. If you add large data to a column, that column will automatically resize, making the other columns correspondingly narrower. The table and columns automatically adjust their size (width) when you add or remove data from the table.Ĭhoose this option to create a full width table that is divided into columns of equal width. The AutoFit menu has three options:Ĭhoose this option to fit all columns in a table to their contents. To apply AutoFit settings, click anywhere in the table, and then on the Layout contextual tab, in the Cell Size group, click AutoFit drop-down menu. The AutoFit settings enable you to size the table and its columns automatically. I might be missing something, but I think I am already doing this as shown in my code sample.AutoFit to automatically resize columns AutoFit Settings Please refer the UG documentation to know how to set the AutoFit Option for the table. You can resize the table to fit the contents respect to the given contents using AutoFit Option. I guess once the column widths can be set based on content, the problem will go away as the table will no longer be the full width of the page. There doesn't seem to be an IndentFromRight function, and the Width setting is read-only - so I am not sure whether it is possible to make the table narrower. So, simply not indenting the table (which is what I think you are suggesting) will not produce the desired result. I can see what is happening here but, in my example output, you will see that I have indented the table from the left so it aligns with the other text, and doesn't "obscure" the list of heading numbers. To fit the table in the given margin, we suggest you skip to set the IndentFromLeft value for the table. We set the IndentFromLeft value for the table, so table moves towards the right. Regarding table format doesn't seem to be respecting the right margin I hope that all makes sense - and look forward to hearing what stupid mistake I have made! Closes the instance of PDF document object. Release the resources used by the Word document and DocIO Renderer objects.įileStream outputStream = new FileMode.Create, FileAccess.Write) PdfDocument pdfDocument = render.ConvertToPDF(document) Then, finally, the PDF is created: //Create instance for DocIORenderer for Word to PDF conversionĭocIORenderer render = new DocIORenderer() Section.AddParagraph() // To get space after the table TODO find a better way Table.AutoFit(AutoFitType.FitToContent) // TODO Why is this not working? = currentRow = 0 // make the first row bold Var newText = thisCell.AddParagraph().AppendText(column) Var thisRow = table.AddRow(false, false) Table.IndentFromLeft = standardIndent // THOUGHT - IS THIS PUSHING THE TABLE RIGHT? Paragraph.ApplyStyle(BuiltinStyle.BodyText) Applies built-in style and the standard indent for the paragraph Paragraphs are added like this: public void AddParagraph(string text) Var headStyle = (Style)Style.CreateBuiltinStyle(BuiltinStyle.Heading1, document) Var bodyStyle = (Style)Style.CreateBuiltinStyle(BuiltinStyle.BodyText, document) ī = Color.Black ī = standardFont ī = standardFontSize Then in the class constructor, I initialise the document: // Assign the licence I declare some member variables: private WordDocument document I have a single C# class which drives the process. I don't have an input document, I am creating it from the ground up. Thanks for the response, and my apologies for the delay in my reply.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |