We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

HtmlFragment is not rendered correctly in table cells when Rotate=90

Hi,

I’ve found out some issue in Aspose.Pdf for .NET. When opening document that has property Rotate=90 set and actually text is not rotated Aspose library cannot properly render html formatted text in tables. I didn’t found any way to adjust proper rotation particularly for HtmlFragment in table cells, probably Aspose tries to use document’s global property without any way of changing that. As I noticed problem occurs only with html text in table cells (TextFragment is rendered correctly) and plain text in FloatingBoxes.Tested with Aspose.Pdf version 18.5.0. Test document, sample code and images showing problem are attached.
Landscape.pdf (59.1 KB)
Landscape_rotated.png (9.4 KB)
RunExamples.zip (2.0 KB)
Problem 1.png (218.6 KB)
Frame_rotated.png (2.1 KB)

Thanks,
Alex Shloma

@licenses

Thank you for contacting support.

We have worked with the data shared by you and have been able to notice the problem with rendering of HtmlFragment in a table cell. A ticket with ID PDFNET-44868 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

However, would you please share a narrowed down code snippet reproducing the problem with plain text in FloatingBox so that we may look into that as well, and take care of your concerns accordingly.

We are sorry for the inconvenience.

Hi,
Thanks for quick reply. Below is snippet for the same issue with FloatingBox:

private void DrawAnnotationNumber(Page page, Aspose.Pdf.Rectangle rect, string number)
{
var box = new Aspose.Pdf.FloatingBox(8F + (2F * number.Length), 10F);
page.Paragraphs.Add(box);
box.Border = new Aspose.Pdf.BorderInfo(Aspose.Pdf.BorderSide.Box, 2.5F, Aspose.Pdf.Color.Black);
box.BackgroundColor = Aspose.Pdf.Color.White;
if ((page.Rotate == Rotation.on90) || (page.Rotate == Rotation.on270))
{
var tmp = box.Width;
box.Width = box.Height;
box.Height = tmp;
}
box.Left = rect.LLX - page.PageInfo.Margin.Left - box.Width;
box.Top = ((page.CropBox.Height > 0) ? page.CropBox.Height : page.PageInfo.Height) - rect.URY - page.PageInfo.Margin.Top - box.Height;
var text = new TextFragment(number);
box.Paragraphs.Add(text);
text.HorizontalAlignment = HorizontalAlignment.Center;
text.Margin = new MarginInfo(1F, 1F, 1F, 1F);
text.TextState.FontSize = 8;
}

If the document has Rotate=90 property set the text in FloatingBox is shown rotated as you can see on Frame_rotated.png screenshot. And I didn’t found how to change this behavior.

@licenses

Thank you for sharing requested data.

We have been able to reproduce the problem with FloatingBox. A ticket with ID PDFNET-44875 has been logged in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.