Rotate Text in Table Cell

Aspose PDF .NET 10.4


Using the DOM (not generator), how do I rotate text within a table cell?

Hi Dirk,


Thanks
for using our API’s.
<o:p></o:p>

I am afraid currently the DOM approach does not support the feature to rotate text inside Table cell. However for the sake
of implementation, I have logged this requirement as PDFNEWNET-38835 in
our issue tracking system. We will further look into the details of this
requirement and will keep you updated on the status of implementation. Please be
patient and spare us little time. We are sorry for this inconvenience.

Bummer.


Do you have any other work arounds?

Could I create a SVG in memory with the text and rotate that and insert it into the PDF?

Could I create another type of Aspose object, rotate it, and then place it in the cell?

Can I mix in the generator and create a piece that I can insert into the DOM table cell?

Should I even be using the DOM api? It seems like I keep running into things that are in the Generator but are not in the DOM api. I thought the Generator was deprecated??

dirq:
Do you have any other work arounds?

Could I create a SVG in memory with the text and rotate that and insert it into the PDF?
Hi Dirk,

Yes as a workaround, you can create SVG with text and instantiate htmLFragment instance and place it inside paragraphs collection of Table cell. Please take a look over following code snippet.

[C#]

Aspose.Pdf.HtmlFragment html = new HtmlFragment("<svg height=“20”
width=“20”> <text x=“10” y=“5”
fill=“black” transform=“rotate(30 20,40)”>header-"

  • hc+" ");<o:p></o:p>

html.IsInLineParagraph = true;

cell.Paragraphs.Add(html);


dirq:
Could I create another type of Aspose object, rotate it, and then place it in the cell?
HtmlFragment can be solution in current circumstances.

dirq:
Can I mix in the generator and create a piece that I can insert into the DOM table cell?
I am afraid you cannot use objects from different namespaces however in a single application cycle, you can individually use objects from each namespace i.e. create PDF file using Aspose.Pdf.Generator, save output in Stream instance and then manipulate PDF file using DOM approach.
dirq:
Should I even be using the DOM api? It seems like I keep running into things that are in the Generator but are not in the DOM api. I thought the Generator was deprecated??
Hi Dirk,

The new DOM model of Aspose.Pdf namespace is recommended approach and we always recommend our customers to try migrating to this new model as it includes all new enhancements and new features. However we are gradually adding missing features in this new model.

The issues you have found earlier (filed as PDFNET-38835) have been fixed in Aspose.Pdf for .NET 17.6.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

Hi Dirk,


Thanks for your patience.

In order to resolve the issue reported earlier as PDFNET-38835, please try using h.TextState.Rotation = 90 instead of h.Rectangle.Rotate(270).