Hello,
We are using IWTextBox from Syncfusion.DocIO.DLS to display State and Year on an image on Word report using DocIO.
Earlier we were using Synfusion version OLD Version -- 16.3.0.21 .. The IWTextBox was getting aligned properly on the image .
Please see attachment - (Report Picture 1.PNG)
Recently we upgraded Synfusion to new version 17.4.0.43. The IWTextBox is not getting aligned properly on the image using the same code.
Please see attachment - (Report Picture 2.PNG)
We are using the following code
Bitmap hsipImage = reportPicture != null ? Resource.HSIP_Cover_2018_WithGoldBorders : Resource.HSIP_Cover_Old;
using (Bitmap image = hsipImage)
{
IWPicture wImage = paragraph.AppendPicture(image);
wImage.Width = 450f;
wImage.Height = 575f;
wImage.VerticalPosition = 5;
wImage.HorizontalAlignment = ShapeHorizontalAlignment.Center;
wImage.TextWrappingStyle = TextWrappingStyle.Square;
wImage.TextWrappingStyle = TextWrappingStyle.InFrontOfText;
wImage.AlternativeText = reportPicture != null ? string.Format("Cover :{0} Highway Safety Improvement Program {1} Annual Report, Image is: " + reportPicture.AltText + ", Logos are HSIP Logo and DOT Logo", statedescription, fiscalYear) : alternativeText;
IWTextBox stateTextBox = paragraph.AppendTextBox(275, 40);
stateTextBox.TextBoxFormat.NoLine = true;
stateTextBox.TextBoxFormat.HorizontalPosition = 217;
stateTextBox.TextBoxFormat.VerticalPosition = 30;
//Add new text to the textbox body
paragraph = stateTextBox.TextBoxBody.AddParagraph();
paragraph.AppendText(statedescription.ToUpper());
paragraph.ApplyStyle("stateDescription");
var yParagraph = section.AddParagraph();
IWTextBox yearTxt = yParagraph.AppendTextBox(275, 30);
yearTxt.TextBoxFormat.NoLine = true;
yearTxt.TextBoxFormat.HorizontalPosition = 217;
yearTxt.TextBoxFormat.VerticalPosition = 105;
paragraph = yearTxt.TextBoxBody.AddParagraph();
paragraph.AppendText(fiscalYear.ToString() + " ANNUAL REPORT");
paragraph.ApplyStyle("annualYearStyleReportHeader");
if (reportPicture != null)
{
var sourceParagraph = section.AddParagraph();
IWTextBox sourceTxt = sourceParagraph.AppendTextBox(450, 125);
sourceTxt.TextBoxFormat.NoLine = true;
sourceTxt.TextBoxFormat.HorizontalPosition = 25;
sourceTxt.TextBoxFormat.VerticalPosition = 550;
sourceParagraph = sourceTxt.TextBoxBody.AddParagraph();
sourceParagraph.AppendHTML(string.Format("{0} {1}", "<b>Photo Source:</b> <br/>", reportPicture.PictureSource));
// sourceParagraph.ApplyStyle("pictureSource");
}
}
Has any method or property being depreciated when Synfusion dll got upgraded.
I am also attaching the Synfusion Word Reports
Please provide a working sample in Synfusion new version 17.4.0.43 to display the state and year correctly on the image
Please advice.
Attachment:
Report_Picture_b775f5cb.zip