I'm using Spire.PDF to convert HTML into PDF, but when the html is too wide, it cuts out the parts it can't contain/constrain.
I'm using the default code supplied on your website. Is there a way to constrain/resize the HTML to fit on A4 pdf?
PdfDocument doc = new PdfDocument();
PdfHtmlLayoutFormat htmlLayoutFormat = new PdfHtmlLayoutFormat();
htmlLayoutFormat.IsWaiting = false;
var settings = new PdfPageSettings();
settings.Size = PdfPageSize.A3;// set the page size accordingly.
Thread thread = new Thread(() =>
{
doc.LoadFromHTML(fileName, false, settings, htmlLayoutFormat);
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
doc.SaveToFile(resultName, FileFormat.PDF);