instant PDF

FREE
By yogthos | Updated לפני 5 ימים | Data
Popularity

9 / 10

Latency

207ms

Service Level

100%

Health Check

N/A

Back to All Discussions

How to get url of the pdf created?

Rapid account: Teamriyaa
teamriyaa
לפני 9 שנים

I am using following code inside my android app to generate pdf :

HttpPost httppost = new HttpPost(“https://yogthos.p.mashape.com/”);
httppost.setHeader(“X-Mashape-Key”, “PWayfxCc28mshmb22rMFd8MDmNsWp1TXxTWjsnzgayj4Iy5sMx”);
httppost.setHeader(“Content-Type”, “application/x-www-form-urlencoded”);
List <NameValuePair> nvps = new ArrayList <NameValuePair>();
nvps.add(new BasicNameValuePair(“json-input”,"[{}, [“paragraph”, “some text”]]"));
AbstractHttpEntity ent;
ent = new UrlEncodedFormEntity(nvps);
httppost.setEntity(ent);

HttpResponse response = httpclient.execute(httppost);
InputStream is = response.getEntity().getContent();

How can I download the pdf file? Kindly help.

Thanks.

Rapid account: Luca R 91
luca_r91 Commented לפני 7 שנים

How do I open the return pdf with python-html (jinja2)?

I send the response in post function(data).

python:
self.response.write(response.body) //response instantpdf {‘content-type’: ‘application/pdf’, ‘date’: ‘Fri, 23 Jun 2017 10:01:56 GMT’, ‘connection’: ‘keep-
alive’, ‘server’: ‘Mashape/5.0.6’, ‘content-disposition’: ‘filename=document.pdf’, ‘content-length’: ‘860’, ‘via’: ‘1.1
vegur’}

and in js file, in post, i create
var file = new Blob([data], {type: ‘application/pdf’});
var fileURL = URL.createObjectURL(file);
and the restult is the blob link.
This does not work and the result is the blank pdf file
Could you help me please ?
Should I first bring the body response from file stream to file.pdf in python? Or there is another way

Rapid account: Yogthos
yogthos Commented לפני 9 שנים

The API is free to use and the project is released as open source available here https://github.com/yogthos/instant-pdf so if you wanted to run your own copy you could do that as well.

Rapid account: Teamriyaa
teamriyaa Commented לפני 9 שנים

Hi,

Thanks for your quick reply. Is this API free to use always? Can I rely to create an android app based on this? I am sorry to ask this, but I want to make sure.

Also is there any limit of requests at a time / per day / monthly basis?

Rapid account: Teamriyaa
teamriyaa Commented לפני 9 שנים

Hi,

Thanks for your quick reply. Is this API free to use always? Can I rely to create an android app based on this? I am sorry to ask this, but I want to make sure.

Also is there any limit of requests at a time / per day / monthly basis?

Rapid account: Yogthos
yogthos Commented לפני 9 שנים

You might want to look at downloading a binary from the response for example here http://stackoverflow.com/questions/8171835/java-download-binary-file-e-g-pdf-file-from-webserver

Join in the discussion - add comment below:

Login / Signup to post new comments