I’m using the .Net PDF generator, and I’m trying to create a landscape page. When I run the following, i get a null exception. If I swap the page height and width, the code works.
MemoryStream ms = new MemoryStream(); Aspose.Pdf.Generator.Pdf pdf = new Aspose.Pdf.Generator.Pdf(); Aspose.Pdf.Generator.Section section = pdf.Sections.Add();
Thank you for sharing the source code. We have found your mentioned issue after an initial test. We will further look into the details of this problem and notify you via this forum thread regarding any update against your reported issue.
I am pleased to share that the issue reported earlier has been resolved and its resolution will be included in upcoming release version of Aspose.Pdf for .NET 7.8.0. Furthermore, I would also suggest you to use new DOM approach and use Document class to generate the PDF file. You may try using the following code snippet to accomplish your requirement.