Adobe PDF tools in Azure functions

New Here ,
Apr 05, 2021 Apr 05, 2021

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.

 

Aneri5F8D_1-1617614477295.png

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

TOPICS
PDF Services API

Views

55

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 05, 2021 Apr 05, 2021

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

But according to the documentation, the CreateFromStream method does not work without the GetMediaType() parameter.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 05, 2021 Apr 05, 2021

Copy link to clipboard

Copied

LATEST

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);

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines