Hello, I've encountered some strange behaviour when working with WPicture.AddCaption method. It doubles the entered name. Here is a little snippet of code I use to build a table of images with captions:
WTable table = (WTable)section.AddTable();
table.TableFormat.Borders.BorderType = Syncfusion.DocIO.DLS.BorderStyle.None;
table.TableFormat.CellSpacing = 10;
int count = (images.Count / 2) + 1;
table.TableFormat.HorizontalAlignment = RowAlignment.Center;
if (count > 0) {
table.ResetCells(count, 2);
int row = 0;
for (int i = 0; i < images.Count(); i++) {
int pos = i % 2;
Bitmap image = images[i].Image;
WParagraph imagePar = (WParagraph)table[row, pos].AddParagraph();
WPicture picture = (WPicture)imagePar.AppendPicture(image);
picture.TextWrappingStyle = TextWrappingStyle.Inline;
picture.LockAspectRatio = true;
picture.AddCaption(images[i].Label, CaptionNumberingFormat.Number, CaptionPosition.AfterImage);
this.ApplyFormattingForCaption(imagePar);
if (pos > 0) {
row++;
}
}
And it works really fine, except that the image caption string is printed twice, for the second time seemingly in
encoded form (see "
_
" instead of " " etc. ). See the image sample below:
Please note that the images[i].Label contains the name just once, the second string is not the name of the text and my document contains plenty of other text and this problem does not occur anywhere else.
Any help or workaround would be greatly appreciated.
Thank you,
Petr