Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to center text and image on bottom left ? #189

Closed
X901 opened this issue Mar 18, 2020 · 5 comments
Closed

How to center text and image on bottom left ? #189

X901 opened this issue Mar 18, 2020 · 5 comments
Labels

Comments

@X901
Copy link

X901 commented Mar 18, 2020

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

@AlexLojewski
Copy link

Hi,

when you try this:

document.add(.center, attributedTextObject:senderTitleTextElement)

or you can try footer

@philprime
Copy link
Member

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
Copy link
Author

X901 commented Mar 23, 2020

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)

@philprime
Copy link
Member

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.

@philprime
Copy link
Member

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants