Copy link to clipboard
Copied
I am working on an azure function in which I need to convert PDF to Excel. I am using Adobe PDF Tools API for the conversion. The PDF is in my azure storage account I access it using datalake file client and read the content in memory stream. Then I use the API and the code is shown in the picture.
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? Thank you in advance
Copy link to clipboard
Copied
I'm not familiar with C# so I'm just guessing here but I think you can remove GetMediaType() from the line starting with FileRef.
Copy link to clipboard
Copied
But according to the documentation, the CreateFromStream method does not work without the GetMediaType() parameter.
Copy link to clipboard
Copied
In this sample usage, it doesn't seem to be required... a media type is required but is defined by
ExportPDF.SupportedSourceFormat.pdf
See below.
input = PDFToolsSdk.FileRef.createFromLocalFile('test/resources/PDF.pdf', ExportPDF.SupportedSourceFormat.pdf);