We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Vertical PdfCompositeField

Hello,

Is it possible to draw a PdfCompositeField vertically? I have a composite field that displays page number and page count. I would like to display the field vertically in page footer.

Here's an example of my code:

PdfPageNumberField pn = new PdfPageNumberField(f, b);
PdfPageCountField pc = new PdfPageCountField(f, b);

PdfCompositeField cf = new PdfCompositeField(f, b, "{0} / {1}", pn, pc);
cf.Bounds = new RectangleF(0, 0, 50, 50);
cf.StringFormat = new PdfStringFormat();
cf.StringFormat.WordWrap = PdfWordWrapType.Word;
cf.StringFormat.Alignment = PdfTextAlignment.Center;
cf.StringFormat.LineAlignment = PdfVerticalAlignment.Middle;

PdfPageTemplateElement footer = new PdfPageTemplateElement(rect)
footer.Graphics.RotateTransform(-90);
cf.Draw(footer.Graphics);

The code above draws the field horizontally even though the coordinate system is rotated.

My Essential Studio version is 7.2.0.37.

Best regards,
Asko

1 Reply

PJ Pravin Joshua D Syncfusion Team February 19, 2010 09:44 AM UTC

Hi Asko,

Thank you for using Syncfusion Products.

It is not possible to draw vertical composite field.
PdfPageNumberField and PdfCompositeField are known as dynamic fields(or automatic fields). These fields display information calculated automatically,just before the object is saved.
Hence the text will be drawn only in the horizontal mode, even though Graphics is rotated.

To know more about Dynamic/Automatic fields, Please look into our User Guide in the following link.

http://help.syncfusion.com/ug_74/pdf/DynamicFields1.html

Please let us know if you have any questions.

Regards,
Pravin Joshua D

Loader.
Live Chat Icon For mobile
Up arrow icon