我想为我的Image添加标题,为此我创建了这个方法:
public static void AddPhotoCaption(
ref Document doc,
ref DocumentBuilder builder,
Shape shape,
string captionTitle,
CaptionPosition position)
{
builder.MoveTo(shape.ParentParagraph);
builder.InsertParagraph();
builder.InsertField(@"SEQ Figure \* ARABIC", "");
builder.Write(captionTitle);
}
但标题放在图像后面。我也尝试过:
builder.MoveTo(shape.NextSibling);
但发生了System.ArgumentNullException。