Hi!
Is there a way to determine/calculate the "final" Rect coordinates of a first Rect (red box) after using the drawString function? Named parameters used in drawString is as follows:
bounds: Rect.fromLTWH(x, y, 0, 0)
format: PdfStringFormat(lineAlignment: PdfVerticalAlignment.middle)
I need to have the 2nd Rect (green box) top aligned to the 1st Rect.
Thank you very much.
Hi Trem,
Currently, we are analyzing on this and we will update further details on January 23rd, 2024.
Regards,
Raashith Ahamed S
Hi Trem,
To determine the width and height of the text to be drawn, we can use measureString method in PdfFont. Kindly use the following UG link for reference, https://help.syncfusion.com/flutter/pdf/working-with-text#measuring-a-string
To draw text in a layout, we can use PdfTextElement to draw the text and determine the end positions using PdfLayoutResult. Kindly use the following UG link for reference, https://help.syncfusion.com/flutter/pdf/working-with-flow-layout
Regards,
Karmegam
Most welcome, please check and get back to us.
Hello Jeyalakshmi Thangamarippandian,
Thanks for the heads up, I've managed to write the code to make what I envisioned to happen, as can be seen below, where the right column top-aligns with the left column no matter the number of lines entered.
However, I hit a snag when it comes to text that has been word wrapped within the RECT. I'm wondering if there's another method that could be used with word wrapped text.
Again, thanks very much!
--
Thor
Thanks for the update, Thor.
Please get back to us if you need any other assistance.