What's the recommended method for scaling images for use in the generated pdf files?
As I see it we can either scale using imagegen, in the pdf or a combination of both.
I have a block 17cm x 5cm. I must be able to let the user pick 1, 2 or 3 images. If I have more than one image they should be equal in size, resize smallest dimension and cut the other one.
The result should either be on image 17 x 5cm, two images 8.5cm x 5cm or 3 images at 5.6667cm x 5cm (with the last image beeing constrained by 17cm containing block).
Any suggestions? I've tried using image gen and calculating pixels based on dpi, but it does not mot match 100%
I have two block containers - the outer one with correct size and overflow hidden. The inner one a bit bigger. I then resize the images based on dpi, mm and inches conversion using image gen - they will fit more or less and what is outside my goal width will be cut by the outer small block container.
Note that image gen allowupsize may cause confusion when some images does not consume all the expected space.
Well, one part was the ImageGen allowupsize which were specifically set in the imagegen.config with overridequerystring=true. I also have issues changing the DPI so I'm currently stuck to 120, but that's not a problem as of now.
Mainly I was looking for other aproaches, just in case someone had a better suggestion.
Scaling images
What's the recommended method for scaling images for use in the generated pdf files?
As I see it we can either scale using imagegen, in the pdf or a combination of both.
I have a block 17cm x 5cm. I must be able to let the user pick 1, 2 or 3 images. If I have more than one image they should be equal in size, resize smallest dimension and cut the other one.
The result should either be on image 17 x 5cm, two images 8.5cm x 5cm or 3 images at 5.6667cm x 5cm (with the last image beeing constrained by 17cm containing block).
Any suggestions? I've tried using image gen and calculating pixels based on dpi, but it does not mot match 100%
Hi Harald,
What are your source image types? JPEG? Are they all at the same DPI.
In any pixel to CM conversion you aren't always going to get a whole number.
I would have a three way case statement - one for each variation of 1, 2 or 3 images.
if you had 3 images at 200 DPI your pixel width is 1339 this doesn't divide by 3 so you'd have to do the following:
Image 1 - 447px wide
Image 2 - 446px wide
Image 3 - 446 px wide
You'd also have to then do a crop to make sure that they all end up at the desired height.
Does this make sense? I would use imagegen to do these sizing.
Let me know if not.
More or less what I am doing now.
I have two block containers - the outer one with correct size and overflow hidden. The inner one a bit bigger. I then resize the images based on dpi, mm and inches conversion using image gen - they will fit more or less and what is outside my goal width will be cut by the outer small block container.
Note that image gen allowupsize may cause confusion when some images does not consume all the expected space.
So - what is the outcome the scaling just looks wrong - or the images don't match the dimensions you specify?
Perhaps post an example - email it to me if it is confidential.
D
Well, one part was the ImageGen allowupsize which were specifically set in the imagegen.config with overridequerystring=true. I also have issues changing the DPI so I'm currently stuck to 120, but that's not a problem as of now.
Mainly I was looking for other aproaches, just in case someone had a better suggestion.
is working on a reply...