private Aspose.Pdf.Table GeneratePage(List<string> cessiondetails)
{
Aspose.Pdf.Table tble = new Aspose.Pdf.Table();
tble.ColumnWidths = "1400";
for (int i = 0; i <= 50; i++)
{
Aspose.Pdf.Row rws = new Aspose.Pdf.Row();
Aspose.Pdf.Cell css = new Aspose.Pdf.Cell();
Aspose.Pdf.Text.TextFragment tf = new Aspose.Pdf.Text.TextFragment("This is long text for landscape,This is long text for landscape,This is long text for landscape,This is long text for landscape,This is long text for landscape,This is long text for landscape,This is long text for landscape,This is long text for landscape,This is long text for landscape,");
css.Paragraphs.Add(tf);
rws.Cells.Add(css);
tble.Rows.Add(rws);
}
return tble;
}
We were able to observe the same issue while using Aspose.PDF for .NET 18.6, in our environment. Hence, for the sake of detailed investigation, we have logged it as PDFNET-44871 in our issue tracking system. We will further look into details of the issue and keep you informed with the status of its correction.
Furthermore, we have used Document.Pages[1].PageInfo Property, in order to set page margins and orientation, because Document.PageInfo Property will going to be removed in future versions of the API and you will need to set PageInfo at page level.
In the code provided, the page size setting should be removed after the landscape orientation setting line
emailPdf.Pages[1].PageInfo.IsLandscape = true;// These lines are not needed.// emailPdf.Pages[1].PageInfo.Height = PageSize.A4.Width;// emailPdf.Pages[1].PageInfo.Width = PageSize.A4.Height;
Or change the page size setting by changing the width with the height