Page 1 of 1

How to place text right aligned under image?

Posted: Tue Sep 09, 2014 3:32 pm
by matthias
Hi,

i have 2 images side by side on a page.
I am able to place a text under each image left aligned, so the each text is justified with the left side of the image.

Now i need to place some text under each image, which is justified right with the right edge of the image. I want the text to end at the right edge of the image. the longer the text is the more left it has to be placed.
But i am not successful.
Is this possible with the standard commands?
Or do i have to
1. calculate the x position according to the number of charcacters of the text
2. set the x positon
3. write the text left aligned
?

Regards,

Matthias

Re: How to place text right aligned under image?

Posted: Tue Jun 02, 2015 8:16 pm
by JanSchenkel
Hi Matthias,

My apologies for the ridiculously late reply. I've been lost in personal issues and am only now finding back the energy to get back to my LiveCode projects.

You have two options to tackle this:
1. use the approach you outlined, along with the function qrtPDF_WidthOfString to determine the X position
2. much easier is to use the qrtPDF_WriteTextBox command as in demo 2

Code: Select all

qrtPDF_WriteTextBox tDocRef, 160, 10, tBoxText, "bottom", "begin", "right", false
HTH,

Jan Schenkel.