I created a red colored box with PDFStyler and PDFPageFormatter.
Now I would like to center a text in front of this box.
Any idea ?
How FME computes text position ?
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.
Since you use 2 different boxes in the PDFPageFormatter the only way you can center the text on the red box is by moving the Title box in the PDFPageFormatter., you'll probably need a bit of trial and error to get it to the right position (and it will depend on the length of the text). However, that's probably actually the best way to do it...
When it comes to PDF writing FME will regard everything that you feed in to one PDFPageFormatter input port as if it's within the same coordinate space. Every PDFPageFormatter input port represents one single "map"
And if I'm using only 1 box, you see a way to obtain a red box with center title inside ?
I changed the box to 0,0 - 100,10 and the point to 45,4
This at least puts the title visually in the center of the box. Unfortunately the text position is the lower left point of the text so you'll have to position that a little to the left and below the actual center of the box, and how far depends on the length of the text as well as the font size you've specified. So those coordinates I used for the point will have to be changed if you decide to use a longer title and/or different font size.
I also set the maintain aspect ratio parameter to yes.