简体   繁体   中英

how to add caption bottom or above of picture in Aspose.Word for C# .Net

I want to add caption for my Image and for this purpose I create this method:

 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);
        }

but the caption placed behind the image.also I tried :

    builder.MoveTo(shape.NextSibling);

but then System.ArgumentNullException' occurred.

Could you please clarify that you want to add text to some image?

If yes then you can just follow the following answer on stack overflow.

Write Text On An Image in c#

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM