Click here to Skip to main content
15,896,063 members

Comments by Member 14145830 (Top 4 by date)

Member 14145830 3-Mar-19 13:37pm View    
thanks sir
Member 14145830 15-Feb-19 8:45am View    
Deleted
i know how but in python

import requests # get it from http://python-requests.org or do 'pip install requests'

url = "http://pdfx.cs.man.ac.uk"

def pypdfx(filename):
'''
Filename is a name of a pdf file WITHOUT the extension
The function will print messages, including the status code,
and will write the XML file to <filename>.xml
'''
fin = open(filename + '.pdf', 'rb')
files = {'file': fin}
try:
print 'Sending', filename, 'to', url
r = requests.post(url, files=files, headers={'Content-Type':'application/pdf'})
print 'Got status code', r.status_code
finally:
fin.close()
fout = open(filename + '.xml', 'w')
fout.write(r.content)
fout.close()
print 'Written to', filename + '.xml'

if __name__ == '__main__':
# self promotion - get the pdf file here: http://onlinelibrary.wiley.com/doi/10.1111/j.1558-5646.2012.01576.x/abstract
filename = 'Ram and Hadany 2012'
pypdfx(filename)
Member 14145830 12-Feb-19 14:09pm View    
ok thank you sir for your help
Member 14145830 11-Feb-19 22:58pm View    
thank you sir for your response
but wecan create (RESTful) web service so what is the differance between
(RESTful) web service and rest web api