We can generate PDF files using the simplest API of Aspose.Pdf but if you want to generate PDF files from XML then the white spaces between each lines in the text segment are ignored by Aspose.Pdf .
But developers can preserve the white spaces between lines according to their requirement. This is simply achieved by setting the IsSpaced property of Text object to true.
To illustrate it, an example is given below that adds three lines of code into a PDF document preserving the white spaces between each line of code.
Example:
[XML]
<Text IsSpaced="true">
<Segment>
Section sec1 = pdf1.Sections.Add();
sec1.PageInfo.Margin.Left = 110;
sec1.PageInfo.Margin.Right = 120;
</Segment>
</Text>