Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9b74dc534e
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (21 sloc) 0.663 kb
import time
from docraptor import DocRaptor
docraptor = DocRaptor()
print "Create PDF"
resp = docraptor.create({
'document_content': '<h1>python-docraptor</h1><p>Async Test</p>',
'test': True,
'async': True
})
print "Status ID: %s" % (resp['status_id'])
status_id = resp['status_id']
resp = docraptor.status(status_id)
print " %s" % (resp['status'])
while resp['status'] != 'completed':
time.sleep(3)
resp = docraptor.status(status_id)
print " %s" % (resp['status'])
print "Download to test_async.pdf",
with open("test_async.pdf", "wb") as f:
f.write(docraptor.download(resp['download_key']).content)
print "[DONE]"
Jump to Line
Something went wrong with that request. Please try again.