Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Fix the size of an image
ychiu
Hi,
I'm adding an image (logo) to a report (in PDF) and need to keep it within the grid that I've defined. I understand in html we can specify just the width and the browser will resize the image keeping the ratio of length/width. How do we do this in the birt report designer? I tried fixing the lenth and/or width and didn't get the desired effect. The image is either exanding beyond the size of the grid or getting chopped off.
Any help would be greatly appreciated.
Thanks,
Yuan
p.s. - Also, I'm using Birt 2.2.1. Thx.
Find more posts tagged with
Comments
ychiu
Has anyone used the image scale-to-item setting to confine an image within a cell in a grid, while still maintaining the aspect ratio? It appears the size parameter can only be set after an image has been added to the cell. By then, it's already assumed the default "size-to-image" parameter and expanded the cell. I must be missing something.
Thanks,
Yuan
p.s I'm using BIRT version 2.2.1
Virgil Dodson
Hi Yuan,
Have you tried using these steps:
1. add the image,
2. change the size to 'scale-to-item' in the advanced properties
3. make the image smaller to fit within your grid (it will look distorted for now)
4. resize the grid as appropriate (I assume column width for now)
5. resize the image width
6. then in advanced properties, delete the entry for height.
When you run this, the width will stay constant, but the height will adjust to be the correct proportions for the original image.
If the row is the constant size you are working with then:
5. resize the image height
6. then in advanced properties, delete the entry for width.
When you run this, the height will stay constant, but the width will adjust to be the correct proportions for the original image.
Does this get you closer?
ychiu
Thanks for the response.
I tried various scenarios but may just have missed the specific sequence you specified. I tried some sequences w/o an image and specified similar parameters on the broken image.
I'll try your suggestion first thing when I get back to work tomorrow and report my findings.
Thanks,
Yuan
ychiu
Awesome! It worked when I tried the sequence you suggested. It makes sense now that I think of it.
Thanks,
Yuan
ychiu
I guess it didn't work after all - I didn't look carefully.
So, if I fix the height and leave the width out (while keeping specifying "scale to item"), the image takes the full height and scales the image accordingly even if it means clipping a portion along the width. The desired behaviour is to make the image "no taller" than the specified height while maintaining the aspect ratio.
So, if the image is 400pix x 800 pix and the cell is only 200 pix x 200 pix, the image should be reduced to 100 pix x 200 instead of 200 x 400 (w/ half of it clipped). In the example, I tried setting height=200,width=blank, as well as heigth=blank, width=blank.
Is this sort of scaling supported? If so, how would I configure the image to stay within the confines of the cell while still maintaining the aspect ratio.
Thanks,
Yuan
al91206
Just thought I would add some tags to this solution for people searching messageboard. This fixed my problem for exporting report content to PDF. The image size increased, but by using the settings mentioned above it now looks great.
Thanks,
Al