I found this page here explaining how scaling works with XSL-FO.
Essentially, this is the snippet that I used to make it work:
<fo:external-graphic
src="url('...')"
width="100%"
content-height="100%"
content-width="scale-to-fit"
scaling="uniform"
xsl:use-attribute-sets="img"/>
I found that width="100%"
was the missing piece in your own attempts. Hope this helps future visitors.
Defining the exact height and width of the "viewport": .
If you don't specify the viewport then FOP won't know what to scale your image to.
It can guess, but not know precisely.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With