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

Free Support Forum - aspose.com

Error when converting PDF to XLS

I need to use aspose.pdf for .net to convert the PDF file to XLS file and generate an exe file, but I reported an error while running,The specific contents of error reporting are:image.png (7.3 KB)

@nuanshouxin

The error seems related to file existence. Would you kindly make sure that you are passing correct file path into Document constructor. In case you still face any issue, please share your sample PDF document with us. We will test the scenario in our environment and address it accordingly.

I believe my PDF file exists, the error report means my XLS file does not exist, but XLS is the output file, he said my XLS file does not exist, and I also tried to build a same path.xls files, still an error, this error occurs only on the part of the machine, other machines won’t appear this problem, let me a headache to find reasons for this

@nuanshouxin

Would you kindly share a sample console application which is able to replicate the issue. We will test the scenario in our environment and address it accordingly.

I can’t upload the exe file to here. How should I send it to you?And I have tested that only some machines will appear. I can directly provide you with c# code:

*using System;
using System.Collections.Generic;
using System.Text;
using Aspose.Pdf;

namespace PdFToXlsModel1
{
class Program
{
static void Main(string[] args)
{
Document pdfDocument = new Document(args[0]);
//Aspose.Pdf.
// Instantiate ExcelSave Option object
Aspose.Pdf.ExcelSaveOptions excelsave = new ExcelSaveOptions();
// Save the output in XLS format
pdfDocument.Save(args[1], SaveFormat.Excel);
}
}
}*

@nuanshouxin

Please try saving document as following and if you still face any issue, please share your sample application in ZIP Archive format.

Document pdfDocument = new Document(args[0]);
[//Aspose.Pdf](https://aspose.pdf/).
// Instantiate ExcelSave Option object
Aspose.Pdf.ExcelSaveOptions excelsave = new ExcelSaveOptions();
// Save the output in XLS format
pdfDocument.Save(args[1], excelsave );

Hello, my problem has been solved.I found out why: the PDF and XLS parameters were reversed when they were sent to me.Thank you very much for your reply

@nuanshouxin

It is good to know that you have managed to resolve your issue. Please keep using our API and in case you need further assistance, please feel free to contact us.