Margin not applying to page while converting HTML to PDF

Hi Team,
We are using Aspose PDF for converting HTML to PDF. We want PDF to have certain margins and Page size.
We are setting page size as Letter and margin as 0.5 inch. Its not applying margins for page.- There’s a lot of margin on the page than specified.

Please find the attached output PDF and code we are using.
sampleCode.7z (197.5 KB)

@pthube
Do I understand correctly that you expected margin to be 0.5 inch size?
It seems that in case you set margin to 0 you’ll get expected result - it seems that it’s a minimal possible one (here’s for LeftMargin = 0)
image.png (38.7 KB)

and this is result when you set all margins to 0
image.png (27.5 KB)

Thank you for your response. It solved our issue.
We are trying to apply fonts for our formatted text from CSS- using this code snippet

TextFragmentAbsorber tfa = new TextFragmentAbsorber(@"");
tfa.TextSearchOptions.IsRegularExpressionUsed = true;
doc.Pages.Accept(tfa);
TextFragmentCollection tfc = tfa.TextFragments;
foreach (TextFragment tf in tfc)
{
    tf.TextState.Font = FontRepository.FindFont("OpenSans");
}

But the output PDF does not have font as per our CSS.
Can you point out the resource where we can successfully apply fonts as per CSS.

output 1.pdf (115.9 KB)

@pthube
Let me nvestigate a bit - I’ll write as soon as I find out how this can be resolved

@pthube
I tried suggested code and recieved the following result
sample_html_out.pdf (175.0 KB)
It appears to be normal, but font is indeed isn’t applied, it’s Times New Roman used instead
However in your case OpenSans is applied
image.png (66.4 KB)

Some problems can be resolved with version update, if you not using the latest version you can try to resolve issue this way
Just to clarify, you are using the suggested code snippet after you converted the original html?