We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Landscape PageSetup on PDF produces invalid dimensions

A document produced using Aspose.Cells 23.2 produces a document that has invalid dimensions on Aspose PDF 23.2.

I've created the following test case, which produces a document in memory:

var workbook = new Workbook();
        var worksheetIndex = workbook.getWorksheets().add();
        var worksheet = workbook.getWorksheets().get(worksheetIndex);
        workbook.save("test.pdf", new PdfSaveOptions());
        var doc = new Document("test.pdf");
        var page = doc.getPages().get_Item(1);
        System.out.println(String.format("%f x %f", page.getPageRect(true).getWidth(), page.getPageRect(true).getHeight()));
        System.out.println(String.format("%f x %f", page.getPageInfo().getWidth(), page.getPageInfo().getHeight()));

The document produces has PageRect properly set, but the PageInfo dimensions remain on Portrait mode. Even worse, the dimensions provided on both of them area different.


792.000000 x 612.000000
595.000000 x 842.000000

Is there a way to normalize the dimensions on the produced PDF?


Thanks for the sample code segment and details.

I have evaluated your issue a bit. It seems your issue is related to Aspose.PDF, so I am moving your thread to respective forum where one of our fellow colleagues from Aspose.PDF team will evaluate and assist you soon there.