Sells, Fred a écrit : > I've got a ~100 page document I assemble from ~30 OOo .odt files with some > search and replace functions. I then produce a PDF. So far so good. > > Now I need to get a barcode from our internal website and insert that. The > barcode will vary based on some parameters. Our internal site provides a > .jpg image (or .gif) based on those parameters. > > Can anyone provide a snippet or some pointers on how to do this. I've > googled it to death and checked the OOo DevGuide to no avail. > > Either python or java solution is acceptable. > > you can use urllib2 python module:
# TestGoogle.py # import urllib2 # f = urllib2.urlopen('http://www.google.fr/images/nav_logo.png') data = f.read() f = file('nav_logo.png', 'w') f.write(data) f.close() in your case, may be parameters are passed thru url to get a particular barcode image (http://myserver/myapplication/barcode?format=xxx&id=yyy etc. ...). for authentication, if any, it needs a little more sophisticated coding. -- http://mail.python.org/mailman/listinfo/python-list