The documentation states how to do this in code, but I’d like to set the margins declaratively in the XML/XSL. It’s not clear to me how to set any properties on objects encapsulated on the main object. Like the MarginInfo or PageInfo properties.
Hi,
Thanks for using our products.
In XML, PageSize is not supported and you can only use numbers. The units supported for setting the page size are as follows:
- point
- cm
- inch
Note: In API, only point unit is supported.
Please take a look over the contents of XML file shared below.
[XML]
<?xml version="1.0" encoding="utf-8" ?>
<Pdf xmlns="Aspose.Pdf">
<Section PageWidth="8inch" PageHeight="25cm" >
<Text MarginTop="10" MarginLeft="60" Color="Blue" BackgroundColor="Yellow">
<Segment FontSize="16"> Hello World</Segment>
</Section>
</Pdf>
For more information, please visit the following link Set Page Size and Margins
In case it does not resolve your problem or you have any further query, please feel free to contact. We apologize for your inconvenience.
Hello,
Hi,
Please take a look over the following XML contents in which Page Top, Left and Right margin is specified. More along, you can also find the information on how to set Page Border.
[XML]
<?xml version="1.0" encoding="utf-8" ?>
<Pdf xmlns="Aspose.Pdf">
<Section PageWidth="8inch" PageHeight="25cm" PageMarginLeft="30" PageMarginTop="50" PageMarginRight="200">
<All LineWidth="0.5">
<Text MarginTop="10" MarginLeft="60" Color="Blue" BackgroundColor="Yellow">
<Segment FontSize="16"> Hello World</Segment>
</Section>
</Pdf>
In case you have any further query, please feel free to contact. We apologize for your inconvenience.
Hi Otto,