gamartin
Forum Replies Created
-
AuthorPosts
-
Thanks again Eric. I was able to get it to do what I needed by changing the call to GetTableProperties, passing in the settings. I added a setting to respect the column widths (since I know they are going to be valid – 50% each) and if set then the GetTableProperties adds a
w:tblLayout type="fixed"
element to the TableProperties element. In playing around with it, I found that Word added that element if I went into the table options and de-selected the “Automatically resize to fit contents” option.A bit of a hack, but it works for me. I was initially thinking that I could do it in the GetTableGrid method if the width properties had the important declaration, but it appears to be too late in the game…
Thanks again.
Garth
- This reply was modified 7 years, 10 months ago by gamartin.
OK thanks Eric. I will continue to do what I have been doing, which is using a docx file as a template that only has a header with the paging control in it and merging it with the output generated by the HtmlToWmlConverter.
Garth
Eric:
Here is an example of what is being generated by the HtmlToWmlConverter:
<w:abstractNum w:abstractNumId="1"> <w:nsid w:val="E4F23709"/> <w:multiLevelType w:val="multilevel"/> <w:tmpl w:val="02BEA0DA"/> <w:lvl w:ilvl="0"> <w:start w:val="1"/> <w:numFmt w:val="bullet"/> <w:lvlText w:val=""/> <w:lvlJc w:val="left"/> <w:pPr> <w:tabs> <w:tab w:val="num" w:pos="720"/> </w:tabs> <w:ind w:left="720" w:hanging="360"/> </w:pPr> <w:rPr> <w:rFonts w:ascii="Symbol" w:hAnsi="Symbol" w:hint="default"/> <w:sz w:val="20"/> </w:rPr> </w:lvl> <w:lvl w:ilvl="1"> <w:start w:val="1"/> <w:numFmt w:val="bullet"/> <w:lvlText w:val="o"/> <w:lvlJc w:val="left"/> <w:pPr> <w:tabs> <w:tab w:val="num" w:pos="1440"/> </w:tabs> <w:ind w:left="1440" w:hanging="360"/> </w:pPr> <w:rPr> <w:rFonts w:ascii="Courier New" w:hAnsi="Courier New" w:hint="default"/> <w:sz w:val="20"/> </w:rPr> </w:lvl>
If I remove all the
<w:tabs....>
nodes, the alignment is fine, otherwise it has too much hanging indentation when the content is more than one line.I am going to see if I can simply remove it from the numbering generation without breaking anything else…
Thanks,
Garth
Hi Eric: I was about to re-post a response to this. I discovered that the original source we were using to populate the system contained non-breaking hyphens (‑) which I was not aware of.
If have replaced all of these with regular hyphens and all works well. During the course of the investigation I discovered that it was not necessarily restricted to the LI elements either.
Thanks for the quick response,
Garth
OK I was able to get this to work in memory. I guess the behaviour when you save the file is different than when you just work in memory.
I if do it thusly it works:
// open our template and do our quick search and replace var templateDoc = new WmlDocument(templatePath); templateDoc = TextReplacer.SearchAndReplace(templateDoc, "<TitlePageGroupAndCode>", _caTitle, true); templateDoc = TextReplacer.SearchAndReplace(templateDoc, "<TitlePageBargainingAgentName>", _bargainingAgentName, true); templateDoc = TextReplacer.SearchAndReplace(templateDoc, "<TitlePageGroupName>", _groupName, true); templateDoc = TextReplacer.SearchAndReplace(templateDoc, "<TitlePageExpiryDate>", _expiryDate, true); templateDoc = TextReplacer.SearchAndReplace(templateDoc, "<CopyrightBargainingAgentName>", _bargainingAgentName, true);
Cheers,
Garth
-
AuthorPosts