0

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.

Aref Zamani
  • 2,023
  • 2
  • 20
  • 40
  • Please ZIP and upload your **input** Word document and **expected** Word document showing the final result on Dropbox and share the download link here for testing. You can create expected Word document by using MS Word for our reference. We will then provide you code to achieve the same by using Aspose.Words. I work with Aspose as Developer Evangelist. – Awais Hafeez Nov 26 '17 at 06:25

1 Answers1

1

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#