Hi,
When saving a Workbook as a PDF type, is it possible to save it in landscape mode vs. portrait mode? And if so, could you please provide an example as to how to do it using the APIs? Thank you.
Hi,
Hi,
Well, you may specify each worksheet’s orientation type to landscape in the workbook before rendering to PDF.
e.g
Sample code:
[C#]
var workbook = new Workbook(@"e:\test2\Book1.xlsx");
foreach (Worksheet sheet in workbook.Worksheets)
{
sheet.PageSetup.Orientation = PageOrientationType.Landscape;
}
workbook.Save(@"e:\test2\out1.pdf");
[JAVA]
Workbook workbook = new Workbook("Book1.xlsx");
for (int i = 0; i < workbook.getWorksheets().getCount(); i++ )
{
workbook.getWorksheets().get(i).getPageSetup().setOrientation(PageOrientationType.LANDSCAPE);
}
wb.save("out1.pdf");
Hope, this helps a bit.
Thank you.
Hi,
Hi,
Thank you both.