This is a migrated thread and some comments may be shown as answers.

Rotate text in Table cell

9 Answers 389 Views
PdfProcessing
This is a migrated thread and some comments may be shown as answers.
Sandeep
Top achievements
Rank 1
Sandeep asked on 24 Nov 2014, 09:13 AM
Hi,
.
I need to rotate the text in a table cell while using RadFixedDocument. I have created a table and added the Block in table cell.

table.Rows.AddTableRow().Cells.AddTableCell().Blocks.AddBlock().InsertText("MyTest");

Now i want to rotate this by 90 degree. 

Can you guide me how i can achieve this.

Regards,
Sandeep

9 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 25 Nov 2014, 03:14 PM
Hello Sandeep,

Currently RadPdfProcessing does not support transformed text in table cells. However, you can easily add such functionality by creating custom block element implementing the IBlockElement interface. I am attaching a sample demo project showing how to implement a rotated block and add instances of this block to cell's blocks collection. A few words about this demo:
  • A RotatedBlock class implements the IBlockElement interface. 
  • This class contains a Block instance.
  • When measured the RotatedBlock instance returns the rotated bounds of the inner block.
  • When drawing the RotatedBlock some additional transformations are added to the FixedContentEditor in order to draw the inner block rotated.

You should additionally notice a few additional points about the demo:
  • The RotatedBlock class sample implementation always measures the inner block into infinity. If you need to split the block onto pages or wrap its text onto multiple lines you need to add some custom logic depending on the desired behaviour.
  • If you use binaries from Q3 2014 you may not be able to build the demo. This is because the project uses IBlockElement's HasPendingContent property. This property was added to the interface in the latest internal build binaries. It will also be available in the SP which will be released in about a week. In order to build the demo successfully you can either upgrade with the latest internal build binaries or simply comment out the HasPendingContent property in RotatedBlock class.

I hope this is helpful.

Regards,
Deyan
the Telerik team
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Sandeep
Top achievements
Rank 1
answered on 26 Nov 2014, 07:13 AM
I didn't get demo project attachment or location where i can download.

Regards,
Sandeep
0
Deyan
Telerik team
answered on 27 Nov 2014, 09:34 AM
Hello Sandeep,

Please excuse us for the inconvenience. There seems to be some issue with the attachment visibility in the forum post. We have managed to fix it and now the attachment should be available for download.

If you have any other questions or concerns please do not hesitate to contact us again.

Regards,
Deyan
the Telerik team
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Sandeep
Top achievements
Rank 1
answered on 27 Nov 2014, 09:58 AM
Hi,

I am using telerik version 2014.3.1021.1050. And i am facing problem for compilation. Can you guide me how i can get latest binaries.

Regards,
Sandeep
0
Tanya
Telerik team
answered on 27 Nov 2014, 05:59 PM
Hello Sandeep,

The version you are using now is our official version. We release latest internal builds every week to allow clients to test fixes as soon as they are available. You can download our latest internal build from your profile

Try it and let us know how it goes.

Regards,
Tanya
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Sandeep
Top achievements
Rank 1
answered on 28 Nov 2014, 05:58 AM
Hi,

Thanks for the links to latest binaries. While compiling your demo i realized that it is not a Silverlight application and uses "WindowsBase.dll" but that will not be available for Silverlight application. I think PDFProcessing is used for silverlight application.

Let me know if I am missing anything.

Regards,
Sandeep
0
Accepted
Deyan
Telerik team
answered on 28 Nov 2014, 12:09 PM
Hello Sandeep,

RadPdfProcessing is UI independent document processing library and is available both for WPF and Silverlight. The demo I have previously sent is a console application showing how to export the PDF file without the need of any UI.

As for the Silverlight compilation issues you have reached - System.Windows.Rect and System.Windows.Media.Matrix classes have some missing methods and properties in Silverlight compared to WPF. That is the reason why you need to make some minor changes in RotatedBlock class matrix calculations in order to build it successfully in Silverlight.

I am attaching the modified demo as an Silverlight application. You should additionally notice that due to Silverlight limitations you have to use a button and SaveFileDialog in order to export the generated PDF to a file.

I hope this is helpful.

Regards,
Deyan
the Telerik team
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
gy
Top achievements
Rank 1
answered on 19 Jun 2018, 10:41 PM

Hi, Deyan:

    I just read your post regarding how to rotate the text in a block. However, I could not download your demo code: CustomIBlockElementDemo.rar . Could you please send me the demo code in zip format by email? I appreciate your kind help.

0
Tanya
Telerik team
answered on 21 Jun 2018, 01:51 PM
Hi,

I converted the attachment to ZIP and you can find it attached to this reply. Hope this is helpful.

Regards,
Tanya
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
PdfProcessing
Asked by
Sandeep
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Sandeep
Top achievements
Rank 1
Tanya
Telerik team
gy
Top achievements
Rank 1
Share this question
or