Hi all,
I was wondering if someone could help me and advise why the text of the text fragment object is cut off vertically on 180 rotation page.
Would be grateful for any help!
image.png (1.6 KB)
Sample:
// Create Document instance
Document doc = new Document();
// Add page to pages collection of PDF file
Aspose.Pdf.Page page = doc.Pages.Add();
page.Rotate = Aspose.Pdf.Rotation::on180;
Aspose.Pdf.Rectangle pageRect = page.GetPageRect(true);
Aspose.Pdf.Text.TextParagraph paragraph = new Aspose.Pdf.Text.TextParagraph();
paragraph.Rectangle = new Aspose.Pdf.Rectangle(110, pageRect.Height - 04, 190, pageRect.Height - 30);
paragraph.VerticalAlignment = Aspose.Pdf.VerticalAlignment::Top;
paragraph.HorizontalAlignment = Aspose.Pdf.HorizontalAlignment::Left;
Aspose.Pdf.Text.TextFragment textFragment = new Aspose.Pdf.Text.TextFragment('My text');
textFragment.get_TextState().Font = Aspose.Pdf.Text.FontRepository::FindFont("Calibri");
textFragment.get_TextState().FontSize = 10;
textFragment.get_TextState().FontStyle = Aspose.Pdf.Text.FontStyles::Bold;
// textFragment.get_TextState().BackgroundColor = Aspose.Pdf.Color::FromRgb(System.Drawing.Color::LightGray);
paragraph.AppendLine(textFragment);
Aspose.Pdf.Text.TextBuilder builder = new Aspose.Pdf.Text.TextBuilder(page);
builder.AppendParagraph(paragraph);
str dataDir = "C:\MyFile.pdf";
// Save PDF file
doc.Save(dataDir);