[oXygen-user] Fit an image to half of PDF page

Aman Singh amendraman at gmail.com
Mon Oct 1 00:12:32 CDT 2018


Hi All,

I am new to XSL-FO

I have inserted an image in my XSL-FO using below code:-

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
  <fo:layout-master-set>
<fo:simple-page-master master-name="simpleA4" page-height="30cm"
page-width="21cm" margin-top="0cm" margin-bottom="0.5cm"
margin-left="0.2cm" margin-right="0.2cm">
<fo:region-body/>
</fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="simpleA4">
<fo:flow flow-name="xsl-region-body">
<fo:block-container margin-left="-1%" margin-right="-1%" margin-top="-0.5%
height="50%"">
<fo:block>
<fo:external-graphic src="D:\MainImage.jpg" width="100%" height="15cm"
scaling="non-uniform" content-height="scale-to-fit"
content-width="scale-to-fit"/>
</fo:block>
</fo:block-container>
</fo:flow>
  </fo:page-sequence>

Is this the right way to fit the image half of page size of my PDF? or some
standard way is there?

Thank you,
Rudra
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20181001/184834b4/attachment.html>


More information about the oXygen-user mailing list