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

Free Support Forum - aspose.com

Save Format to PDF from Excel Chart issue

Hi


I am trying to convert the Excel sheet attached to PDF file with the following code

I am also attaching the the excel file which needs to convert to PDF, the charts are not exported properly in PDF

string excelFile = “D:\temp\FPA_EnergyQuote JHA Test Company(ZJHT).xls”;

string pdfFile = “D:\temp\FPA_EnergyQuote JHA Test Company(ZJHT).pdf”;
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(excelFile);
//Save the pdf file.
wb.Save(pdfFile, SaveFormat.Pdf);

Please let me know what is wrong in my code.

I am using ASPOSE version 7.3.0.0 .

I am attaching both Excel and generated PDF.

Regards,
Parvati


<span style=“font-size:12.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;mso-ansi-language:EN-US;mso-fareast-language:
EN-US;mso-bidi-language:AR-SA”>

Hi,


I have tested your scenario/ case using your template Excel file (I have to unhide all your hidden sheets in the template file), I converted the file to PDF, it seems to me it renders fine as per the print previews of the different sheets shown in MS Excel. Please try our latest version/fix: Aspose.Cells for .NET v8.0.1.4 and let us know if it works fine.

If you still find any issue, kindly provide some screen shots to highlight the problematic areas comparing your output PDF Vs MS Excel’s original file with charts, we will check it soon.

Thank you.

Thanks for the reply.

The issue was in setting up the font size for tick labels.

If i set the font size as 9, it is coming properly in PDF. but in excel it is showing font size as 3.5 for tick label. how can i set up the font size for ticklabels it should be Arial and size 9

Regards

Parvati

Hi,


To set the CategoryAxis/ ValueAxis ticklabels’ font attributes, you may try:
e.g
Sample code:

Chart chart = workbook.Worksheets[ind].Charts[0];

chart.ValueAxis.TickLabels.Font.Name = “Arial”;
chart.ValueAxis.TickLabels.Font.Size = 9;

Thank you.