I am trying to consume the API from MaShape ( https://www.mashape.com/mazira/PDF to PNG Rasterizer - convert PDF documents to images#!documentation ) and i am got:
โAn error occurred while making the HTTP request org.apache.http.NoHttpResponseException: The target server failed to respondโ
Join in the discussion - add comment below:
Hmm, i understand.
Yeah, the params are pretty high, but i need then.
Is there another way to send the response to an email? This is temporary, just to test the service.
I will add that if Mashape is still timing out when processing the pages individually, there are a few things we can try. Your
res
andquality
params are pretty high, and reducing them will speed up the processing. If this is not acceptable, we may have to implement a session endpoint, where you can fire off the conversion and then ping a new URL to detect when the processing is complete.This error occurs when the Mashape proxy times-out and assumes it is getting no response from the server. This can happen when processing multiple pages at high resolution. I believe that Mashape recently reduced its timeout, exacerbating the problem.
There is a way to process a PDF page-by-page, which should avoid the timeout issue. This is not yet documented in Mashape, but I will describe it below:
If the
output
parameter is not specified, it will assume that you are processing page-by-page, and will immediately return a JSON array of relative page URLs. You can then send individual GET requests to these URLs, along with theres
,quality
, andpng8
parameters as query parameters. Note that in this mode, it is not necessary to sendres
,quality
, orpng8
along with the original POST request.I will update the Mashape documentation to reflect this additional option.
My files generaly have just one and no more than two pages.
For now i prefer to send the file cause i am testing.
So, how can i send you the files?
If you are willing to send me the file, I can send you a result that I pass through manually. Otherwise, we should have a task-oriented API, that wonโt time out, by the end of the day.