Hi Team,
Package: Aspose.Pdf 22.3
We are facing alignment issue with FormattedText with TextStamp in the page header, text is not aligned properly when we have multiple line of text in header. Text is getting clipped off from the page.
Source Code to reproduce:
var document = new Aspose.Pdf.Document();
Page p = document.Pages.Add();
p.SetPageSize(597.6, 842.4);
p.Paragraphs.Add(new TextFragment(“Test page 0 对以下试验进行了调查对以下试验进行了调查对以下试验进行了调查对以”));
var headerText = new FormattedText("添付ファイル#1 - セフォタキシムナトリウムと包装材料バイアルの適");
headerText.AddNewLineText("分析レポート: AAA09074, ユーロフィンサンプル番号: ZN22AA0139-1, バージョン");
headerText.AddNewLineText("Page 3 of 9");
var headerTextStamp = new TextStamp(headerText);
headerTextStamp.TextAlignment = HorizontalAlignment.Right;
headerTextStamp.TextState.FontSize = 8;
headerTextStamp.TextState.Font = FontRepository.FindFont("Arial"); ;
headerTextStamp.HorizontalAlignment = HorizontalAlignment.Right;
headerTextStamp.VerticalAlignment = VerticalAlignment.Top;
headerTextStamp.TopMargin = 15;
headerTextStamp.RightMargin = 72 * 0.5;
document.Pages[1].AddStamp(headerTextStamp);
document.Save(“Test.pdf”, Aspose.Pdf.SaveFormat.Pdf);
Regards,
Shivaraj Hiremath