wordprocessingml

Prevent Word 2010 from saving o:gfxdata base64 or uuencoded VML?

一个人想着一个人 提交于 2020-01-23 01:37:48
问题 I am working with .docx files containing several drawing canvases with images inserted and some lines and arrows drawn in Word 2010. I am using 2010 format with no compatibility mode. Word inserts an o:gfxdata attribute into each v:shape and v:group element and fills it with ascii encoded something. From what I have read it may be a copy of the VML describing the v:shape or v:group . I don't know if I just don't know what to look for, but I cannot determine what this data is for as its

Manipulating simple bookmarks in Word

ぐ巨炮叔叔 提交于 2020-01-17 03:39:27
问题 There are a lot of questions, answers and posts about openXml, mainly good, thorough stuff that Eric White posts here (also here and other stack-overflow questions). The thing is the examples have two characteristics that make it difficult for me to apply: First, they are extremely end-to-end in the sense thay take care of every possible scenario possilbe (Like Eric White's XML flattening solution) and thus making the code too complicated. Second, the examples are more snippets and less

How to add text on desired coordinates on new word file using openxml

不问归期 提交于 2019-12-31 03:46:10
问题 I want to create .docx file using openxml and add text on desired coordinates(location) on each page of the file. Is there any way in openxml to adjust the text. I am using the following snippet: WordprocessingDocument doc = WordprocessingDocument.Create("E:\\test11.docx", DocumentFormat.OpenXml.WordprocessingDocumentType.Document); { MainDocumentPart mainPart = doc.AddMainDocumentPart(); mainPart.Document = new Document(); Body body = mainPart.Document.AppendChild(new Body()); Paragraph para

Open XML SDK adding gradient border to all drawings

ε祈祈猫儿з 提交于 2019-12-25 04:14:12
问题 I'm working on my own project, and i want to apply gradient borders to all pictures in the ms word file . On my research, i was only able to insert new pictures with assigned parameters. The problem is, that i can't figure it out how to access and customize existing picture elements . I thought, that if i create new elements, and then simply append them to a file it will do the work, but somehow Drawing element drops an error because it belongs to a tree or smth. Below is the code fragment of

Docx: can't seem to get a bulleted list to render

北城以北 提交于 2019-12-22 15:09:22
问题 I'm building a DocX document essentially from scratch with XML. I have a very simple goal: create a bullet-point list, like a ul in HTML. Reading the WordProcessingML specification for numbered lists (section 2.9), I created what I thought would satisfy this. Here's what my numbering.xml looks like: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <w:numbering xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:mo="http://schemas.microsoft.com/office/mac/office

How to add OpenXml list paragraph with bullets to content control?

只谈情不闲聊 提交于 2019-12-13 09:31:18
问题 Im using a Word 2013 .docx as a template thats opened in the openxml code, the content controls are filled in then its saved, downloaded to the user and that part works fine. In one content control the goal is to add a bulleted list. The problem comes from trying to append or replace the new paragraph, which is generated from a method. This method works fine, i send it the variable and it returns a paragraph with a bullet. It inserts, but it corrupts the word doc; Shown below are the template

Relationship error when trying to embed and image into a Word document

巧了我就是萌 提交于 2019-12-13 04:58:42
问题 I add a PNG image to a word 2010 document like this: var imagePart = report.MainDocumentPart.AddImagePart(ImagePartType.Png); var imagePath = Path.Combine(imageFolder, "1.png"); var stream = new FileStream(imagePath, FileMode.Open); imagePart.FeedData(stream); stream.Close(); I find the blip element of an empty Picture content control and change its reference property to point to the new image: var blip = image.Descendants<Blip>().Single(); blip.Embed = report.MainDocumentPart.GetIdOfPart

keep table(rows) together with OpenXML SDK 2.5

我是研究僧i 提交于 2019-12-12 20:56:21
问题 I'd like to generate multiple tables with 2 rows each inside of a word document. But I want to keep these two rows together (if possible). new KeepNext() on the first row doesn't work new KeepNext() on the last paragraph of the first row doesn't work new CantSplit() on the table doesn't work In all cases the second row (if too large) lands on the second page. A new CantSplit() on the last cell ( the one with large content) avoids a break of the cell. But none of the options avoids a split of

I am merging two Word documents with OpenXML SDK but get a corrupt document when copying an image into a header

懵懂的女人 提交于 2019-12-12 10:03:30
问题 I have code which works in all sorts of different situations, including when copying images into the body of the document. The code works when copying (adding) headers and footers from one document to the other, as long as the headers/footers being copied do not contain images. When I copy a header which has an image in it, then the resulting file is corrupt, and when I try to open it with the OpenXML SDK it throws an exception saying "Compressed part has inconsistent data length". I do know