Support of max-width css property

1,357 views
Skip to first unread message

Radim Pavlíček

unread,
Jul 8, 2013, 9:23:29 AM7/8/13
to flying-sa...@googlegroups.com
I was wondering whether there is a support for max-width. I've tried it out, but doesn't work. I have following scenario:

I have and image, let's say width = 400 and height=2000, but my pdf file is capable of 200 width and 200 height only. I would need something like max-width and max-height to scale the image down to the height of 200 (my max value) and computed 400/10 =40 width.

Setting either width or height to auto doesn't solve anything for me, because I have both type of images - with large height and weight.

--
Radim

Peter Brant

unread,
Jul 8, 2013, 1:42:22 PM7/8/13
to flying-sa...@googlegroups.com
I'm afraid min/max-width is only supported for block-level elements.  There are special rules for inline-level replaced elements, but they aren't implemented.  You might want to take a look at the replaced element code.  It may be relatively easy to hack something in for the support you need.

Pete




--
You received this message because you are subscribed to the Google Groups "Flying Saucer Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flying-saucer-u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jens Rutschmann

unread,
Jul 10, 2013, 3:50:16 AM7/10/13
to flying-sa...@googlegroups.com
Hi Radim,

At least for wide images (x>y) you can use this:

img {
-fs-fit-images-to-width: 100%;
}

Of course that doesn't help for images that are higher than your PDF page height, though ...

Cheers,
Jens

qiush...@gmail.com

unread,
Aug 21, 2013, 10:57:23 PM8/21/13
to flying-sa...@googlegroups.com
Have you tried to use 'cm' as a unit for the length?

在 2013年7月8日星期一UTC+8下午9时23分29秒,Radim Pavlíček写道:
Reply all
Reply to author
Forward
0 new messages