Rotate text in Table cell

8 posts, 1 answers
  1. Sandeep
    Sandeep avatar
    10 posts
    Member since:
    Nov 2014

    Posted 24 Nov 2014 Link to this post

    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
  2. Deyan
    Admin
    Deyan avatar
    135 posts

    Posted 25 Nov 2014 Link to this post

    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.

     
  3. Sandeep
    Sandeep avatar
    10 posts
    Member since:
    Nov 2014

    Posted 26 Nov 2014 in reply to Deyan Link to this post

    I didn't get demo project attachment or location where i can download.

    Regards,
    Sandeep
  4. Deyan
    Admin
    Deyan avatar
    135 posts

    Posted 27 Nov 2014 Link to this post

    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.

     
  5. Sandeep
    Sandeep avatar
    10 posts
    Member since:
    Nov 2014

    Posted 27 Nov 2014 in reply to Deyan Link to this post

    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
  6. Tanya
    Admin
    Tanya avatar
    404 posts

    Posted 27 Nov 2014 Link to this post

    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.

     
  7. Sandeep
    Sandeep avatar
    10 posts
    Member since:
    Nov 2014

    Posted 27 Nov 2014 Link to this post

    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
  8. Answer
    Deyan
    Admin
    Deyan avatar
    135 posts

    Posted 28 Nov 2014 Link to this post

    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.

     
Back to Top