I’m trying to send the contents of a web page to the service and have it render me a pdf stream back…I keep getting 400 errors bad request…I’m using the SDK to handle most of the work…below is a snippet of the code…just sending in a simple html snippet…any thoughts? It’s sending in the content type as json…
You can also use Aspose.Words for Cloud to convert HTML to PDF. Please check Convert Documents|Aspose Words Cloud Docs for more details. Just pass HTML file as input and specify PDF as output format using this example.
Please feel free to contact us in case you have further comments or questions.
Thanks for your reply. Your links take me to converting an existing word document to pdf format. My need is different. For any given URL I am getting the HTML bytes in a memory stream and then calling your method to process them into PDF. I am getting 400 errors.
As an example if I wanted to take the content from http://www.mayoclinic.com/health/asthma/DS00021 and create a good looking PDF from it why does my example fail? I’m getting 400 errors which from what I can tell is that the API doesn’t like the format. Does it have to be a filestream? A stream is a stream right?
You can change the ProcessCommand method according to your requirement and accept memory stream. Please let us know if you find any difficulty in doing so, and we will be glad to alter this method for you.
Thanks for your inquriy. Please check following documentation link for updated code for HTML to PDF conversion using Aspose.Pdf for Clouds with REST API. Hopefully it will help you to accomplish the task. However if you face some issue then please share your source document and error details, so we will look into it and will guide you accordingly.