Thanks for contacting support.
Please check following code snippet, where I have increased the Page Height, so that all HTML content can be displayed on single page. For your reference, I have also attached an output PDF document.
var loadoptions = new HtmlLoadOptions(dataDir);
loadoptions.PageInfo.Height = PageSize.PageLetter.Height * 2;
loadoptions.PageInfo.IsLandscape = true;
loadoptions.PageInfo.Margin = new MarginInfo(10, 10, 10, 10);
Document doc = new Document(dataDir + "RTT5B-01-03-02-A1(1).html", loadoptions);//MergePDF(docList);
doc.Save(dataDir + "HtmlToPdf_out.pdf");
HTMLToPDF_out.pdf (145.2 KB)
I am afraid that Aspose.Pdf supports no such feature to detect orientation/dimension of the HTML page and please note that it is quite difficult to determine exact height and width of the HTML page, as it depends upon many factors i.e screen resolution, CSS, responsiveness, etc. However as a workaround, you may check the page count of the PDF document (after conversion and before saving), specify its height and width as per your requirement and convert it again.
In case you face any issue while generating desired outputs, please feel free to let us know.
We are sorry for the inconvenience.