Got a new one for me - 7 subsidiaries - logo files...
# advancedpdf
k
Got a new one for me - 7 subsidiaries - logo files are roughly the same size. On 2 of the subsidiaries - the image dimensions are 3285 by 739, and on the others they are 1744 by 915. For whatever reason, the logo scaling on the image that is significantly wider is coming up just.. wrong. It's resizing the height to be a quarter of the other logo height. I'm scaling the images by applying a straight % adjustment - so it isn't like it's trying to fit them into the same size box (in fact the reason I'm even looking at it is when I set the scaling of % of the logo that's printing tiny - it makes the other logo print way too large). It's also making the logo that should be wider half the width of the other logo. I'm just confused. All files are JPG. File DPI is the same. Here is how I'm adding the image:
Copy code
<img src="${subsidiary.logo@Url}" style="float: left; margin: 7px; width: 10%; height: 10%;"/><br />
anyone see what I am doing inherently wrong here? The only difference I can see on the ones is that they are printing with the "clear" instead of white in the background, but I can't imagine that causing this.
s
I've had trouble with getting different image sizes working in the same templates before. Ultimately, I modified some of our logo files so that they are all the same ratio of width : height by adding some blank space around the image, then used a fixed width and height in pixels, rather than a percentage. That had the benefit of making the layout consistent (each logo occupied the exact same space). Not sure if that's an option you'd be able to consider.
a
Yeah same experience as Scott here - further I've found trying % modifiers on <img /> tags in Advanced PDF has almost never worked how I expected it to, and I've abandoned trying it. I always now use software to resize images to be close together, usually matching the height of one another so I avoid adding code for each subsidiary like you mention.
s
Something very weird certainly happens with the % declarations, and I gave up on trying to understand it. Even when I produced images using the same software and the same DPI, it still behaved inconsistently. 🤷
My best guess is that the layout (the table / row / cell properties) affects the image and can override the width and height of the image when specified in percent, or that the percent may be calculated based on available space in the layout, rather than the image size
k
Yeah.. I even resized the images and the % thing wasn't working
Alright, well, learning experience for me I guess. The white space plus hard coding width/height worked well enough
Not really a fan of how it prints because oddly positioned white space, but. I'll live