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

Free Support Forum - aspose.com

File to pdf

The attached file shows the xls file and the output pdf file. I'm simply doing a workbook open on the excel file, then workbook save as pdf. The bottom of the chart border is missing in most cases. I've tried resizing the charts, but I shouldn't have to since it looks fine in print preview in Excel. This is using 4.9.1.1.

Rick

Hi Rick,

Well, I don’t find the issue using v4.9.1.1 with your template file.

Here is my sample code and attached is my output pdf file. Could you make sure that you are using v4.9.1.1. Also, kindly tell me which chart is having problem. Surely I can see your provided output pdf file has an issue with its very first chart in the first page, but in my case (as you can see my output pdf file) there is no issue with it at all.

Sample code:

Workbook excelWorkbook0 = new Workbook();
excelWorkbook0.Open(@“e:\test\file2pdf\x671.xls”);
excelWorkbook0.Save(@“e:\test\file2pdf\outx671.pdf”);

Thank you.

My code is below, it may be the zoom factor. strName is "x671.xls".

Rick

Using fsworkbook As FileStream = New FileStream(strName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)

workbook.Open(fsworkbook, FileFormatType.Excel97To2003)

workbook.CalculateFormula()

nValue = workbook.Worksheets("Main").Cells("D33").DoubleValue

nValue2 = workbook.Worksheets("Main").Cells("M33").DoubleValue

Dim dtDate As Date = workbook.Worksheets("WeeklyData").Cells("A66").Value

strDate = dtDate.ToShortDateString

workbook.Worksheets("WeeklyData").IsVisible = False

workbook.Worksheets("MonthlyData").IsVisible = False

Dim strMyDoc As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)

workbook.Worksheets("Main").PageSetup.IsPercentScale = True

workbook.Worksheets("Main").PageSetup.Zoom = 75

'Setting the number of pages to which the length of the worksheet will be spanned

'workbook.Worksheets("Main").PageSetup.FitToPagesTall = 1

'Setting the number of pages to which the width of the worksheet will be spanned

'workbook.Worksheets("Main").PageSetup.FitToPagesWide = 1

strName = strMyDoc & "\x671.pdf"

workbook.Save(strName, FileFormatType.Pdf)

End Using

Hi,

I am still unable to reproduce the issue using your code.

Attached is my output pdf file using your new code provided here.


Thank you.