xceedsoftware / DocX

Fast and easy to use .NET library that creates or modifies Microsoft Word files without installing Word.
Other
1.72k stars 468 forks source link

Table Width and Reverse Engineering documents? #258

Open wolfgangjt opened 5 years ago

wolfgangjt commented 5 years ago

I have looked through the entire code and cannot find out how to set the table's overall width, not the column width. It limits the table based off the margins, but I am needing it to extend past the margins. Is there an easy way?

Also, I am trying to recreate an existing document to allow for sections to be dynamically added, so I have the originating DOCX file. I can open it in ZIP and rip the XML code out, is there a way to reverse engineer this easily so I can just plug and play the sections throughout my code when necessary?

Lastly, is anyone even maintaining this/watching the forums? Seems like its dead.

ronaldhoek commented 5 years ago

First, normally this is not a support forum (on GitHub), but an issue list. So normaly only new features and/or bugs are reported here...

However, use questions seem to be answered here anyway.

Maybe you can take a look at this issues comment https://github.com/xceedsoftware/DocX/issues/246 and see if you can use some of the code listed there as a pointer on how to set the correct table width. I have not tried it myself though...

XceedBoucherS commented 5 years ago

Hi,

1) Table Width

To set the table width, you can:

-Use the SetColumnWidth method to set the column widths: t.SetColumnWidth( 0, 300 ); t.SetColumnWidth( 1, 400 );

-Set the Width percentage of each column based on a specific table width: t.SetWidthsPercentage( new float[] { 60, 40 }, document.PageWidth );

Unfortunately, all these methods have been reviewed for v1.6 and may not give the expected when using an older version(v1.5 and before).

2) Sections If you are talking about docx sections of a document, no. You will have to fill the document.Sections property, which have been improved in v1.5.

3) Update on GitHub

Yes this site is reviewed occasionally. Keep in mind that "DocX" is the free version of "Xceed Words for .NET". Users of the commercial version have more features, always the latest version and a 24 hours support. On GitHub, "DocX" will have less feature, always at least 3 versions behind and longer support.

You can always try the latest version( v1.5 ) of "Xceed Words for .NET" here : https://xceed.com/xceed-words-for-net/

Thank you.