Free Support Forum -

Convert Excel Spreadsheet to PDF with cURL using Aspose.Cells REST API

I am trying to export an excel spreadsheet to PDF using save options but I am constantly getting errors.

I have downloaded the sample app from Aspose cells for cloud Github and this is also throwing an error.

I am using the DotNet samples, and when I run the ConvertWorkbookWithAdditionalSettings method I get a error saying “Bytes to be written to the stream exceed the Content-Length bytes size specified.”

Even using the cUrl sample from Aspose cells API documentation gives an error.

Can you please let me know what is wrong?



Thank you for contacting support and sharing details.

We are able to reproduce this error at our end and trying to fix it at the earliest. We will update you in this thread once this error is fixed.

I am pleased to inform you that the error has bee fixed. Please update your local Aspose.Cells for Cloud Git repository before running ConvertWorkbookWithAdditionalSettings example. Once you rebuild project, Aspose.Cells NuGet package will automatically be updated to v1.0.10.

I’m still having issues with the straight web call using this function. Again using the samples from your website:

This works:
curl -v “” -X PUT -T Book1.xlsx -H “Content-Type: multipart/form-data” -H “Accept: multipart/form-data” -o Book1_out.pdf

But simply adding the -d paramter causes it to fail:
curl -v “” -X PUT -T Book1.xlsx -H “Content-Type: multipart/form-data” -H “Accept: multipart/form-data” -o Book1_out.pdf -d “{ “CalculateFormula”: true, “CheckFontCompatibility”: false, “Compliance”: “None”, “OnePagePerSheet”: false, “SaveFormat”: “PDF” }”

The error received is 400 Bad request


We apologize for the inconvenience. is a multipart request. So cURL example should be as follows:

curl -v "" \
-X PUT \
-F "Sample_Book2.xls=@Sample_Book2.xls;type=application/" \
-F 'json={"CalculateFormula": true, "CheckFontCompatibility": false, "Compliance": "None", "OnePagePerSheet": false, "SaveFormat": "PDF"};type=application/json' \
-H "Content-Type: multipart/form-data" \
-H "Accept: multipart/form-data" \
-o Sample_Book2.pdf

Should you need any further information, please do not hesitate to contact us.