Hi Joshua,
Thank you for evaluating
Syncfusion products.
While converting a
webpage, the width can be maintained at PdfPage size using the following code
snippet:
PdfUnitConvertor convertor
= new PdfUnitConvertor();
float width =
convertor.ConvertToPixels(page.GetClientSize().Width,
PdfGraphicsUnit.Point);
using (HtmlToPdfResult result = html.Convert(@"http://www.google.com", ImageType.Metafile, (int)width,
-1, AspectRatio.KeepWidth))
{
result.Render(page, metafileFormat);
}
This makes the webpages
with larger width to be drawn to the full page without any cut. Pages with smaller
width will be drawn as it is in PDF. Could you please try the above code
snippet and let me know?
Regards
Geetha
Hi Joshua,
Thank you for the details.
You can easily adjust the
margins using the following code snippet:
PdfDocument document =
new PdfDocument();
document.PageSettings.Margins.All = 18;
PdfPage page = document.Pages.Add();
I could see that margin
set to “18” yields output similar to you current component. Please try this and
let me know if you have any other questions.
Regards
Geetha
Hi Joshua,
Thank you for the update.
Regards
Geetha