BoldDesk®Customer service software offering ticketing, live chat, and omnichannel support, starting at $49/mo. for 10 agents. Try it for free.
I have a PdfCompositeField that's intended to render the page number in the footer, as in "Page 1 of 1". I'd like this text to be aligned right. Normally I'd do this by measuring the size of the rendered text and then using that width value to determine the X value for the Draw method. But this does not seem to work with the PdfCompositeField. Any help is appreciated.
Hi,
We have created a sample that meets our requirements, and we have attached it for your reference. Please try it on your end and let us know if you require any further assistance.
Sample:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/Sample_F1873161644215349.zip
Regards,
Jeyalakshmi T
Thank you for the response. It looks like this approach measures the width of the footer text based on an assumed number of pages:
string text = "Page 100 of 100";
SizeF size = font.MeasureString(text);
The trouble is that when generating a PDF from dymanic content we don't know the total number of pages and moreover don't know ahead of time what page we're on. So won't this result in an assumed measurement that doesn't match the exact measurement and thus a footer that isn't always aligned to the right?
Hi Chris,
Currently the page number field will be rendered based on bounds which provided and it doesn't change based on the dynamic content. So it is not possible to add the dynamic position on the page number fields.
However, we have created a workaround solution to meet your requirement by drawing the page number directly using page graphics. Kindly try this sample on your end and let us know the details.
Sample:
https://www.syncfusion.com/downloads/support/directtrac/general/ze/Sample_F18731613259045.zip
Regards,
Jeyalakshmi T
Thank you for taking the time to look into this. It does work as advertised!
We are glad to hear that the issue has been resolved on your end. Please get back to us if you need any other assistance.