This patch adds the ability to access the text of Endnotes and Footnotes defined within a document, otherwise hidden behind an internal XDocument field.
Reason: I was attempting to replicate the functionality of the Interop word-count facility: Document.ComputeStatistics(WdStatistic.wdStatisticWords) which takes IncludeFootnotesAndEndnotes as a boolean parameter. The DocX.Text property does not include endnotes or footnotes (which is fine), but I needed the extra properties to be able to access them when IncludeFootnotesAndEndnotes is true.
Patch provided by Tweet
Previously created TableBorder class has an error in setting table border colors. The generated colors are invalid according to the DOCX specification.
Fixed this by using the _Extensions methods.
Patch provided by lckuiper
A patch to add VML images ( <v:shape> ) to the Pictures list (Paragraph.Pictures). Without this patch, the list will only contain DrawingML images ( <w:drawing> ) by Annika89
- Fixes "This image cannot currently be displayed" errors after using InsertDocument with documents containing images
* Looks for images inside /word/media folder as well as images in the /media folder
* Updates the relationship id in both document.xml and document.xml.rels (in the local document as well)
- Adds the images to the /word/media folder instead of the /media folder
+ Adds the "image/jpg" type to the imageContentTypes list
Patch provided by Annika89
Fixes two issues with ingesting a .docx file. First, a tab exists as a child of a tabs element, not an r element (fix in HelperFunctions.cs at line 146). Second, an rFonts element may not have a cs attribute, but instead may have an ascii, eastAsia or hAnsi attribute (fix in Formatting.cs at line 101).
This patch contains a fix that makes Docx portable to mono. Fix for the exception: absolute path not supported on mono os x, on creating a document. Tested on windows using VS and tested on linux and mac os x using xamarin
This patch adds an extension method to Paragraph that allows easy setting of paragraph. It makes setting text as a heading much more intuitive and discoverable.
Covers Heading 1 - Heading 9
Example available in examples under DocumentHeading() method.
- Fix for "Format matching in ReplaceText does not work properly"
- New method: RemoveTextInGivenFormat
- Added unit test: Test_Paragraph_ReplaceTextInGivenFormat
- Added 'VariousTextFormatting.docx' file for unit testing purposes
- Moved ContainsEveryChildOf method to HelperFunction becasue it is shared by Contaner and Paragraph
- Added new feature in Container class: RemoveTextInGivenFormat
- Added unit test: Test_Document_RemoveTextInGivenFormat
While using the InsertDocument method, I encountered several (minor) issues/exceptions. The changes I made to get rid of these exceptions are in this patch. It also fixes merging Styles (and footnotes).
This patch adds basic support for inserting and manipulating bookmarks inside a word file. It also allows for inserting text at bookmark locations. The change was predicated on a need to insert text at bookmark locations in a sort of token replacement.
Adds the option to set the BreakAcrossPages property, which corresponds to the "Allow row to break across pages" property in Word: http://fiveminutelessons.com/learn-microsoft-word/stop-table-rows-microsoft-word-splitting-across-pages
Inserting a chart in a template throws exception "Message='rId10' ID conflicts with the ID of an existing relationship for the specified source."
provided by mmirabito.
InsertList(List list, double fontSize)
InsertList(List list, System.Drawing.FontFamily fontFamily, double fontSize)
and a new example of usage: DocumentsWithListsFontChange();
Thanks to those 2 methods you can easily set font family and font size when inserting new lists.
Issue shows that document does not contain 'r' xml element on the line which starts with 'tab'. This causes exception in processing.
The line is enclosed in the 'pPr' element though.
Fix by MiroJanosik
Adds the SetLineSpacing method to the Paragraph class. This method can be used to set or remove line spacing from a paragraph.
One method uses two parameters: the type of spacing and the amount of spacing (float). The other method uses one parameter: the type of spacing for which to set the value to auto; can be either before, after or both. The second method can also be used to remove spacing by using the type None.
Patch provided by Annika89. Great work!