techprimate/TPPDF

How to center text and image on bottom left ?

X901 opened this issue · 5 comments

X901 commented

Hi ,
I'm trying to create new document
I need to put Title , Signature and Name on the end of the file
but I need them above each other and also center

I use it like this
document.add(.contentLeft, attributedTextObject:senderTitleTextElement) document.add(.contentLeft, image: signatureImageElement) document.add(.contentLeft, attributedTextObject:senderNameTextElement)

The result like this
https://a.cl.ly/jkuKOQq6

but I want it like this
https://a.cl.ly/xQugOD9Q

Hi,

when you try this:

document.add(.center, attributedTextObject:senderTitleTextElement)

or you can try footer

Hi @X901, have you tried adding a space above the title?

document.add(space: 200) // Set correct value for your case
document.add(.contentLeft, attributedTextObject:senderTitleTextElement) document.add(.contentLeft, image: signatureImageElement)
document.add(.contentLeft, attributedTextObject:senderNameTextElement)
X901 commented

Hi ,
I'm not looking for spacing ,
what I'm looking for is arranged

I want 2 texts and image on the left bottom side
but all aranged vertical on center as when we use StackView
we can change the aranged (leading , center , trailing)

I understand, they should be at the left side stacked vertically but centered horizontally.
Well I guess you have to manually find the right width of the stack.

Try setting a very wide right margin, and add it to the .contentCenter container. It should be centered but shifted left due to the margin.
Otherwise try adding the elements into a group centered, then add the group to the document.

Closing due to inactivity