Rotating the text in a FloatingBox produces strange output.
Rotation by 90 or 270 produces a single line
Rotating by 180 creates a mirror image with the lines of text in reverse order.
The PDF below was produced by creating a series of FloatingBoxes with different rotations.
Annotated Example.pdf (147.1 KB)
AddTextBox(page, "Box Number One", new AnnotationDetails(180, 120, 60, 60), 0); AddTextBox(page, "Box Number Two", new AnnotationDetails(220, 160, 60, 60), 90); AddTextBox(page, "Box Number Three", new AnnotationDetails(260, 200, 60, 60), 180); AddTextBox(page, "Box Number Four", new AnnotationDetails(300, 240, 60, 60), 270); AddTextBox(page, "Box Number Five", new AnnotationDetails(340, 280, 60, 60), 0);
private static void AddRotatedTextBox(Page page, string message, AnnotationDetails details) { Console.WriteLine($"TextBox Top:{details.Top:000} Left:{details.Left:000} Width:{details.Width:000} Height:{details.Height:000} Background:{backgroundColorARGB:X} {message}"); var padding = 1; details.Left = (float)page.Rect.Width - details.Left; details.Top = (float)page.Rect.Height - details.Top; var left = (double)details.Left + padding - page.PageInfo.Margin.Left; var top = (double)details.Top + padding - page.PageInfo.Margin.Top; var box = new FloatingBox((float)details.Width-padding, (float)details.Height-padding) { Border = new BorderInfo(BorderSide.All, borderColorARGB == 0 ? 0.0f : 1.0f, PdfColor.Green), IsNeedRepeating = false, Left = left, Top = top, IsInLineParagraph = false, IsInNewPage = false, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top, Margin = new MarginInfo(0, 0, 0, 0), Padding = new MarginInfo(0, 0, 0, 0), PositioningMode = ParagraphPositioningMode.Absolute, }; var text = new TextFragment($"{message}[Left:{left:000} Top:{top:000}"); text.TextState.ForegroundColor = GetColorFromARGB((uint)fontColorARGB); text.TextState.Font = FontRepository.FindFont(fontName); text.TextState.FontSize = (float)fontSize; text.TextState.Rotation = 180; box.Paragraphs.Add(text); page.Paragraphs.Add(box); AddRectangle(page, (double)details.Left, (double)details.Top, (double)details.Width, (double)details.Height , (uint)backgroundColorARGB , (uint)borderColorARGB , (details.Zorder ?? 0) - 1, 10); }