-
Hi! First of all, thank you very much for sharing this library! I have question. Is it possible to position a text in front of an image? I would like to render a image in a block and write a text over this image in specific position. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Okay! I think I figured out here. Just need to use negative padding: container.Stack(stack =>
{
stack.Element()
.Debug()
.Image(headerImage);
stack.Element()
.Debug()
.PaddingTop(-130)
.PaddingLeft(80)
.Stack(x =>
{
x.Element().Text("Line 1");
x.Element().Text("Line 2");
x.Element().Text("Line 3");
});
}); Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello, This is a really good question :) And I have great news for you! In release 2021.5, I am preparing a new component called Layers. This component is designed specifically for your needs, that is it allows you to put elements behind and above the main layer. You may want to make a try with the released alpha version. However, please note that the new release will include a couple of minor breaking changes that are yet not documented. Take a look at the last test in this file: https://github.com/QuestPDF/library/blob/2021.05/QuestPDF.Examples/ElementExamples.cs // This is a small concept, how such functionality may work:
container.Layers(layers =>
{
layers.Layer().Image(headerImage);
layers.PrimaryLayer().Stack(x =>
{
x.Element().Text("Line 1");
x.Element().Text("Line 2");
x.Element().Text("Line 3");
});
}); If you have any questions or suggestions, please let me know. I am still trying to figure out proper namings here and there :) |
Beta Was this translation helpful? Give feedback.
Okay! I think I figured out here. Just need to use negative padding:
Thanks!