Convert HTML to PDF API method of Aspose.HTML Cloud API is not working

Hi,

We’re considering using Aspose.HTML.
I tried the api reference, but when I tried running the request url I got the following error:
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a tag within a “web.config” configuration file located in the root directory of the current web application. This tag should then have its “mode” attribute set to “Off”.

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the “defaultRedirect” attribute of the application’s configuration tag to point to a custom error page URL.

What am I doing wrong? Thanks, Yishay

@yishayh

Thank you for contacting Aspose Support.

GET /html/convert/pdf API is working perfectly fine and we are not able to reproduce the said error. You may test the API using following cURL example:

// First get Access Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/oauth2/token" \
-X POST \
-d 'grant_type=client_credentials&client_id=0B17F60A-6D69-426B-9ABD-79F35A6E9F7B&client_secret=53b8b19adffa41a3e87dbbd8858977ae' \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
  
// cURL example for HTML to PDF Conversion
curl -v "https://api.aspose.cloud/v1.1/html/convert/pdf?sourceUrl=https://www.le.ac.uk/oerresources/bdra/html/page_01.htm" \
-X GET \
-H "Content-Type: application/json" \
-H "Accept: multipart/form-data" \
-H "Authorization: Bearer 1ymX9ofuL8Ifg0ATfvq8L_oDo7OOCEfe5Dl16uGGwAsMn-kPhvW5QEvaKYcWIiipGCyWj_rraURa-mWW-AKej54_aFwb3wz1cq87MySFVKoZ-S7Smaz8pMxntuyKnHhYgQTH_nUTwfej-QbXULkd1oyqEaG2USoxF_u3ZF6Qn-gmoCqNVpZ2trx3Sm9Z_JE7AYo6VwAwW1uKELj3UeaI1qT1G7tSqVp8SQx8CaUR4lOdchfT58yYBgBOlozz0j5jWo_KPPCz9JgBY6mmjt0yk1hX8xtDvF5cY4UQU56t4TRfKSWboV-r54A3XTrYwjE9imJyMmZTO2N356yn5a3lA7cgOmrgOP2BjF_sAmIne_B2SBKHStU35Fl2rcJHuCmC4DsEsDvephtQ58URScYXseJ5MHMcIl1j_XFUOgwBC3wszOt_" \
-o testpage4_embcss.pdf

You can also test the API directly in Swagger UI.

Should you need any further information, please feel free to contact us.

Hi Mateensajjad,

I tried your example, the url I got from the swagger was incorrect, your urls worked perfectly.
We still have a problem, we’re trying to pass in sourceUrl a url that include query parameters (i.e sourceUrl=https://bbb.com/aaa?id=fdfdf
I got “Failed to parse URL.” error.
What am I doing wrong?

Thanks,
Yishay

@yishayh

We are investigating the issue with a URL that contains query parameters. We have logged the issue HTMLCLOUD-440 in our internal tracking software and will update you about our findings soon.

@yishayh

We have already fixed your above reported issue. Please try latest version of Aspose.HTML Cloud API and feel free to contact us in case of any issue.