Hi,
Thanks for your post.
I used the line,Field field = paragraph.AppendField("\\l 8", FieldType.FieldAdvance), and indeed reproduced the double quotes issue. I have logged it into our bug tracking system with the ticket SPIREDOC-4161. Sorry for the inconvenience caused. We will inform you when it is fixed.
Please use the following method for the time being.
- Code: Select all
Document doc = new Document();
Section section = doc.AddSection();
Paragraph paragraph = section.AddParagraph();
int index = 0;
FieldMark mark = new FieldMark(doc, FieldMarkType.FieldSeparator);
Field field = new Field(doc);
field.Type = FieldType.FieldAdvance;
field.Code = @" ADVANCE \l 8 ";
paragraph.ChildObjects.Insert(index, field);
IParagraphBase end = doc.CreateParagraphItem(ParagraphItemType.FieldMark);
(end as FieldMark).Type = FieldMarkType.FieldEnd;
paragraph.ChildObjects.Insert(1, end);
field.End = end as FieldMark;
doc.IsUpdateFields = true;
string result = "result1.docx";
doc.SaveToFile(result, FileFormat.Docx2013);
Sincerely,
Amy
E-iceblue support team