The element inside isn't rotate

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF CoreSuite for .NET (v11)  /  Re: The element inside isn't rotate

DynamicPDF CoreSuite for .NET (v11) Forum

 Mar 30 2022 5:35 AM
Hi Admin,

I just upgraded V10 to V11 with Core Suit license.

I do add element to page, and I tried to rotate the page but the element inside wasn't rotate as the page is. Can you help check if this is issue?

Please see the below snipe example code:

Page page = new Page(1, "Portrait", 0);

page.Elements.Add(..adding Label element or something like that...);

page.Rotate=90;

Regards,

Posted by a ceTe Software moderator
Hi,

The behavior you are seeing is due to a feature added to handle the page rotation accordingly to add the contents in correct orientation. This is a breaking change in v11, and you may want to update your code accordingly

If you want to rotate the contents, then please set the Angle property and dimensions of respective page element to desired value.

Here is a code sample:

            Document document = new Document();
            TextArea area = new TextArea("This is to test", 692, 100, 120, 200);
            area.Angle = 90;
            Page page1 = new Page(PageSize.A4, 10f);
            page1.Elements.Add(area);
            page1.Rotate = 90;
            document.Pages.Add(page1);
            string outputPdf = "C:\\Temp\\MyDocument.pdf";
            document.Draw(outputPdf);

Thanks,
ceTe Software Support Team
Hi Admin,

If I build a page with 500 elements inside the page or group of element. In V11, I want to rotate the page,  is it mean we have to setup the rotate of element in one by one?

We have used V6, V8, V9, V10 in both .Net and Com version in our system. Whatever element added into the group or page then I can output any rotation of the page.

It not really good if I want to change the page rotation and the element inside the group  or page is not rotate.

Regards,
ML
Posted by a ceTe Software moderator
Hello,

Yes,  you will need to add the page elements by setting the Angle, X and Y positions. Handling page rotation for adding page elements is a breaking change in version 11 DynamicPDF Core Suite for .NET product.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 7:15 PM.