I need to convert PDF to Excel as part of a current Azure function that I'm working on. To convert, I'm using the Adobe PDF Tools API. The PDF is in my Azure storage account, and I can read the content in the memory stream using the Data lake file client. I utilize the API after that, and the code is displayed in the image.
Credentials credentials = Credentials.ServiceAccountCredentialsBuilder()
Adobe.DocumentServices.PDFTools.ExecutionContext executionContext = Adobe.DocumentServices.PDFTools.ExecutionContext.Create(credentials);
ExportPDFOperation exportPdfOperation = ExportPDFOperation.CreateNew(ExportPDFTargetFormat.XLSX);
FileRef sourceFileRef = FileRef.CreateFromStream(memoryStream, ExportPDFOperation.SupportedSourceFormat.PDF.GetMediaType());
FileRef result = exportPdfOperation.Execute(executionContext);
Now, when I run this, I get the following error:
"Error response received for the request: An error occurred while sending the request. The response ended prematurely."
The code is in C#.
Can someone please help?