Save to PDF: charts in wrong orientation

When saving an Excel file to PDF, sometimes charts are “printed” in the wrong orientation, causing them to be squeezed. For example, a chart set up to print in landscape instead prints in portrait. Is this a known issue? Any help would be greatly appreciated.

Thanks!

Hi,

Thank you for considering Aspose.

Please share your template file which is causing the problem and we will check the issue soon.

Thank You & Best Regards,

Attached please find the Excel document giving us issues.

Thanks!

Hi,

Thanks for providing us the template excel file.

Yes, we found Aspose.Cells for .NET inserts some extra white space for all the chart Sheet Types, we will look into it and get back to you soon.

I think you can fix it add a few lines of code, see the following sample code below (I have tested and it works) :

Sample code:

Workbook excelWorkbook0 = new Workbook();

excelWorkbook0.Open(@"f:\test\Nielsen+Ratings+5-10-09.xls");

for (int i = 0; i < excelWorkbook0.Worksheets.Count; i++)

{

excelWorkbook0.Worksheets[i].PageSetup.Orientation = PageOrientationType.Landscape;

}

excelWorkbook0.Save(@"f:\test\outNielsen+Ratings+5-10-09.pdf", FileFormatType.Pdf);

For further reference, please check the documentation topics:

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/setting-page-options.html

http://www.aspose.com/documentation/file-format-components/aspose.cells-for-.net-and-java/setting-print-options.html

Thank you.

Hi,

Yes, we found Aspose.Cells for .NET inserts some extra white space for all the chart Sheet Types, we will look into it and get back to you soon.

Please try the attached version v4.7.1.13, we have fixed this issue.

Thank you.

Thanks, this worked great for the orientation issue. However, if you look on page 8 of the resulting PDF, you’ll see the text labels running over into one another. In the original Excel charts, the font sizes for these labels are set very small to prevent this overlap from happening. Can this be resolved?

Thanks again.

Hi,

Thank you for considering Aspose.

We have found your mentioned issue after an initial test. We will look into it and get back to you soon.

Thank You & Best Regards,

Hi,

Please try the attached version, we have fixed/enhanced it.

Thank you.