I am trying to generate a pdf file using Aspose.pdf. I have a problem with the page margins. Even after setting proper page margins the table that I am displaying hits the right end of the page and leaves a lot of space on the left in the begining of the page. My code setting the page margins is pretty straight forward as shown below:
//The values of all these margins is 50.0
_pdfdocument.PageSetup.Margin.Right = _rightMargin;
_pdfdocument.PageSetup.Margin.Left = _leftMargin;
_pdfdocument.PageSetup.Margin.Top = _topMargin;
_pdfdocument.PageSetup.Margin.Bottom = _bottomMargin;
When I debug the code and look at the PageSetup object I see two MarginInfo objects as part of it. One MarginInfo object has all the margin variables with correct values i.e. 50.0 as set by me in the code whereas the other one shows all the margin values as 0.0. I am not sure why it contains two margin objects instead of just one.
Also, please note that I am generating this pdf in streaming mode i.e. I do pdf.Close() in the end. I am attaching the pdf file with this post.
Any help on this will be highly appreciated.