This is some what related to my post in
http://www.aspose.com/community/forums/656355/changing-page-orientation-to-landscape-does-not-change-page-size/showthread.aspx#656355
When I try to add html to a pdf document using the code below. The generated pdf margin gets messed up and the html startes at a negative top margin. I guess the problem is the page width and height remain the same after changing page orientation to landscape.
It works fine in portrait.
private static void Addhtml()
{
Aspose.Pdf.License licence = new Aspose.Pdf.License();
licence.SetLicense(@"C:\Projects\test\AposeTest\Aspose.Total.lic");
string html = @"
";
asdasd
ASDASd sadasd
HtmlLoadOptions htmlLoadOptions = new HtmlLoadOptions();
Document doc2 = new Document();
Document doc = new Document(new MemoryStream(Encoding.UTF8.GetBytes(html)), htmlLoadOptions);
var previous = doc2.Pages.Count;
doc2.Pages.Add(doc.Pages);
doc2.PageInfo.IsLandscape = true;
doc.PageInfo.Margin.Top = 100;
doc.PageInfo.Margin.Left = 100;
doc2.Pages[previous + 1].Paragraphs.Add(Header("test"));
//Save PDF file
doc2.Save("C:\\temp\\HTML_Sample.pdf");
}