Forum How do I...?

@bottom-right - image not aligning

Anonymous
I want an image to align to the bottom right of every page. My code is simple and is as follows

@page {
size: a4;
margin: 21mm;
padding: 8mm 0 5mm;
border-bottom: thin solid black;

@bottom-right {
content: url(Logo.jpg);
}
}

No matter how many different aligns I put in or try and set the width of bottom-right, bottom-left and bottom-center, the image just won't align to the right!! The code above aligns it to the left!! I have managed to get it halfway across the bottom using widths but I want it to the right. Please help!!
mikeday
This is a weird little issue that can be solved using the following workaround: add some text to the content of the margin box, even empty text will work, and the image will then be correctly aligned on the right.
@bottom-right {
    content: "" url(Logo.jpg);
}

The problem seems to be caused when the content only contains an image, which then gets treated as a block and text-align is not being applied. We will investigate the issue and try to make it behave more reasonably.

Thanks for reporting the issue! :)
Anonymous
thanks that does fix it except now i have another little bug to do with this issue. I have two images, one a bigger image, one a smaller image. It works with the bigger image but doesn't with the smaller image?!? if i have the following code (Logo.jpg being the bigger image)

@bottom-right {
content: "hi" url(Logo.jpg);
}

then it works fine and hi shows up, but if i change it to Logosml.jpg then neither the hi nor the image appears even though the file of the pdf increases by the size of the image (as opposed to not including the image). Any ideas??
mikeday
Does Logosml.jpg appear elsewhere in the main body of the page? There is an issue that we are currently investigating which occurs sometimes when an image appears in a header or footer as well as in the page content.

The other thing to check for is that Prince is not producing any error messages when the image is loaded.
Anonymous
prince isn't outputting any error msgs on the command line. is there an error log or something that it might be outputting other error messages to? No it isn't appearing in the body, it's not appearing anywhere! I can put the image in the body and it appears fine, just not in the page footer.
mikeday
That's strange; would you be able to email me a test document and image that causes the problem so that we can analyse it here?
Anonymous
Yeah sure. What email address would you like it sent to?
mikeday
prince(at)yeslogic.com, thanks!

(Replacing @ with (at) in an attempt to deter spam bots and such).
mikeday
The text-align issue has been fixed in Prince 5.1 rev 3, so that images within page margin boxes will no longer require the empty text hack to align them correctly to the left or right.
dsmith
Edit: nevermind, upon further examination Prince appears to be working properly.

Edited by dsmith