Hey, I am using pdfmake to generate all of my pdf files, very good work. But in recent research, I am trying to control the position of the image by x, y dimension. I can do that in pdfkit, but it doesn't work in pdfmake. The example is here.
{ image: 'data:image/png;base64.......', 50, 100, fit:[80,80] }
This is work in pdfkit and move the image to the position I want. But there is an error when I do this in pdfmake. Any good suggestions?
Example with absolute position:
var dd = {
content: [
{
image: 'sampleImage.jpg',
fit: [80,80],
absolutePosition: {x: 50, y: 100}
}
]
}
Thank you very much, that's the answer!
I was also trying this for a footer text and it seems that the absolutePosition is relative to the size of your footer space, set from pageMargins: [50, 200, 20, 150]
So the footer has a size of 150, thus x:50 and y:100 will place it at the bottom and has a remaining vertical space of 150-100=50 for your text.
Hopes this helps and is clear enough
Most helpful comment
Example with absolute position: