How to set margin in Html to aspose with aspose.pdf

Hello support,

I am using aspose.pdf (Aspose.PDF.Drawing 23.5.0). i am facing issue while setting up margin while generating pdf. I have tried many ways to resolve the same. mentioning some of the hacks

in c#:

  1. HtmlLoadOptions options = new HtmlLoadOptions { IsEmbedFonts = true };
    options.PageInfo.Margin = new MarginInfo(10, 10, 10, 10);

  2. foreach (var item in pageCollection)
    {
    item.SetPageSize(PageSize.PageLegal.Width, PageSize.PageLegal.Height);
    item.PageInfo.Margin.Left = 10;
    item.PageInfo.Margin.Right = 10;
    item.PageInfo.Margin.Top = 10;
    }

In HTML:
@page mainpage {
/* Page margins are set here. */
margin - top: 0.15 in;
margin - right: 0.15 in;
margin - bottom: 0.15 in;
margin - left: 0.15 in;
}

    div#wrapper {
        page: mainpage;
    }
  #wrapper {
    width: 100%;
    margin: 20px auto;
    padding: 20px;
    border: solid 1px #8F8F8F;
	page: mainpage;
  }

But it is not working for me i want to remove margin as highlighted with red in attached image. Can you please help for the same?

and i want to place 3 lines of html in footer in each and every page. can you please guide us for the same as well.PDF_SS.png (2.2 KB)

Thanks in advance.

@vbhattsynoptek
When you convert HTML->PDF, then you need to set HtmlLoadOptions.PageInfo.Margin (if I understood your question correctly).

@sergei.shibanov correct