From carl at personnelware.com Thu Jan 1 19:59:11 2009 From: carl at personnelware.com (Carl Karsten) Date: Thu, 01 Jan 2009 18:59:11 -0600 Subject: [reportlab-users] registering fonts Message-ID: <495D66DF.807@personnelware.com> I am finding myself trying to write generic code to register fonts. Looking at reportlab/pdfbase/pdfmetrics.py I see much the same code, but it depends on external stuff (system wide config files, editing /usr/lib/python2.5/site-packages/reportlab/rl_config.py, and maybe setting an environment var, but I couldn't get that to work.) Or maybe I am missing something. Here is what I am hoping for: my app that uses reportlab these 2 fonts: /usr/share/fonts/type1/gsfonts/n019004l.afm which is part of http://packages.ubuntu.com/intrepid/all/gsfonts/filelist /usr/share/fonts/truetype/freefont/FreeSans.ttf from http://packages.ubuntu.com/intrepid/ttf-freefont My app has a local config file that holds things like database/user/pw - great place to store path's to fonts either the font's and dirs and fonts used: fonts=['NimbusSanL-Bold','FreeSans'] fontdirs=['/usr/share/fonts/type1/gsfonts/', '/usr/share/fonts/truetype/freefont/'] or the full pathnames: fontfiles=['/usr/share/fonts/type1/gsfonts/n019004l.afm', '/usr/share/fonts/truetype/freefont/FreeSans.ttf'] Then my app can have some generic code that registers those fonts. I am guessing most apps that use reportlab need this, so it would be great if I could just pass those lists into some reporlab code. So, does anything like this exist? If not, I'll be happy to code it up and submit a patch - anything I should know? Carl K From ralsina at netmanagers.com.ar Thu Jan 1 20:33:14 2009 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Thu, 01 Jan 2009 23:33:14 -0200 Subject: [reportlab-users] registering fonts References: <495D66DF.807@personnelware.com> Message-ID: Carl Karsten writes: > I am finding myself trying to write generic code to register fonts. > > Looking at reportlab/pdfbase/pdfmetrics.py I see much the same code, but it > depends on external stuff (system wide config files, editing > /usr/lib/python2.5/site-packages/reportlab/rl_config.py, and maybe setting an > environment var, but I couldn't get that to work.) > > Or maybe I am missing something. > > Here is what I am hoping for: my app that uses reportlab these 2 fonts: > > /usr/share/fonts/type1/gsfonts/n019004l.afm which is part of > http://packages.ubuntu.com/intrepid/all/gsfonts/filelist > > /usr/share/fonts/truetype/freefont/FreeSans.ttf from > http://packages.ubuntu.com/intrepid/ttf-freefont > > My app has a local config file that holds things like database/user/pw - great > place to store path's to fonts > either the font's and dirs and fonts used: > > fonts=['NimbusSanL-Bold','FreeSans'] > fontdirs=['/usr/share/fonts/type1/gsfonts/', > '/usr/share/fonts/truetype/freefont/'] > > or the full pathnames: > > fontfiles=['/usr/share/fonts/type1/gsfonts/n019004l.afm', > '/usr/share/fonts/truetype/freefont/FreeSans.ttf'] > > Then my app can have some generic code that registers those fonts. I am > guessing most apps that use reportlab need this, so it would be great if I could > just pass those lists into some reporlab code. > > So, does anything like this exist? If not, I'll be happy to code it up and > submit a patch - anything I should know? There is generic font embedding stuff in rst2pdf (http://rst2pdf.googlecode.com), where it will try to find a font by name using a variety of mechanisms. Can't give you more details right now because I'm at the beach but look for font stuff it should be easy to find :-) From carl at personnelware.com Thu Jan 1 20:47:48 2009 From: carl at personnelware.com (Carl Karsten) Date: Thu, 01 Jan 2009 19:47:48 -0600 Subject: [reportlab-users] registering fonts In-Reply-To: References: <495D66DF.807@personnelware.com> Message-ID: <495D7244.9050003@personnelware.com> Roberto Alsina wrote: > Carl Karsten writes: > >> I am finding myself trying to write generic code to register fonts. >> >> Looking at reportlab/pdfbase/pdfmetrics.py I see much the same code, >> but it depends on external stuff (system wide config files, editing >> /usr/lib/python2.5/site-packages/reportlab/rl_config.py, and maybe >> setting an environment var, but I couldn't get that to work.) >> >> Or maybe I am missing something. >> >> Here is what I am hoping for: my app that uses reportlab these 2 fonts: >> >> /usr/share/fonts/type1/gsfonts/n019004l.afm which is part of >> http://packages.ubuntu.com/intrepid/all/gsfonts/filelist >> >> /usr/share/fonts/truetype/freefont/FreeSans.ttf from >> http://packages.ubuntu.com/intrepid/ttf-freefont >> >> My app has a local config file that holds things like database/user/pw >> - great place to store path's to fonts >> either the font's and dirs and fonts used: >> >> fonts=['NimbusSanL-Bold','FreeSans'] >> fontdirs=['/usr/share/fonts/type1/gsfonts/', >> '/usr/share/fonts/truetype/freefont/'] >> >> or the full pathnames: >> >> fontfiles=['/usr/share/fonts/type1/gsfonts/n019004l.afm', >> '/usr/share/fonts/truetype/freefont/FreeSans.ttf'] >> >> Then my app can have some generic code that registers those fonts. I >> am guessing most apps that use reportlab need this, so it would be >> great if I could just pass those lists into some reporlab code. >> >> So, does anything like this exist? If not, I'll be happy to code it >> up and submit a patch - anything I should know? > > There is generic font embedding stuff in rst2pdf > (http://rst2pdf.googlecode.com), where it will try to find a font by > name using a variety of mechanisms. > > Can't give you more details right now because I'm at the beach but look > for font stuff it should be easy to find :-) http://code.google.com/p/rst2pdf/source/browse/trunk/rst2pdf/findfonts.py flist=["/usr/share/fonts","/usr/share/texmf-dist/fonts"] f=findFont(sys.argv[1]) if not f: f=findTTFont(sys.argv[1]) if f: print f else: fn,pos=guessFont(sys.argv[1]) f=findFont(fn) if not f: f=findTTFont(fn) awesome. Any objections to this code being rolled into Reportlab? Reportlab, any objections to this code being used in reportlab/pdfbase/pdfmetrics.py? (guessing the MIT thing may require something... no clue.) Carl K From andy at reportlab.com Fri Jan 2 04:24:25 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 09:24:25 +0000 Subject: [reportlab-users] registering fonts In-Reply-To: <495D66DF.807@personnelware.com> References: <495D66DF.807@personnelware.com> Message-ID: <956003ae0901020124q25e4743dif0282297cd591f0@mail.gmail.com> 2009/1/2 Carl Karsten : > So, does anything like this exist? If not, I'll be happy to code it up and > submit a patch - anything I should know? Use registerFont and the related methods to explicitly register your fonts when your application starts up. See sections 3.3 and 3.5 of the User Guide, in your distro or here: http://www.reportlab.com/docs/userguide.pdf rl_config is more advanced and can help with auto-discovery of fonts for people who have zillions of them, but IMHO explicit is much better than implicit. Best Regards, Andy Robinson From andy at reportlab.com Fri Jan 2 07:13:17 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 12:13:17 +0000 Subject: [reportlab-users] pdf417 barcodes In-Reply-To: <3C08AF0D-2721-4A06-B795-640362C6A694@darwin.in-berlin.de> References: <495AB771.6000708@personnelware.com> <495B470D.20705@chamonix.reportlab.co.uk> <3C08AF0D-2721-4A06-B795-640362C6A694@darwin.in-berlin.de> Message-ID: <956003ae0901020413uacba4b4r5e289ba13e695673@mail.gmail.com> 2008/12/31 Dinu Gherman : > Many people would point out that GPL is actually more liberal > than BSD or anything else... but making that point here is > probably pointless. ;-) I wish any such people a Happy New Year in 2009, as well as clearer thought patterns once their hangovers clear ;-) - Andy From andy at reportlab.com Fri Jan 2 07:38:26 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 12:38:26 +0000 Subject: [reportlab-users] ReportLab 2.3 release news Message-ID: <956003ae0901020438w68a5e446ybaf1ca0eb5e24772@mail.gmail.com> Happy New Year to everybody... Having recovered from a month of viruses followed by the traditional dietary excess, we are now counting down to a release 2.3 - no hard date, but I hope in no more than 2 weeks. We aim to ... (1) deal with most of the issues in the tracker. https://admin.reportlab.com/mantis/project/core/tracker/ If you have raised a bug which we missed, my apologies, and please remind us. If it's listed, no need to worry. (2) have epydoc output available (in fact it's already here, and getting indexed by Google, but you'll be able to run it too: http://www.reportlab.org/apis/reportlab/ (3) open-source our PDF encryption function so you can make password-protected documents easily (4) put it all in PyPi (5) install a bit more smoothly in a few more places There are 2 debatable issues I would like input on: (6) Docs and Tests We are also reconsidering the decision to split out the docs and tests from the code. This was part (but not all) of the rearrangement we did for 2.2. To be honest, this has caused no end of trouble at our end, with non-Python-experts having no idea where to find these things. The manuals and tests are the main source of teaching examples, and if someone has done "python setup.py install" and then cleaned up wherever they unpacked it, they have lost the docs. Therefore we are considering putting 'docs' and 'tests' UNDER 'reportlab' so that they end up 'installed' in site-packages. This seems cleaner to us than having people separately downloading docs and demos (as wxPython does), or just plain not finding them. It will require a tedious extension to setup.py to enumerate all the non-Python files, but we can live with that. Does anyone have opinions on this? (7) Installing on Mac - separate email follows.. --- BTW, any feature requests will probably get logged but deferred. We have limited time to get this out the door. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From andy at reportlab.com Fri Jan 2 07:46:07 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 12:46:07 +0000 Subject: [reportlab-users] Installing ReportLab on Mac Message-ID: <956003ae0901020446i68bff67avef0d5fe7117a1492@mail.gmail.com> I would like any Mac users' advice on installation. Several of us have started working on Macs recently but don't really know the norms in the Mac/Python community. We also had trouble ourselves with occasional instabilities involving C code such as PIL, MySQL and other extensions we use. To build reportlab and the extensions on the Mac needs a compiler, which is not installed by default; or a pre-build package of some kind. There seem to be several systems for the latter. We are very interested to know - how many are using MacPython, and how many use the Python that came in the box? - do most Mac developers just set up their compiler and use distutils or setuptools to install Python packages, or do they use this, or something else entirely? http://pythonmac.org/packages/ - if there are any more 'unknown unknowns' when preparing Python packages for the Mac? We would consider producing a Mac package if there was enough demand, as we may be doing the same for our commercial toolkit as well. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From haraldarminmassa at gmail.com Fri Jan 2 07:53:37 2009 From: haraldarminmassa at gmail.com (Harald Armin Massa) Date: Fri, 2 Jan 2009 13:53:37 +0100 Subject: [reportlab-users] ReportLab 2.3 release news In-Reply-To: <956003ae0901020438w68a5e446ybaf1ca0eb5e24772@mail.gmail.com> References: <956003ae0901020438w68a5e446ybaf1ca0eb5e24772@mail.gmail.com> Message-ID: <7be3f35d0901020453y33ab5f35h8bc72b13dd8e581e@mail.gmail.com> Andy, > (6) Docs and Tests > Therefore we are considering putting 'docs' and 'tests' UNDER > 'reportlab' so that they end up 'installed' in site-packages. This > seems cleaner to us than having people separately downloading docs and > demos (as wxPython does), or just plain not finding them. It will > require a tedious extension to setup.py to enumerate all the > non-Python files, but we can live with that. > that is a good solution. Please try to make sure that no "active" RL-module imports from DOCs or Tests; not even somewhere deep down (i.e. some half-commented test lines). That is important for the minority of us who distribute their applications via py2exe on windows as "binaries", and having 2MB accidently integrated Reportlab-Docus within is not really helpfull :) Harald -- GHUM Harald Massa persuadere et programmare Harald Armin Massa Spielberger Stra?e 49 70435 Stuttgart 0173/9409607 no fx, no carrier pigeon - EuroPython 2009 will take place in Birmingham - Stay tuned! From Reed.L.OBrien at nasa.gov Fri Jan 2 08:14:21 2009 From: Reed.L.OBrien at nasa.gov (Reed L. O'Brien) Date: Fri, 2 Jan 2009 08:14:21 -0500 Subject: [reportlab-users] ReportLab 2.3 release news In-Reply-To: <956003ae0901020438w68a5e446ybaf1ca0eb5e24772@mail.gmail.com> References: <956003ae0901020438w68a5e446ybaf1ca0eb5e24772@mail.gmail.com> Message-ID: <5C4585A1-FAC1-43D9-B740-9F832AD3D0EE@nasa.gov> On Jan 2, 2009, at 7:38 AM, Andy Robinson wrote: > Happy New Year to everybody... > Happy New Year > > There are 2 debatable issues I would like input on: > > (6) Docs and Tests > We are also reconsidering the decision to split out the docs and tests > from the code. This was part (but not all) of the rearrangement we > did for 2.2. To be honest, this has caused no end of trouble at our > end, with non-Python-experts having no idea where to find these > things. The manuals and tests are the main source of teaching > examples, and if someone has done "python setup.py install" and then > cleaned up wherever they unpacked it, they have lost the docs. > > > Therefore we are considering putting 'docs' and 'tests' UNDER > 'reportlab' so that they end up 'installed' in site-packages. This > seems cleaner to us than having people separately downloading docs and > demos (as wxPython does), or just plain not finding them. It will > require a tedious extension to setup.py to enumerate all the > non-Python files, but we can live with that. > > Does anyone have opinions on this? Add include_package_data=True to your setup.py, it should include and files under SVN control. see http://peak.telecommunity.com/DevCenter/setuptools ~ro From Reed.L.OBrien at nasa.gov Fri Jan 2 08:19:59 2009 From: Reed.L.OBrien at nasa.gov (Reed L. O'Brien) Date: Fri, 2 Jan 2009 08:19:59 -0500 Subject: [reportlab-users] Installing ReportLab on Mac In-Reply-To: <956003ae0901020446i68bff67avef0d5fe7117a1492@mail.gmail.com> References: <956003ae0901020446i68bff67avef0d5fe7117a1492@mail.gmail.com> Message-ID: <7E723A99-98E9-41C8-B7E7-8C346DDEB719@nasa.gov> On Jan 2, 2009, at 7:46 AM, Andy Robinson wrote: > I would like any Mac users' advice on installation. Several of us > have started working on Macs recently but don't really know the norms > in the Mac/Python community. We also had trouble ourselves with > occasional instabilities involving C code such as PIL, MySQL and other > extensions we use. > > To build reportlab and the extensions on the Mac needs a compiler, > which is not installed by default; or a pre-build package of some > kind. There seem to be several systems for the latter. > > We are very interested to know > > - how many are using MacPython, and how many use the Python that came > in the box? I build custom python(s) to work with and use virtualenv to make isolated sandboxes so I don't pollute site-packages and get installation conflicts. > - do most Mac developers just set up their compiler and use distutils > or setuptools to install Python packages, or do they use this, or > something else entirely? > http://pythonmac.org/packages/ Install XCode and then develop and egg under setup.py develop or using zc.buildout. > - if there are any more 'unknown unknowns' when preparing Python > packages for the Mac? There are some things I do so I don't have to work around them repeatedly. 1. build some things and install in /usr/local - zlib - libjpeg - libxml2 - libxslt - readline That is all I can think of now. > We would consider producing a Mac package if there was enough demand, > as we may be doing the same for our commercial toolkit as well. setuptools? > > > Best Regards, > > -- > Andy Robinson > CEO/Chief Architect > ReportLab Europe Ltd. > Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK > Tel +44-20-8545-1570 > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From andy at reportlab.com Fri Jan 2 08:47:52 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 13:47:52 +0000 Subject: [reportlab-users] ReportLab 2.3 release news In-Reply-To: <5C4585A1-FAC1-43D9-B740-9F832AD3D0EE@nasa.gov> References: <956003ae0901020438w68a5e446ybaf1ca0eb5e24772@mail.gmail.com> <5C4585A1-FAC1-43D9-B740-9F832AD3D0EE@nasa.gov> Message-ID: <956003ae0901020547k215c66e3s139a33dedb830925@mail.gmail.com> 2009/1/2 Reed L. O'Brien : > > see http://peak.telecommunity.com/DevCenter/setuptools That's one of the nice things about setuptools, but we are compelled to have a fully working "distutils" script as "setup.py". The largest users (the Ubuntu repackagers and us) prefer a system which does not silently pull in dependencies. We also have a (poorly named) setup_egg.py as an alternative, to make it easier for anyone repackaging as eggs, which could use this. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From andy at reportlab.com Fri Jan 2 08:48:48 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 13:48:48 +0000 Subject: [reportlab-users] ReportLab 2.3 release news In-Reply-To: <7be3f35d0901020453y33ab5f35h8bc72b13dd8e581e@mail.gmail.com> References: <956003ae0901020438w68a5e446ybaf1ca0eb5e24772@mail.gmail.com> <7be3f35d0901020453y33ab5f35h8bc72b13dd8e581e@mail.gmail.com> Message-ID: <956003ae0901020548m1c24a065v203945b661094664@mail.gmail.com> 2009/1/2 Harald Armin Massa : > Andy, > >> (6) Docs and Tests > that is a good solution. > > Please try to make sure that no "active" RL-module imports from DOCs > or Tests; not even somewhere deep down (i.e. some half-commented test > lines). That is important for the minority of us who distribute their > applications via py2exe on windows as "binaries", and having 2MB > accidently integrated Reportlab-Docus within is not really helpfull :) > Very good point. Logged as issue 952. However, it would seem very natural to me to use references to tests in docstrings (" see reportlab/tests/test_foo_bar.py for examples"). I am surprised that py2exe pulls in commented out references. How careful do we have to be? - Andy From andy at reportlab.com Fri Jan 2 08:56:58 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 13:56:58 +0000 Subject: [reportlab-users] Installing ReportLab on Mac In-Reply-To: <7E723A99-98E9-41C8-B7E7-8C346DDEB719@nasa.gov> References: <956003ae0901020446i68bff67avef0d5fe7117a1492@mail.gmail.com> <7E723A99-98E9-41C8-B7E7-8C346DDEB719@nasa.gov> Message-ID: <956003ae0901020556sa44e830vb82fd6dd9c233f32@mail.gmail.com> 2009/1/2 Reed L. O'Brien : > setuptools? Aaarrggghhhh! First working day of 2009 and we're back in that dreadful discussion ;-) Guido For everyone who likes setuptools, others dislike it for equally good reasons. I think distutils sucks too, but some very major repackagers (Ubuntu) prefer the classic distutils script. For now we are trying to help both camps. If you get the subversion code, there is a main 'setup.py' which uses distutils; and an alternative 'setup_egg.py' for anyone who prefers to built distros with setuptools. We have put less effort into the latter and if any volunteers want to do things to it, feel free. - Andy From andy at reportlab.com Fri Jan 2 08:57:48 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 13:57:48 +0000 Subject: [reportlab-users] Installing ReportLab on Mac In-Reply-To: <956003ae0901020556sa44e830vb82fd6dd9c233f32@mail.gmail.com> References: <956003ae0901020446i68bff67avef0d5fe7117a1492@mail.gmail.com> <7E723A99-98E9-41C8-B7E7-8C346DDEB719@nasa.gov> <956003ae0901020556sa44e830vb82fd6dd9c233f32@mail.gmail.com> Message-ID: <956003ae0901020557g10e30d42g464c64f0283f6c0b@mail.gmail.com> 009/1/2 Andy Robinson : Oops, paste error. Was going to say.. > dreadful discussion ;-) Guido ..should have used his time machine to ensure There Can Only Be One. - Andy From dirk.holtwick at gmail.com Fri Jan 2 09:08:39 2009 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Fri, 02 Jan 2009 15:08:39 +0100 Subject: [reportlab-users] Installing ReportLab on Mac In-Reply-To: <956003ae0901020557g10e30d42g464c64f0283f6c0b@mail.gmail.com> References: <956003ae0901020446i68bff67avef0d5fe7117a1492@mail.gmail.com> <7E723A99-98E9-41C8-B7E7-8C346DDEB719@nasa.gov> <956003ae0901020556sa44e830vb82fd6dd9c233f32@mail.gmail.com> <956003ae0901020557g10e30d42g464c64f0283f6c0b@mail.gmail.com> Message-ID: <495E1FE7.6050304@gmail.com> Just to drop another name into the round I would like to suggest to have a look on "pip" ;) Maybe this could at least be a solution for some dependency troubles. http://pypi.python.org/pypi/pip Happy New Year Dirk Andy Robinson schrieb: > 009/1/2 Andy Robinson : > Oops, paste error. Was going to say.. > >> dreadful discussion ;-) Guido > > ..should have used his time machine to ensure There Can Only Be One. > > - Andy > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From haraldarminmassa at gmail.com Fri Jan 2 09:15:28 2009 From: haraldarminmassa at gmail.com (Harald Armin Massa) Date: Fri, 2 Jan 2009 15:15:28 +0100 Subject: [reportlab-users] ReportLab 2.3 release news In-Reply-To: <956003ae0901020548m1c24a065v203945b661094664@mail.gmail.com> References: <956003ae0901020438w68a5e446ybaf1ca0eb5e24772@mail.gmail.com> <7be3f35d0901020453y33ab5f35h8bc72b13dd8e581e@mail.gmail.com> <956003ae0901020548m1c24a065v203945b661094664@mail.gmail.com> Message-ID: <7be3f35d0901020615v11a2d7apf34742cda0bc3111@mail.gmail.com> Andy, >> Please try to make sure that no "active" RL-module imports from DOCs >> or Tests; not even somewhere deep down (i.e. some half-commented test >> lines). That is important for the minority of us who distribute their >> applications via py2exe on windows as "binaries", and having 2MB >> accidently integrated Reportlab-Docus within is not really helpfull :) > Very good point. Logged as issue 952. > > However, it would seem very natural to me to use references to tests > in docstrings (" see reportlab/tests/test_foo_bar.py for examples"). > I am surprised that py2exe pulls in commented out references. How > careful do we have to be? docstrings no problem they are. BUT in some younger versions down,"commented" in "if __name__=='__main__' of some scripts there were added test-codes like "import xxx" with xxx being some test / doc script. That should be avoided. (the history is clear. "oh, I just test this change by importing xxx and running it as a script"... ) I can understand WHY it happens :) it is just hard to get rid of on packaging :) Harald -- GHUM Harald Massa persuadere et programmare Harald Armin Massa Spielberger Stra?e 49 70435 Stuttgart 0173/9409607 no fx, no carrier pigeon - EuroPython 2009 will take place in Birmingham - Stay tuned! From darren at ontrenet.com Fri Jan 2 09:19:45 2009 From: darren at ontrenet.com (Darren Govoni) Date: Fri, 02 Jan 2009 09:19:45 -0500 Subject: [reportlab-users] highlighting text? Message-ID: <1230905985.2908.23.camel@nuraku> Hi, Is this possible with reportlab? I want to read in an existing PDF, highlight certain text in it and produce a NEW PDF exactly the same as the original except with highlighted text. Possible? thank you for the tip! Darren From rgacote at AppropriateSolutions.com Fri Jan 2 09:23:20 2009 From: rgacote at AppropriateSolutions.com (Raymond Cote) Date: Fri, 02 Jan 2009 09:23:20 -0500 Subject: [reportlab-users] ReportLab 2.3 release news In-Reply-To: <7be3f35d0901020453y33ab5f35h8bc72b13dd8e581e@mail.gmail.com> References: <956003ae0901020438w68a5e446ybaf1ca0eb5e24772@mail.gmail.com> <7be3f35d0901020453y33ab5f35h8bc72b13dd8e581e@mail.gmail.com> Message-ID: <495E2358.10900@AppropriateSolutions.com> Harald Armin Massa wrote: > Andy, > > >> (6) Docs and Tests >> Therefore we are considering putting 'docs' and 'tests' UNDER >> 'reportlab' so that they end up 'installed' in site-packages. This >> seems cleaner to us than having people separately downloading docs and >> demos (as wxPython does), or just plain not finding them. It will >> require a tedious extension to setup.py to enumerate all the >> non-Python files, but we can live with that. >> >> > > that is a good solution. Concur that this is a good solution. In addition to having the documentation (and tests) here for initial development, it is convenient to have the specific docs/tests under version control so that, when we haven't done any ReportLab work in six months or so, we can quickly find the docs and remember how things work. Also agree that proper packaging under py2exe is important. We're not doing this ourselves at the moment, but we currently have a number of Python projects distributed via py2exe and it is only a matter of time until one of them has ReportLab in it. Looking forward to 2.3. --Ray -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Fri Jan 2 09:41:39 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 14:41:39 +0000 Subject: [reportlab-users] Installing ReportLab on Mac In-Reply-To: <495E1FE7.6050304@gmail.com> References: <956003ae0901020446i68bff67avef0d5fe7117a1492@mail.gmail.com> <7E723A99-98E9-41C8-B7E7-8C346DDEB719@nasa.gov> <956003ae0901020556sa44e830vb82fd6dd9c233f32@mail.gmail.com> <956003ae0901020557g10e30d42g464c64f0283f6c0b@mail.gmail.com> <495E1FE7.6050304@gmail.com> Message-ID: <956003ae0901020641wd5f9cdcp29da514ee985562f@mail.gmail.com> 2009/1/2 Dirk Holtwick : > Just to drop another name into the round I would like to suggest to have a > look on "pip" ;) Maybe this could at least be a solution for some dependency > troubles. > > http://pypi.python.org/pypi/pip This actually looks to me like a big step in the right direction. I wish setuptools had worked this way from day one. And if it got popular we could add a 'setup_pip.py'. But we won't worry about it for our 2.3 release. I'm taking the view that having a distutils "setup.py" is the python standard until Guido says otherwise; but we will happily include alternatives contributed by others for them to use at their own risk. IMHO "Real Men" unzip the package, put it on their path, and know what extensions they are compiling. Unix should seek to educate the developer. Sadly there are very few left. - Andy From andy at reportlab.com Fri Jan 2 09:44:21 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 14:44:21 +0000 Subject: [reportlab-users] ReportLab 2.3 release news In-Reply-To: <7be3f35d0901020615v11a2d7apf34742cda0bc3111@mail.gmail.com> References: <956003ae0901020438w68a5e446ybaf1ca0eb5e24772@mail.gmail.com> <7be3f35d0901020453y33ab5f35h8bc72b13dd8e581e@mail.gmail.com> <956003ae0901020548m1c24a065v203945b661094664@mail.gmail.com> <7be3f35d0901020615v11a2d7apf34742cda0bc3111@mail.gmail.com> Message-ID: <956003ae0901020644s5d85b38ey83805e8515247a96@mail.gmail.com> 2009/1/2 Harald Armin Massa : > docstrings no problem they are. BUT in some younger versions > down,"commented" in "if __name__=='__main__' of some scripts there > were added test-codes like "import xxx" with xxx being some test / doc > script. Good point. We'll review all the old __main__ sections. Many have probably been made obsolete by test cases anyway. - Andy From Reed.L.OBrien at nasa.gov Fri Jan 2 09:48:32 2009 From: Reed.L.OBrien at nasa.gov (Reed O'Brien) Date: Fri, 2 Jan 2009 09:48:32 -0500 Subject: [reportlab-users] ReportLab 2.3 release news In-Reply-To: <956003ae0901020547k215c66e3s139a33dedb830925@mail.gmail.com> References: <956003ae0901020438w68a5e446ybaf1ca0eb5e24772@mail.gmail.com> <5C4585A1-FAC1-43D9-B740-9F832AD3D0EE@nasa.gov> <956003ae0901020547k215c66e3s139a33dedb830925@mail.gmail.com> Message-ID: <23CE7402-5014-49F1-BE3E-BC7269075805@nasa.gov> On Jan 2, 2009, at 8:47 AM, Andy Robinson wrote: > 2009/1/2 Reed L. O'Brien : >> >> see http://peak.telecommunity.com/DevCenter/setuptools > > That's one of the nice things about setuptools, but > we are compelled to have a fully working "distutils" script > as "setup.py". The largest users (the Ubuntu repackagers > and us) prefer a system which does not silently pull in > dependencies. I won't argue that point. > > > We also have a (poorly named) setup_egg.py as an alternative, > to make it easier for anyone repackaging as eggs, which > could use this. I was ignorant of this setup file. I am more than happy to build a source egg from this and maintain it in my own index. > > > Best Regards, > > > -- > Andy Robinson > CEO/Chief Architect > ReportLab Europe Ltd. > Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK > Tel +44-20-8545-1570 > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From Reed.L.OBrien at nasa.gov Fri Jan 2 09:52:22 2009 From: Reed.L.OBrien at nasa.gov (Reed O'Brien) Date: Fri, 2 Jan 2009 09:52:22 -0500 Subject: [reportlab-users] Installing ReportLab on Mac In-Reply-To: <956003ae0901020556sa44e830vb82fd6dd9c233f32@mail.gmail.com> References: <956003ae0901020446i68bff67avef0d5fe7117a1492@mail.gmail.com> <7E723A99-98E9-41C8-B7E7-8C346DDEB719@nasa.gov> <956003ae0901020556sa44e830vb82fd6dd9c233f32@mail.gmail.com> Message-ID: <4E662266-1F69-4DE7-85E8-23D3AB41AA0E@nasa.gov> On Jan 2, 2009, at 8:56 AM, Andy Robinson wrote: > 2009/1/2 Reed L. O'Brien : >> setuptools? > > Aaarrggghhhh! First working day of 2009 and we're back in that > dreadful discussion ;-) Guido > > > For everyone who likes setuptools, others dislike it for equally good > reasons. I think distutils sucks too, but some very major > repackagers (Ubuntu) prefer the classic distutils script. I am not suggesting a change. I merely read bullet 4 (put it all in PyPi) of your earlier email and mistakenly interpreted that as having already move to setuptools. > > > For now we are trying to help both camps. If you get the subversion > code, there is a main 'setup.py' which uses distutils; and an > alternative 'setup_egg.py' for anyone who prefers to built distros > with setuptools. We have put less effort into the latter and if any > volunteers want to do things to it, feel free. Again I am more than happy to maintain a package my own index. > > > - Andy > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From Reed.L.OBrien at nasa.gov Fri Jan 2 10:16:24 2009 From: Reed.L.OBrien at nasa.gov (Reed O'Brien) Date: Fri, 2 Jan 2009 10:16:24 -0500 Subject: [reportlab-users] Installing ReportLab on Mac In-Reply-To: <956003ae0901020641wd5f9cdcp29da514ee985562f@mail.gmail.com> References: <956003ae0901020446i68bff67avef0d5fe7117a1492@mail.gmail.com> <7E723A99-98E9-41C8-B7E7-8C346DDEB719@nasa.gov> <956003ae0901020556sa44e830vb82fd6dd9c233f32@mail.gmail.com> <956003ae0901020557g10e30d42g464c64f0283f6c0b@mail.gmail.com> <495E1FE7.6050304@gmail.com> <956003ae0901020641wd5f9cdcp29da514ee985562f@mail.gmail.com> Message-ID: <21AC3BDE-F370-43DD-9B87-D857CBD46DA0@nasa.gov> On Jan 2, 2009, at 9:41 AM, Andy Robinson wrote: > 2009/1/2 Dirk Holtwick : >> Just to drop another name into the round I would like to suggest to >> have a >> look on "pip" ;) Maybe this could at least be a solution for some >> dependency >> troubles. >> >> http://pypi.python.org/pypi/pip > > This actually looks to me like a big step in the right direction. I > wish setuptools had worked this way from day one. And if it got > popular we could add a 'setup_pip.py'. But we won't worry about it > for our 2.3 release. I'm taking the view that having a distutils > "setup.py" is the python standard until Guido says otherwise; but we > will happily include alternatives contributed by others for them to > use at their own risk. > > IMHO "Real Men" unzip the package, put it on their path, and know what > extensions they are compiling. Unix should seek to educate the > developer. Sadly there are very few left. Some of my, um, apps/systems, have dozens of interdependent packages as well as several dozen python packages. It would be near if not impossible to have half a dozen people unzip configure and compile all of these things manually. Additionally there are multiple target installation environments: OSX, RHEL, Fedora (and sometimes ubuntu), Solaris and sometimes FreeBSD. I can't imagine the level of effort required to maintain debs, rpms, ports, fink, solaris whatevers and so forth. zc,buildout (which has its own warts) with setuptools and a privately maintained index allows maintaining a system that builds development and production configurations, repeatably and reliably, for all of the above platforms with minimal headache. I am not arguing others should do it this way, but I thought I would share why I use non "Real Men" methods. ~ro > > > - Andy > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From andy at reportlab.com Fri Jan 2 10:31:54 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 15:31:54 +0000 Subject: [reportlab-users] ReportLab 2.3 release news In-Reply-To: <23CE7402-5014-49F1-BE3E-BC7269075805@nasa.gov> References: <956003ae0901020438w68a5e446ybaf1ca0eb5e24772@mail.gmail.com> <5C4585A1-FAC1-43D9-B740-9F832AD3D0EE@nasa.gov> <956003ae0901020547k215c66e3s139a33dedb830925@mail.gmail.com> <23CE7402-5014-49F1-BE3E-BC7269075805@nasa.gov> Message-ID: <956003ae0901020731y3b1dbbe7m4540c0fae9732d99@mail.gmail.com> 2009/1/2 Reed O'Brien : > I was ignorant of this setup file. I am more than happy to build a source > egg from this and maintain it in my own index. Dirk contributed this in September; if you check out here you'll find it at the top. https://svn.reportlab.com/svn/public/reportlab/trunk/ It would be great if you could try this out and see if it builds a working reportlab (with extensions properly compiled!), as we have focused most of our testing on the other setup.py. If we get a few independent thumbs-up we can advertise it more widely. - Andy From gherman at darwin.in-berlin.de Fri Jan 2 10:32:06 2009 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 2 Jan 2009 16:32:06 +0100 Subject: [reportlab-users] highlighting text? In-Reply-To: <1230905985.2908.23.camel@nuraku> References: <1230905985.2908.23.camel@nuraku> Message-ID: <51F79F2A-9D08-46DA-AA5F-4F0E481AC857@darwin.in-berlin.de> Darren Govoni: > Is this possible with reportlab? I want to read in an existing PDF, > highlight certain text in it and produce a NEW PDF exactly the same as > the original except with highlighted text. > > Possible? No, but that would be an interesting (and challenging) task for pyPdf. Regards, Dinu From gherman at darwin.in-berlin.de Fri Jan 2 10:38:11 2009 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 2 Jan 2009 16:38:11 +0100 Subject: [reportlab-users] pdf417 barcodes In-Reply-To: <495BBCB7.2040006@personnelware.com> References: <495AB771.6000708@personnelware.com> <495B470D.20705@chamonix.reportlab.co.uk> <3C08AF0D-2721-4A06-B795-640362C6A694@darwin.in-berlin.de> <495BBCB7.2040006@personnelware.com> Message-ID: Carl Karsten: >> I've done something like that for EuroPython 2008, or let's >> say I offered doing it, but people said for about 200 people >> the scanning wouldn't make much sense, which is mostly true. > > How were you going to implement it? Well QR codes can be read with cameras in mobile phones (with appropriate software) if that is what you mean. >> For PyCon US and the general fear level in the US that might >> be different. Here's a sample with the (not so meaningful) >> QR codes generated by an online service and added as bitmaps >> to the badges PDF file (in the end I made them much simpler): >> http://python.net/~gherman/tmp/badges.pdf > > neat. > > Can you post the code? Seems like I cannot find it right now, or it was throw away code. Sorry, Dinu -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Fri Jan 2 10:41:01 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 15:41:01 +0000 Subject: [reportlab-users] Installing ReportLab on Mac In-Reply-To: <21AC3BDE-F370-43DD-9B87-D857CBD46DA0@nasa.gov> References: <956003ae0901020446i68bff67avef0d5fe7117a1492@mail.gmail.com> <7E723A99-98E9-41C8-B7E7-8C346DDEB719@nasa.gov> <956003ae0901020556sa44e830vb82fd6dd9c233f32@mail.gmail.com> <956003ae0901020557g10e30d42g464c64f0283f6c0b@mail.gmail.com> <495E1FE7.6050304@gmail.com> <956003ae0901020641wd5f9cdcp29da514ee985562f@mail.gmail.com> <21AC3BDE-F370-43DD-9B87-D857CBD46DA0@nasa.gov> Message-ID: <956003ae0901020741i70db3180hcda8697d18f13575@mail.gmail.com> 2009/1/2 Reed O'Brien : > zc,buildout (which has its own warts) with setuptools and a privately > maintained index allows maintaining a system that builds development and > production configurations, repeatably and reliably, for all of the above > platforms with minimal headache. I am not arguing others should do it this > way, but I thought I would share why I use non "Real Men" methods. That's fair enough. In practice every serious team ends up building a script for whatever they need to deploy, and we're no different. But we never used eggs in our scripts since we've been doing Python since long before they existed. I presume zc.buildout requires eggs? - Andy From carl at personnelware.com Fri Jan 2 10:45:55 2009 From: carl at personnelware.com (Carl Karsten) Date: Fri, 02 Jan 2009 09:45:55 -0600 Subject: [reportlab-users] logging into bug tracker Message-ID: <495E36B3.6050605@personnelware.com> http://www.reportlab.org/support.html "Log in to mantis..." fill in form, hit "log in" I am getting https://secure.reportlab.com/cgi-bin/mantis.cgi unable to resolve host address `secure.reportlab.com' juser at averatec:~/a$ host secure.reportlab.com Host secure.reportlab.com not found: 3(NXDOMAIN) Carl K From carl at personnelware.com Fri Jan 2 11:08:44 2009 From: carl at personnelware.com (Carl Karsten) Date: Fri, 02 Jan 2009 10:08:44 -0600 Subject: [reportlab-users] pdf417 barcodes In-Reply-To: References: <495AB771.6000708@personnelware.com> <495B470D.20705@chamonix.reportlab.co.uk> <3C08AF0D-2721-4A06-B795-640362C6A694@darwin.in-berlin.de> <495BBCB7.2040006@personnelware.com> Message-ID: <495E3C0C.4070602@personnelware.com> Dinu Gherman wrote: > Carl Karsten: > >>> I've done something like that for EuroPython 2008, or let's >>> say I offered doing it, but people said for about 200 people >>> the scanning wouldn't make much sense, which is mostly true. >> >> How were you going to implement it? > > Well QR codes can be read with cameras in mobile phones (with > appropriate software) if that is what you mean. No, I meant how were you going to code the reportlab side. mainly passing the (name,email...) to the code that encodes to the barcode, then getting whatever it returns (bmp, ps, eps, etc) into reporlab. I have a friend that has done cTypes before, and is going to look into making bindings for https://sourceforge.net/projects/pdf417encode/ > >>> For PyCon US and the general fear level in the US that might >>> be different. Here's a sample with the (not so meaningful) >>> QR codes generated by an online service and added as bitmaps >>> to the badges PDF file (in the end I made them much simpler): >>> http://python.net/~gherman/tmp/badges.pdf >> >> neat. >> >> Can you post the code? > > Seems like I cannot find it right now, or it was throw away code. No problem. I am guessing it wasn't anything super complex, just wondering how automated you got it. For a sample (no real data, this is kinda like a unit test) >>> demog="31443 \03First \03Last\03\nTitle\03\nOrganization1\03\nAddress1\03\nAddress2\03\nCity \03St \00312345\03\nUSA\03\nPhone: \003123-456-7890\03\nFax: \03987-654-3210\03\nEmail: \03test at email.com\03\n1: \03\03\n2: \03\03\n3: \03\03\n4: \03\03\n\n\n\n\n\n" >>> open('ncta.txt','w').write(demog) $ ./pdf417prep ncta.prep $ ./pdf417_enc -t pbm ncta.prep ncta.pbm $ convert ncta.pbm ncta.png >>> barcode=open('ncta.png').read() And then referenced ncta.png in my dabo code witch feeds reportlab. Carl K From carl at personnelware.com Fri Jan 2 12:05:13 2009 From: carl at personnelware.com (Carl Karsten) Date: Fri, 02 Jan 2009 11:05:13 -0600 Subject: [reportlab-users] simpler simple code for docs Message-ID: <495E4949.2040200@personnelware.com> docs section 3.3 ... code as simple as this: class FontNameNotFoundError(Exception): pass def findFontName(path): "Extract a font name from an AFM file." f = open(path) found = 0 while not found: line = f.readline()[:-1] if not found and line[:16] == 'StartCharMetrics': raise FontNameNotFoundError, path if line[:8] == 'FontName': fontName = line[9:] found = 1 return fontName This can be replaced with: from reportlab.pdfbase import pdfmetrics (topLevel, glyphData) = pdfmetrics.parseAFMFile(path) fontName=topLevel['FontName'] I would post this to the issue tracker, but i cant log in and I wanted to get this posted somewhere. Carl K From andy at reportlab.com Fri Jan 2 15:19:51 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 2 Jan 2009 20:19:51 +0000 Subject: [reportlab-users] simpler simple code for docs In-Reply-To: <495E4949.2040200@personnelware.com> References: <495E4949.2040200@personnelware.com> Message-ID: <956003ae0901021219g7d586d69hb9d88d5131294527@mail.gmail.com> 2009/1/2 Carl Karsten : > docs section 3.3 > > ... code as simple as this: > This can be replaced with: > > from reportlab.pdfbase import pdfmetrics > (topLevel, glyphData) = pdfmetrics.parseAFMFile(path) > fontName=topLevel['FontName'] > > I would post this to the issue tracker, but i cant log in and I wanted to > get this posted somewhere. Thanks, Carl. The issue tracker is read only; the correct approach is to post the users list. We do it this way to avoid polluting the tracker with hundreds of duplicates, feature requests disguised as bugs etc, which has happened to many other trackers. (We hope to allow registration at some future date). Thanks also for reminding us about the busted login link. We've allocated someone to clean up the .org site a bit next week. - Andy From aklaver at comcast.net Fri Jan 2 18:25:15 2009 From: aklaver at comcast.net (Adrian Klaver) Date: Fri, 2 Jan 2009 15:25:15 -0800 Subject: [reportlab-users] New user Message-ID: <200901021525.15610.aklaver@comcast.net> I have started working with ReportLab and I have a few questions. 1) Is there a searchable archive for the mailing list? 2) Is there a way of doing Page of Page? 3) I just want to make sure I understand the coordinate system For pages (0,0) is at the bottom left and for tables it is at the top left? Thanks, -- Adrian Klaver aklaver at comcast.net From DJESSUP at usnews.com Fri Jan 2 20:16:15 2009 From: DJESSUP at usnews.com (Jessup, David) Date: Fri, 2 Jan 2009 20:16:15 -0500 Subject: [reportlab-users] New user In-Reply-To: <200901021525.15610.aklaver@comcast.net> References: <200901021525.15610.aklaver@comcast.net> Message-ID: <97886A555FD8E14E8F7445D75C11D54DD2E0B5@EXCHANGE.usn.root.ent> > 1) Is there a searchable archive for the mailing list? Yes. It's called Google. ;-) Add "site:two.pairlist.net/pipermail/reportlab-users" to your search terms to force Google to search its image of the mailing list archive. --- David L. Jessup -----Original Message----- From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Adrian Klaver Sent: Friday, January 02, 2009 6:25 PM To: reportlab-users at reportlab.com Subject: [reportlab-users] New user I have started working with ReportLab and I have a few questions. 1) Is there a searchable archive for the mailing list? 2) Is there a way of doing Page of Page? 3) I just want to make sure I understand the coordinate system For pages (0,0) is at the bottom left and for tables it is at the top left? Thanks, -- Adrian Klaver aklaver at comcast.net _______________________________________________ reportlab-users mailing list reportlab-users at reportlab.com http://two.pairlist.net/mailman/listinfo/reportlab-users From aklaver at comcast.net Fri Jan 2 21:46:15 2009 From: aklaver at comcast.net (Adrian Klaver) Date: Fri, 2 Jan 2009 18:46:15 -0800 Subject: [reportlab-users] splitByRow Message-ID: <200901021846.16298.aklaver@comcast.net> ReportLab 2.2 I seem to not understand the splitByRow argument to Table(). If I set it to 0 for a table that is too tall and wide for the page I get the following traceback. If I set it to 1 then the doc fails to build unless the columns fit within the page width then the table splits between rows. It seems at present tables can only split by row, not by column. This is contrary to what the documentation says; "For very wide tables, they can also split 'by column'. You can choose whether tou(sic) want to split down-and-across or across-and-down" Am I missing something? Traceback (most recent call last) /home/aklaver/software_projects/production_database/python_code/ in () /usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py in build(self, flowables, onFirstPage, onLaterPages, canvasmaker) 985 if onLaterPages is _doNothing and hasattr(self,'onLaterPages'): 986 self.pageTemplates[1].beforeDrawPage = self.onLaterPages --> 987 BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker) 988 989 def progressCB(typ, value): /usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py in build(self, flowables, filename, canvasmaker) 754 try: 755 first = flowables[0] --> 756 self.handle_flowable(flowables) 757 handled += 1 758 except: /usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py in handle_flowable(self, flowables) 655 if self.allowSplitting: 656 # see if this is a splittable thing --> 657 S = frame.split(f,canv) 658 n = len(S) 659 else: /usr/lib/python2.5/site-packages/reportlab/platypus/frames.py in split(self, flowable, canv) 196 s = max(s-self._prevASpace,0) 197 flowable.canv = canv #some flowables might need this --> 198 r = flowable.split(self._aW, y-p-s) 199 del flowable.canv 200 return r /usr/lib/python2.5/site-packages/reportlab/platypus/tables.py in split(self, availWidth, availHeight) 1271 return self._splitRows(availHeight) 1272 else: -> 1273 raise NotImplementedError 1274 1275 def draw(self): : Thanks, -- Adrian Klaver aklaver at comcast.net From bernie at huntfamily.com Mon Jan 5 01:40:49 2009 From: bernie at huntfamily.com (Bernie Hunt) Date: Mon, 05 Jan 2009 01:40:49 -0500 Subject: [reportlab-users] Install Problems Message-ID: <7BD2AAAB64E075479A228E83F77F0D7E9762@huntsrvr.HuntFamily.local> I'm new to Python and I'm having trouble with my ReportLabs install. The instructions in Chapter 1 of the User's guide say to unzip the archive straight into the Python directory. It further says, it creates a subdirectory named reportlab. Your should now be able to go to a Python command line interpreter and type import reportlab without getting an error message. I unzipped the archive into the Python folder, but the sub folder created is called ReportLab_2_2, not reportlab. Also if I type "import reportlab" I get a response of "ImportError: No module named reportlab". Can anyone point me in the right direction? Bernie PS: When you subscribe to this list, the reply address on the confirmation email is bad. My server reply; The following recipient(s) cannot be reached: reportlab-users-request at reportlab.com on 1/5/2009 1:31 AM The e-mail account does not exist at the organization this message was sent to. Check the e-mail address, or contact the recipient directly to find out the correct address. -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter at monicol.co.uk Mon Jan 5 06:38:12 2009 From: peter at monicol.co.uk (Peter Mott) Date: Mon, 05 Jan 2009 11:38:12 +0000 Subject: [reportlab-users] Install Problems In-Reply-To: <7BD2AAAB64E075479A228E83F77F0D7E9762@huntsrvr.HuntFamily.local> References: <7BD2AAAB64E075479A228E83F77F0D7E9762@huntsrvr.HuntFamily.local> Message-ID: <4961F124.90004@monicol.co.uk> For Windows you need to use a pre-built installer (there is a link on http://www.reportlab.org/downloads.html). For Linux download the package, extract it into a temporary folder and change to that folder where you'll see a file setup.py. Run 'python setup.py install' . Both ways put reportlab in /lib/site-packages/reportlab. Python puts all extra packages in site-packages. Peter Bernie Hunt wrote: > > I'm new to Python and I'm having trouble with my ReportLabs install. > The instructions in Chapter 1 of the User's guide say to unzip the > archive straight into the Python directory. It further says, it > creates a subdirectory named reportlab. Your should now be able to go > to a Python command line interpreter and type import reportlab without > getting an error message. > > > > I unzipped the archive into the Python folder, but the sub folder > created is called ReportLab_2_2, not reportlab. Also if I type "import > reportlab" I get a response of "ImportError: No module named reportlab". > > > > Can anyone point me in the right direction? > > > > Bernie > > > > PS: When you subscribe to this list, the reply address on the > confirmation email is bad. My server reply; > > The following recipient(s) cannot be reached: > > > > reportlab-users-request at reportlab.com on 1/5/2009 1:31 AM > > The e-mail account does not exist at the organization this > message was sent to. Check the e-mail address, or contact the > recipient directly to find out the correct address. > > ------------------------------------------------------------------------ > > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Mon Jan 5 06:46:53 2009 From: andy at reportlab.com (Andy Robinson) Date: Mon, 5 Jan 2009 11:46:53 +0000 Subject: [reportlab-users] Install Problems In-Reply-To: <7BD2AAAB64E075479A228E83F77F0D7E9762@huntsrvr.HuntFamily.local> References: <7BD2AAAB64E075479A228E83F77F0D7E9762@huntsrvr.HuntFamily.local> Message-ID: <956003ae0901050346x47ea228fiacf3ca734fcb0404@mail.gmail.com> 2009/1/5 Bernie Hunt : > I'm new to Python and I'm having trouble with my ReportLabs install. The > instructions in Chapter 1 of the User's guide say to unzip the archive > straight into the Python directory. It further says, it creates a > subdirectory named reportlab. Your should now be able to go to a Python > command line interpreter and type import reportlab without getting an error > message. We'll update the installation instructions for the forthcoming release. That text was written before distutils even existed and this did not get caught until now - sorry! - Andy From bernie at huntfamily.com Mon Jan 5 09:24:28 2009 From: bernie at huntfamily.com (Bernie Hunt) Date: Mon, 05 Jan 2009 09:24:28 -0500 Subject: [reportlab-users] Install Problems In-Reply-To: <4961F124.90004@monicol.co.uk> References: <7BD2AAAB64E075479A228E83F77F0D7E9762@huntsrvr.HuntFamily.local> <4961F124.90004@monicol.co.uk> Message-ID: <7BD2AAAB64E075479A228E83F77F0D7E9763@huntsrvr.HuntFamily.local> Much better. I ran the install and verified I could run "Import reportlabs" so I assume on the way. I have to run but will further test later. Thanks, Bernie From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Peter Mott Sent: Monday, January 05, 2009 6:38 AM To: Support list for users of Reportlab software Subject: Re: [reportlab-users] Install Problems For Windows you need to use a pre-built installer (there is a link on http://www.reportlab.org/downloads.html). For Linux download the package, extract it into a temporary folder and change to that folder where you'll see a file setup.py. Run 'python setup.py install' . Both ways put reportlab in /lib/site-packages/reportlab. Python puts all extra packages in site-packages. Peter Bernie Hunt wrote: I'm new to Python and I'm having trouble with my ReportLabs install. The instructions in Chapter 1 of the User's guide say to unzip the archive straight into the Python directory. It further says, it creates a subdirectory named reportlab. Your should now be able to go to a Python command line interpreter and type import reportlab without getting an error message. I unzipped the archive into the Python folder, but the sub folder created is called ReportLab_2_2, not reportlab. Also if I type "import reportlab" I get a response of "ImportError: No module named reportlab". Can anyone point me in the right direction? Bernie PS: When you subscribe to this list, the reply address on the confirmation email is bad. My server reply; The following recipient(s) cannot be reached: reportlab-users-request at reportlab.com on 1/5/2009 1:31 AM The e-mail account does not exist at the organization this message was sent to. Check the e-mail address, or contact the recipient directly to find out the correct address. ________________________________ _______________________________________________ reportlab-users mailing list reportlab-users at reportlab.com http://two.pairlist.net/mailman/listinfo/reportlab-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernie at huntfamily.com Mon Jan 5 09:25:21 2009 From: bernie at huntfamily.com (Bernie Hunt) Date: Mon, 05 Jan 2009 09:25:21 -0500 Subject: [reportlab-users] Install Problems In-Reply-To: <956003ae0901050346x47ea228fiacf3ca734fcb0404@mail.gmail.com> References: <7BD2AAAB64E075479A228E83F77F0D7E9762@huntsrvr.HuntFamily.local> <956003ae0901050346x47ea228fiacf3ca734fcb0404@mail.gmail.com> Message-ID: <7BD2AAAB64E075479A228E83F77F0D7E9764@huntsrvr.HuntFamily.local> Your quick reply negates the inconvenience. Thanks! Bernie -----Original Message----- From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Andy Robinson Sent: Monday, January 05, 2009 6:47 AM To: Support list for users of Reportlab software Subject: Re: [reportlab-users] Install Problems 2009/1/5 Bernie Hunt : > I'm new to Python and I'm having trouble with my ReportLabs install. The > instructions in Chapter 1 of the User's guide say to unzip the archive > straight into the Python directory. It further says, it creates a > subdirectory named reportlab. Your should now be able to go to a Python > command line interpreter and type import reportlab without getting an error > message. We'll update the installation instructions for the forthcoming release. That text was written before distutils even existed and this did not get caught until now - sorry! - Andy _______________________________________________ reportlab-users mailing list reportlab-users at reportlab.com http://two.pairlist.net/mailman/listinfo/reportlab-users From andy at reportlab.com Mon Jan 5 09:31:43 2009 From: andy at reportlab.com (Andy Robinson) Date: Mon, 5 Jan 2009 14:31:43 +0000 Subject: [reportlab-users] Install Problems In-Reply-To: <7BD2AAAB64E075479A228E83F77F0D7E9763@huntsrvr.HuntFamily.local> References: <7BD2AAAB64E075479A228E83F77F0D7E9762@huntsrvr.HuntFamily.local> <4961F124.90004@monicol.co.uk> <7BD2AAAB64E075479A228E83F77F0D7E9763@huntsrvr.HuntFamily.local> Message-ID: <956003ae0901050631m2d8f7cax1536f3a354c781e9@mail.gmail.com> 2009/1/5 Bernie Hunt : > Much better. I ran the install and verified I could run "Import reportlabs" > so I assume on the way. I have to run but will further test later. "import reportlab" works, but the plural shouldn't. We only have one lab, sadly. -- Andy From bernie at huntfamily.com Mon Jan 5 09:34:39 2009 From: bernie at huntfamily.com (Bernie Hunt) Date: Mon, 05 Jan 2009 09:34:39 -0500 Subject: [reportlab-users] Install Problems In-Reply-To: <956003ae0901050631m2d8f7cax1536f3a354c781e9@mail.gmail.com> References: <7BD2AAAB64E075479A228E83F77F0D7E9762@huntsrvr.HuntFamily.local> <4961F124.90004@monicol.co.uk> <7BD2AAAB64E075479A228E83F77F0D7E9763@huntsrvr.HuntFamily.local> <956003ae0901050631m2d8f7cax1536f3a354c781e9@mail.gmail.com> Message-ID: <7BD2AAAB64E075479A228E83F77F0D7E9765@huntsrvr.HuntFamily.local> Whoops, I hope that didn't commit me to building a whole new lab, hahahaha. Have a great day! Bernie -----Original Message----- From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Andy Robinson Sent: Monday, January 05, 2009 9:32 AM To: Support list for users of Reportlab software Subject: Re: [reportlab-users] Install Problems 2009/1/5 Bernie Hunt : > Much better. I ran the install and verified I could run "Import reportlabs" > so I assume on the way. I have to run but will further test later. "import reportlab" works, but the plural shouldn't. We only have one lab, sadly. -- Andy _______________________________________________ reportlab-users mailing list reportlab-users at reportlab.com http://two.pairlist.net/mailman/listinfo/reportlab-users From cfoster at oda.state.or.us Mon Jan 5 11:33:49 2009 From: cfoster at oda.state.or.us (Chris Foster) Date: Mon, 5 Jan 2009 08:33:49 -0800 Subject: [reportlab-users] New user In-Reply-To: <97886A555FD8E14E8F7445D75C11D54DD2E0B5@EXCHANGE.usn.root.ent> References: <200901021525.15610.aklaver@comcast.net> <97886A555FD8E14E8F7445D75C11D54DD2E0B5@EXCHANGE.usn.root.ent> Message-ID: Even better for searching mailing lists http://markmail.org On Jan 2, 2009, at 5:16 PM, Jessup, David wrote: >> 1) Is there a searchable archive for the mailing list? > > Yes. It's called Google. ;-) Add > "site:two.pairlist.net/pipermail/reportlab-users" to your search terms > to force Google to search its image of the mailing list archive. > > --- David L. Jessup > > -----Original Message----- > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Adrian > Klaver > Sent: Friday, January 02, 2009 6:25 PM > To: reportlab-users at reportlab.com > Subject: [reportlab-users] New user > > I have started working with ReportLab and I have a few questions. > > 1) Is there a searchable archive for the mailing list? > > 2) Is there a way of doing Page of Page? > > 3) I just want to make sure I understand the coordinate system > For pages (0,0) is at the bottom left and for tables it is at the top > left? > > Thanks, > -- > Adrian Klaver > aklaver at comcast.net > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From pedro100 at gmail.com Tue Jan 6 19:33:45 2009 From: pedro100 at gmail.com (Pedro) Date: Wed, 7 Jan 2009 01:33:45 +0100 Subject: [reportlab-users] Need to put together a quick script, some basic questions Message-ID: <9f2d5e960901061633i47fa1f8ah98be45d09ef611b1@mail.gmail.com> Ok, this is my very first message to this list, I've never used reportlab's pdf library nor I've red the documentation yet. What I need to do is this: take a document with 16 A4 pages and then squeeze them all in two A4 pages, 8 on each side. They should be place in such way that after printing both pages on both sides of a sheet, I can fold the sheet a few times, cut the edges, staple them in the middle and end up with a very little 16 pages book. My questions are: -Is this possible to do using this the pdf library? -What issues will arise? -Text in general prints very well, is it possible to keep the text format or do I need to convert to to images? Thank you. Pedro From timr at probo.com Tue Jan 6 20:05:01 2009 From: timr at probo.com (Tim Roberts) Date: Tue, 06 Jan 2009 17:05:01 -0800 Subject: [reportlab-users] Need to put together a quick script, some basic questions In-Reply-To: <9f2d5e960901061633i47fa1f8ah98be45d09ef611b1@mail.gmail.com> References: <9f2d5e960901061633i47fa1f8ah98be45d09ef611b1@mail.gmail.com> Message-ID: <4963FFBD.4020709@probo.com> Pedro wrote: > Ok, this is my very first message to this list, I've never used > reportlab's pdf library nor I've red the documentation yet. > What I need to do is this: > take a document with 16 A4 pages and then squeeze them all in two A4 > pages, 8 on each side. They should be place in such way that after > printing both pages on both sides of a sheet, I can fold the sheet a > few times, cut the edges, staple them in the middle and end up with a > very little 16 pages book. > > My questions are: > -Is this possible to do using this the pdf library? > -What issues will arise? > -Text in general prints very well, is it possible to keep the text > format or do I need to convert to to images? > This is not a Reportlab task. I gather that you already have this 16-page document, created by some other application, right? What you need are PDF manipulation tools. Reportlab is used to create documents, not to manipulate existing documents. If you were creating the document from scratch, then Reportlab could do it. The standard Acrobat PDF reader can create booklets right out of the box, but it only does 2 pages per side. It can print your document 8-up, but not so that it can be folded and stapled like this. If you Google for "pdf booklet conversion", you'll find a number of hits for tools that can do this. I don't have experience with any of them. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From DJESSUP at usnews.com Tue Jan 6 20:13:56 2009 From: DJESSUP at usnews.com (Jessup, David) Date: Tue, 6 Jan 2009 20:13:56 -0500 Subject: [reportlab-users] New user In-Reply-To: References: <200901021525.15610.aklaver@comcast.net><97886A555FD8E14E8F7445D75C11D54DD2E0B5@EXCHANGE.usn.root.ent> Message-ID: <97886A555FD8E14E8F7445D75C11D54DD2E0C7@EXCHANGE.usn.root.ent> Er... OK. Except that markmail doesn't appear to index this mailing list. -----Original Message----- From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Chris Foster Sent: Monday, January 05, 2009 11:34 AM To: Support list for users of Reportlab software Subject: Re: [reportlab-users] New user Even better for searching mailing lists http://markmail.org On Jan 2, 2009, at 5:16 PM, Jessup, David wrote: >> 1) Is there a searchable archive for the mailing list? > > Yes. It's called Google. ;-) Add > "site:two.pairlist.net/pipermail/reportlab-users" to your search terms > to force Google to search its image of the mailing list archive. > > --- David L. Jessup > > -----Original Message----- > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Adrian > Klaver > Sent: Friday, January 02, 2009 6:25 PM > To: reportlab-users at reportlab.com > Subject: [reportlab-users] New user > > I have started working with ReportLab and I have a few questions. > > 1) Is there a searchable archive for the mailing list? > > 2) Is there a way of doing Page of Page? > > 3) I just want to make sure I understand the coordinate system > For pages (0,0) is at the bottom left and for tables it is at the top > left? > > Thanks, > -- > Adrian Klaver > aklaver at comcast.net > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users _______________________________________________ reportlab-users mailing list reportlab-users at reportlab.com http://two.pairlist.net/mailman/listinfo/reportlab-users From cfoster at oda.state.or.us Tue Jan 6 20:23:44 2009 From: cfoster at oda.state.or.us (Chris Foster) Date: Tue, 6 Jan 2009 17:23:44 -0800 Subject: [reportlab-users] New user In-Reply-To: <97886A555FD8E14E8F7445D75C11D54DD2E0C7@EXCHANGE.usn.root.ent> References: <200901021525.15610.aklaver@comcast.net><97886A555FD8E14E8F7445D75C11D54DD2E0B5@EXCHANGE.usn.root.ent> <97886A555FD8E14E8F7445D75C11D54DD2E0C7@EXCHANGE.usn.root.ent> Message-ID: <1F955374-DCDB-4260-9A51-09D337E829ED@oda.state.or.us> Sorry, you are right. I've submitted the list to them. The posts I saw were mentions of ReportLab on other lists. It is a nice service though. Think RL users might be ready for IRC? On Jan 6, 2009, at 5:13 PM, Jessup, David wrote: > Er... OK. Except that markmail doesn't appear to index this mailing > list. > > -----Original Message----- > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Chris > Foster > Sent: Monday, January 05, 2009 11:34 AM > To: Support list for users of Reportlab software > Subject: Re: [reportlab-users] New user > > Even better for searching mailing lists http://markmail.org > > On Jan 2, 2009, at 5:16 PM, Jessup, David wrote: > >>> 1) Is there a searchable archive for the mailing list? >> >> Yes. It's called Google. ;-) Add >> "site:two.pairlist.net/pipermail/reportlab-users" to your search >> terms >> to force Google to search its image of the mailing list archive. >> >> --- David L. Jessup >> >> -----Original Message----- >> From: reportlab-users-bounces at reportlab.com >> [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Adrian >> Klaver >> Sent: Friday, January 02, 2009 6:25 PM >> To: reportlab-users at reportlab.com >> Subject: [reportlab-users] New user >> >> I have started working with ReportLab and I have a few questions. >> >> 1) Is there a searchable archive for the mailing list? >> >> 2) Is there a way of doing Page of Page? >> >> 3) I just want to make sure I understand the coordinate system >> For pages (0,0) is at the bottom left and for tables it is at the top >> left? >> >> Thanks, >> -- >> Adrian Klaver >> aklaver at comcast.net >> _______________________________________________ >> reportlab-users mailing list >> reportlab-users at reportlab.com >> http://two.pairlist.net/mailman/listinfo/reportlab-users >> _______________________________________________ >> reportlab-users mailing list >> reportlab-users at reportlab.com >> http://two.pairlist.net/mailman/listinfo/reportlab-users > > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From DJESSUP at usnews.com Tue Jan 6 20:27:30 2009 From: DJESSUP at usnews.com (Jessup, David) Date: Tue, 6 Jan 2009 20:27:30 -0500 Subject: [reportlab-users] New user In-Reply-To: <97886A555FD8E14E8F7445D75C11D54DD2E0B5@EXCHANGE.usn.root.ent> References: <200901021525.15610.aklaver@comcast.net> <97886A555FD8E14E8F7445D75C11D54DD2E0B5@EXCHANGE.usn.root.ent> Message-ID: <97886A555FD8E14E8F7445D75C11D54DD2E0C8@EXCHANGE.usn.root.ent> I noticed that no one responded to your questions 2 and 3 after I responded to question 1. Hmmm.... I can't answer question 2, but I'll take a swing at #3. > 3) I just want to make sure I understand the coordinate system > For pages (0,0) is at the bottom left and for tables it is at the top > left? As far as I know, this is true, at least in the default case. However, rotating pages will change which corner is the origin. A good explanation of how this works was given a month ago by Tim Roberts. (http://two.pairlist.net/pipermail/reportlab-users/2008-December/007741. html) Unfortunately, the ASCII pictures are a bit screwed up by a combination of the website's use of a variable-width font and the fact that consecutive spaces are collapsed together. --- David L. Jessup -----Original Message----- From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Jessup, David Sent: Friday, January 02, 2009 8:16 PM To: Support list for users of Reportlab software Subject: Re: [reportlab-users] New user > 1) Is there a searchable archive for the mailing list? Yes. It's called Google. ;-) Add "site:two.pairlist.net/pipermail/reportlab-users" to your search terms to force Google to search its image of the mailing list archive. --- David L. Jessup -----Original Message----- From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Adrian Klaver Sent: Friday, January 02, 2009 6:25 PM To: reportlab-users at reportlab.com Subject: [reportlab-users] New user I have started working with ReportLab and I have a few questions. 1) Is there a searchable archive for the mailing list? 2) Is there a way of doing Page of Page? 3) I just want to make sure I understand the coordinate system For pages (0,0) is at the bottom left and for tables it is at the top left? Thanks, -- Adrian Klaver aklaver at comcast.net _______________________________________________ reportlab-users mailing list reportlab-users at reportlab.com http://two.pairlist.net/mailman/listinfo/reportlab-users _______________________________________________ reportlab-users mailing list reportlab-users at reportlab.com http://two.pairlist.net/mailman/listinfo/reportlab-users From pedro100 at gmail.com Tue Jan 6 22:22:00 2009 From: pedro100 at gmail.com (Pedro) Date: Wed, 7 Jan 2009 04:22:00 +0100 Subject: [reportlab-users] Need to put together a quick script, some basic questions In-Reply-To: <4963FFBD.4020709@probo.com> References: <9f2d5e960901061633i47fa1f8ah98be45d09ef611b1@mail.gmail.com> <4963FFBD.4020709@probo.com> Message-ID: <9f2d5e960901061922v496cc15bt58c1b28ef19617b8@mail.gmail.com> I gooled a bit arround and found out that this is a technique called 'page imposition'. After some more googling I found a rather easy to use tool that does this simply by running a comand line tool with the right parameters. Just in case somebody runs across the same issue: http://multivalent.sourceforge.net/ it has a cool imposition tool Thank you On Wed, Jan 7, 2009 at 2:05 AM, Tim Roberts wrote: > Pedro wrote: >> Ok, this is my very first message to this list, I've never used >> reportlab's pdf library nor I've red the documentation yet. >> What I need to do is this: >> take a document with 16 A4 pages and then squeeze them all in two A4 >> pages, 8 on each side. They should be place in such way that after >> printing both pages on both sides of a sheet, I can fold the sheet a >> few times, cut the edges, staple them in the middle and end up with a >> very little 16 pages book. >> >> My questions are: >> -Is this possible to do using this the pdf library? >> -What issues will arise? >> -Text in general prints very well, is it possible to keep the text >> format or do I need to convert to to images? >> > > This is not a Reportlab task. I gather that you already have this > 16-page document, created by some other application, right? What you > need are PDF manipulation tools. Reportlab is used to create documents, > not to manipulate existing documents. If you were creating the document > from scratch, then Reportlab could do it. > > The standard Acrobat PDF reader can create booklets right out of the > box, but it only does 2 pages per side. It can print your document > 8-up, but not so that it can be folded and stapled like this. > > If you Google for "pdf booklet conversion", you'll find a number of hits > for tools that can do this. I don't have experience with any of them. > > -- > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > From watson_rawlyn at yahoo.co.uk Wed Jan 7 04:22:07 2009 From: watson_rawlyn at yahoo.co.uk (Rawlyn Watson) Date: Wed, 7 Jan 2009 09:22:07 +0000 (GMT) Subject: [reportlab-users] reportlab-users Digest, Vol 56, Issue 9 References: Message-ID: <764272.53704.qm@web28603.mail.ukl.yahoo.com> > From: Chris Foster > Think RL users might be ready for IRC? I'm probably not the only person here who can't access IRC from work - which is where I use RL. If an IRC channel is started, please don't ditch the email service! From cfoster at oda.state.or.us Wed Jan 7 12:14:50 2009 From: cfoster at oda.state.or.us (Chris Foster) Date: Wed, 7 Jan 2009 09:14:50 -0800 Subject: [reportlab-users] reportlab-users Digest, Vol 56, Issue 9 In-Reply-To: <764272.53704.qm@web28603.mail.ukl.yahoo.com> References: <764272.53704.qm@web28603.mail.ukl.yahoo.com> Message-ID: I have the same issue. However, mibbit.com has come to my rescue so many times the boss won't rat me out. I also saw a new, XMPP, Python- based service the other day speeqe.com . There have been times when it would have been nice to have a quick chat on ReportLab issues. I won't ditch the mailing list. On Jan 7, 2009, at 1:22 AM, Rawlyn Watson wrote: >> From: Chris Foster >> Think RL users might be ready for IRC? > > I'm probably not the only person here who can't access IRC from work > - which is where I use RL. If an IRC channel is started, please > don't ditch the email service! > > > > > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From gherman at darwin.in-berlin.de Wed Jan 7 13:01:04 2009 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed, 7 Jan 2009 19:01:04 +0100 Subject: [reportlab-users] Need to put together a quick script, some basic questions In-Reply-To: <9f2d5e960901061922v496cc15bt58c1b28ef19617b8@mail.gmail.com> References: <9f2d5e960901061633i47fa1f8ah98be45d09ef611b1@mail.gmail.com> <4963FFBD.4020709@probo.com> <9f2d5e960901061922v496cc15bt58c1b28ef19617b8@mail.gmail.com> Message-ID: Pedro: > I gooled a bit arround and found out that this is a technique called > 'page imposition'. After some more googling I found a rather easy to > use tool that does this simply by running a comand line tool with the > right parameters. > > Just in case somebody runs across the same issue: > http://multivalent.sourceforge.net/ > it has a cool imposition tool I did, but I wanted a Python solution I can easily tweak myself so I wrote pdfnup [1] which has no booklet feature yet as you described it, yet, but that might be added, sometime. It uses pyPdf, which you could also use seperately to rearrange and flip pages as needed before calling pdfnup... Regards, Dinu [1] http://pypi.python.org/pypi/pdfnup -------------- next part -------------- An HTML attachment was scrubbed... URL: From gherman at darwin.in-berlin.de Wed Jan 7 13:06:22 2009 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed, 7 Jan 2009 19:06:22 +0100 Subject: [reportlab-users] pdf417 barcodes In-Reply-To: <495E3C0C.4070602@personnelware.com> References: <495AB771.6000708@personnelware.com> <495B470D.20705@chamonix.reportlab.co.uk> <3C08AF0D-2721-4A06-B795-640362C6A694@darwin.in-berlin.de> <495BBCB7.2040006@personnelware.com> <495E3C0C.4070602@personnelware.com> Message-ID: <06F4892A-BEBF-42D0-A2A7-39C93C0A4A8B@darwin.in-berlin.de> Carl Karsten: > No, I meant how were you going to code the reportlab side. mainly > passing the (name,email...) to the code that encodes to the barcode, > then getting whatever it returns (bmp, ps, eps, etc) into reporlab. I see. Well, in the absence of the QRcode sample (I'll keep looking, but cannot promise I find it), here you'll find something similar I wrote a while ago, and that might be helpful: http://two.pairlist.net/pipermail/reportlab-users/2007-July/006154.html Regards, Dinu From carl at personnelware.com Wed Jan 7 13:49:21 2009 From: carl at personnelware.com (Carl Karsten) Date: Wed, 07 Jan 2009 12:49:21 -0600 Subject: [reportlab-users] Need to put together a quick script, some basic questions In-Reply-To: References: <9f2d5e960901061633i47fa1f8ah98be45d09ef611b1@mail.gmail.com> <4963FFBD.4020709@probo.com> <9f2d5e960901061922v496cc15bt58c1b28ef19617b8@mail.gmail.com> Message-ID: <4964F931.2040100@personnelware.com> Dinu Gherman wrote: > Pedro: > >> I gooled a bit arround and found out that this is a technique called >> 'page imposition'. After some more googling I found a rather easy to >> use tool that does this simply by running a comand line tool with the >> right parameters. >> >> Just in case somebody runs across the same issue: >> http://multivalent.sourceforge.net/ >> it has a cool imposition tool > > I did, but I wanted a Python solution I can easily tweak myself > so I wrote pdfnup [1] which has no booklet feature yet as you > described it, yet, but that might be added, sometime. It uses > pyPdf, which you could also use seperately to rearrange and > flip pages as needed before calling pdfnup... I just stumbled onto https://edge.launchpad.net/poppler-python It will render PDF, and I am guessing it will print, so I bet you could render a bunch of pages onto one canvas and print that. I am just using it to make a thumbnail image, so that's all I know for sure. Carl K From carl at personnelware.com Wed Jan 7 13:57:24 2009 From: carl at personnelware.com (Carl Karsten) Date: Wed, 07 Jan 2009 12:57:24 -0600 Subject: [reportlab-users] pdf417 barcodes In-Reply-To: <06F4892A-BEBF-42D0-A2A7-39C93C0A4A8B@darwin.in-berlin.de> References: <495AB771.6000708@personnelware.com> <495B470D.20705@chamonix.reportlab.co.uk> <3C08AF0D-2721-4A06-B795-640362C6A694@darwin.in-berlin.de> <495BBCB7.2040006@personnelware.com> <495E3C0C.4070602@personnelware.com> <06F4892A-BEBF-42D0-A2A7-39C93C0A4A8B@darwin.in-berlin.de> Message-ID: <4964FB14.1070301@personnelware.com> Dinu Gherman wrote: > Carl Karsten: > >> No, I meant how were you going to code the reportlab side. mainly >> passing the (name,email...) to the code that encodes to the barcode, >> then getting whatever it returns (bmp, ps, eps, etc) into reporlab. > > I see. Well, in the absence of the QRcode sample (I'll keep looking, > but cannot promise I find it), here you'll find something similar > I wrote a while ago, and that might be helpful: > > http://two.pairlist.net/pipermail/reportlab-users/2007-July/006154.html Yeah, that. thanks. I am having trouble following how that works. If it works the way I am guessing it does, I can see the advantage, but I think I like generating the barcode outside of the reportlab environment - easier to unit test. Current plan is to write some python bindings for http://sourceforge.net/projects/pdf417encode/ Or .popen() the existing command line. Carl K From gabor at tastebook.com Wed Jan 7 15:29:57 2009 From: gabor at tastebook.com (Gabor Torok) Date: Wed, 7 Jan 2009 12:29:57 -0800 Subject: [reportlab-users] platypus in header Message-ID: Is it possible to use platypus (paragraph, tables, etc.) flowables in the header and footer? Could you point me to an example of this? Thanks! --Gabor From aklaver at comcast.net Wed Jan 7 19:54:34 2009 From: aklaver at comcast.net (Adrian Klaver) Date: Wed, 7 Jan 2009 16:54:34 -0800 Subject: [reportlab-users] New user In-Reply-To: <97886A555FD8E14E8F7445D75C11D54DD2E0C8@EXCHANGE.usn.root.ent> References: <200901021525.15610.aklaver@comcast.net> <97886A555FD8E14E8F7445D75C11D54DD2E0B5@EXCHANGE.usn.root.ent> <97886A555FD8E14E8F7445D75C11D54DD2E0C8@EXCHANGE.usn.root.ent> Message-ID: <200901071654.35048.aklaver@comcast.net> On Tuesday 06 January 2009 5:27:30 pm Jessup, David wrote: > I noticed that no one responded to your questions 2 and 3 after I > responded to question 1. Hmmm.... I can't answer question 2, but I'll > take a swing at #3. > > > 3) I just want to make sure I understand the coordinate system > > For pages (0,0) is at the bottom left and for tables it is at the top > > left? > > As far as I know, this is true, at least in the default case. However, > rotating pages will change which corner is the origin. A good > explanation of how this works was given a month ago by Tim Roberts. > (http://two.pairlist.net/pipermail/reportlab-users/2008-December/007741. > html) Unfortunately, the ASCII pictures are a bit screwed up by a > combination of the website's use of a variable-width font and the fact > that consecutive spaces are collapsed together. Thanks I will take a look. -- Adrian Klaver aklaver at comcast.net From gogtesuyash at gmail.com Thu Jan 8 05:12:09 2009 From: gogtesuyash at gmail.com (Suyash Gogte) Date: Thu, 8 Jan 2009 15:42:09 +0530 Subject: [reportlab-users] append existing pdf Message-ID: <5797af200901080212s159992e1ue9fe38c8c66c7d48@mail.gmail.com> i want to append contents to existing pdf is there any way to do this... means i have already created file abc.pdf but now i want to append contents to this file.... thnks -------------- next part -------------- An HTML attachment was scrubbed... URL: From cfoster at oda.state.or.us Thu Jan 8 11:06:38 2009 From: cfoster at oda.state.or.us (Chris Foster) Date: Thu, 8 Jan 2009 08:06:38 -0800 Subject: [reportlab-users] append existing pdf In-Reply-To: <5797af200901080212s159992e1ue9fe38c8c66c7d48@mail.gmail.com> References: <5797af200901080212s159992e1ue9fe38c8c66c7d48@mail.gmail.com> Message-ID: pyPDF http://pybrary.net/pyPdf/ On Jan 8, 2009, at 2:12 AM, Suyash Gogte wrote: > i want to append contents to existing pdf is there any way to do > this... > means i have already created file abc.pdf but now i want to append > contents to this file.... > thnks > > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From fbs at tinyerp.com Fri Jan 9 05:26:19 2009 From: fbs at tinyerp.com (Fabian) Date: Fri, 09 Jan 2009 11:26:19 +0100 Subject: [reportlab-users] Numerous pdfs generation Message-ID: <4967264B.1060506@tinyerp.com> Hello, I need to generate around 300pdfs of 20000 pages a day. And I'd like to know if reportlab/platypus could work in streamline (writing the pdf on disk without loading everything into memory) or if a flush method exists to write on disk and flush memory when wanted. Thank you, Fabian From jonas at reportlab.com Fri Jan 9 05:42:19 2009 From: jonas at reportlab.com (jonas wustrack) Date: Fri, 9 Jan 2009 10:42:19 +0000 Subject: [reportlab-users] fixing bugs in 2.2 / Hyphenation support In-Reply-To: References: <13161370.1220650022283.JavaMail.ngmail@webmail18.arcor-online.net> <20081006093251.GA32574@Clio.twb.ath.cx> Message-ID: Hi Trent, We made changes to the trunk of our reportlab repository which should solve the problem below. Wordaxe now seems to do its job without the need to replace rl_codecs.py. I tried the tests out myself and they seem to work - hyphens appear in the pdf instead of ugly black boxes. Can you confirm this? Best Regards, Jonas Wustrack On Thu, Oct 9, 2008 at 5:06 PM, Henning von Bargen wrote: > Trent, > > obviously your message didn't make it into the ReportLab users mailing list. > > I waited a few days to see if it appears there and maybe someone from the > ReportLab staff answers, but since this was not the case: > > ----- Original Message ----- From: "Trent W. Buck" > To: > Cc: > Sent: Monday, October 06, 2008 11:32 AM > Subject: Re: [reportlab-users] fixing bugs in 2.2 / Hyphenation support > > >> On Fri, Sep 05, 2008 at 11:27:02PM +0200, henning.vonbargen at arcor.de >> wrote: >>> >>> It was difficult for me to create a minimal invasive integration of >>> the wordaxe hyphenation library into ReportLab. The best solution I >>> could think of still required a minimal change to rl_codecs.py. >>> >>> ==> It would help a lot if my version of rl_codecs.py could make >>> it into the RL repository. I can hardly imagine how this could >>> break existing code, but who knows... This should be reviewed by ? >>> the RL people. >> >> This fix has not been integrated into reportlab 2.2. Is there a >> reportlab issue tracker (BTS) that I can use to monitor the status of >> this bug? I could not find any mention of such a thing on >> reportlab.org or www.reportlab.com. > > No, there isn't. However, ReportLab has recently announced that there > will be one soon (whatever that means). > >> >> As the soon-to-be Debian maintainer wordaxe, I have configured the >> wordaxe package to automatically replace (cleanly, via diversions) >> reportlab's misbehaving rl_codecs.py with wordaxe's version. > > Does this mean Debian is to include wordaxe in their distribution? Cool! > >> >> Attached is a diff between the rl_codecs.py files in RL 2.2 and >> Wordaxe 0.2.6, to demonstrate to lurking reportlab developers just how >> minimal this patch is. > > Sorry, but there wasn't any attachment in your message. > > Henning > > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > -- Jonas From andy at reportlab.com Fri Jan 9 06:41:56 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 9 Jan 2009 11:41:56 +0000 Subject: [reportlab-users] Numerous pdfs generation In-Reply-To: <4967264B.1060506@tinyerp.com> References: <4967264B.1060506@tinyerp.com> Message-ID: <956003ae0901090341y5205f02ie3474c1402acab78@mail.gmail.com> 2009/1/9 Fabian : > > Hello, > > I need to generate around 300pdfs of 20000 pages a day. And I'd like to know > if reportlab/platypus could work in streamline (writing the pdf on disk > without loading everything into memory) or if a flush method exists to write > on disk and flush memory when wanted. At the moment it works entirely in memory. This is good enough for 1000-page books and gives us flexibility, and we never met anyone who wanted to handle single PDF files bigger than that before! Can you tell us what kind of documents need to be this size, out of curiosity?) There are certainly optimisations we could carry out easily to make it work better for large documents - basically save each page stream to a temporary file rather than in memory - and there is also a PDF sub-format called 'linearised PDF' to do what you want, but it's not implemented at this time. If you'd like to discuss adding these features to support your process, it's best to email me directly as there might be costs involved. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From jonas at reportlab.com Fri Jan 9 07:54:55 2009 From: jonas at reportlab.com (jonas wustrack) Date: Fri, 9 Jan 2009 12:54:55 +0000 Subject: [reportlab-users] svg rendering and groups In-Reply-To: <48E87742.4040105@tromp.org> References: <48E3AC8E.1050605@tromp.org> <78159F19-3C1D-4862-AF84-9C4973295AA7@darwin.in-berlin.de> <956003ae0810020322hfcf878aw4bfe0092f3f06809@mail.gmail.com> <48E87742.4040105@tromp.org> Message-ID: We had a closer look at Dinu's code and noticed that he is using getCTM which returns the cumulative transformation matrix of the current group and all its parents, while still outputting the parent groups into the xml. Therefor transformations got applied twice or more in nested groups. Marcel's patch worked in a graphics POV because it serializing nested groups. The patch below sets the non-cumulative transformation matrix to each group, therefor preserving all the group information and still producing the right graphics. Can Dinu please review this, as he knows more about renderSVG.py than we do. We can then apply this patch to our repository. Thanks, Jonas Wustrack Index: graphics/renderSVG.py =================================================================== --- graphics/renderSVG.py (revision 3356) +++ graphics/renderSVG.py (working copy) @@ -655,7 +655,7 @@ if self.verbose: print "### begin _SVGRenderer.drawGroup" currGroup = self._canvas.startGroup() - a, b, c, d, e, f = self._tracker.getCTM() + a, b, c, d, e, f = self._tracker.getState()['transform'] for childNode in group.getContents(): if isinstance(childNode, UserNode): node2 = childNode.provideNode() On Sun, Oct 5, 2008 at 8:13 AM, Marcel Tromp wrote: > Problem is that renderSVG assumes additive transforms while RL assumes > absolute transforms for groups in groups. > > The patch below solves the problem. It surpresses transforms for group > elements. > > Marcel > -- > > --- renderSVG.py 2008-10-04 22:37:44.791828000 -0700 > +++ > /lib/python2.5/site-packages/reportlab/graphics/renderSVG.py > 2008-06-30 20:47:27.069418000 -0700 > @@ -661,19 +661,10 @@ > node2 = childNode.provideNode() > else: > node2 = childNode > - if isinstance(node2, Group) == False: > - self.drawNode(node2) > + self.drawNode(node2) > self._canvas.transform(a, b, c, d, e, f) > self._canvas.endGroup(currGroup) > > - for childNode in group.getContents(): > - if isinstance(childNode, UserNode): > - node2 = childNode.provideNode() > - else: > - node2 = childNode > - if isinstance(node2, Group): > - self.drawNode(node2) > - > if self.verbose: print "### end _SVGRenderer.drawGroup" > > > > Andy Robinson wrote: >> >> 2008/10/2 Dinu Gherman : >>> >>> I was involved in writing ReportLab's renderSVG module (Robin, >>> correct me, if I'm wrong), but I am no longer and I don't know >>> how much RL supports or even uses this code nowadays. >> >> Nobody here actually looks closely at the output. >> >> We'd welcome both specific error messages and patches; I can be >> certain they won't break any RL applications as we don't use SVG >> at all. >> >> - Andy >> _______________________________________________ >> reportlab-users mailing list >> reportlab-users at reportlab.com >> http://two.pairlist.net/mailman/listinfo/reportlab-users > > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > -- Jonas From bernie at huntfamily.com Fri Jan 9 08:20:36 2009 From: bernie at huntfamily.com (Bernie Hunt) Date: Fri, 09 Jan 2009 08:20:36 -0500 Subject: [reportlab-users] Numerous pdfs generation In-Reply-To: <956003ae0901090341y5205f02ie3474c1402acab78@mail.gmail.com> References: <4967264B.1060506@tinyerp.com> <956003ae0901090341y5205f02ie3474c1402acab78@mail.gmail.com> Message-ID: <7BD2AAAB64E075479A228E83F77F0D7E977E@huntsrvr.HuntFamily.local> I'm curious, do you mean 300 documents of 20,000 pages for a total of 6,000,000 pages a day, or 300 documents of 66.7 pages for a total of 20,000 a day? If it's the 6M pages a day, can you tell us what is the application? That's a lot of pages! Bernie -----Original Message----- From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Andy Robinson Sent: Friday, January 09, 2009 6:42 AM To: Support list for users of Reportlab software Subject: Re: [reportlab-users] Numerous pdfs generation 2009/1/9 Fabian : > > Hello, > > I need to generate around 300pdfs of 20000 pages a day. And I'd like to know > if reportlab/platypus could work in streamline (writing the pdf on disk > without loading everything into memory) or if a flush method exists to write > on disk and flush memory when wanted. From jonas at reportlab.com Fri Jan 9 08:31:07 2009 From: jonas at reportlab.com (jonas wustrack) Date: Fri, 9 Jan 2009 13:31:07 +0000 Subject: [reportlab-users] splitByRow In-Reply-To: <200901021846.16298.aklaver@comcast.net> References: <200901021846.16298.aklaver@comcast.net> Message-ID: Thanks for pointing this out. This feature has never been implemented so currently tables can only be split by row. The documentation is now fixed in the repository. -- Jonas On Sat, Jan 3, 2009 at 2:46 AM, Adrian Klaver wrote: > ReportLab 2.2 > I seem to not understand the splitByRow argument to Table(). If I set it to 0 > for a table that is too tall and wide for the page I get the following > traceback. If I set it to 1 then the doc fails to build unless the columns > fit within the page width then the table splits between rows. It seems at > present tables can only split by row, not by column. This is contrary to what > the documentation says; > > "For very wide tables, they can also split 'by column'. You can choose whether > tou(sic) want to split down-and-across or across-and-down" > > Am I missing something? > > > Traceback (most recent call last) > > /home/aklaver/software_projects/production_database/python_code/ console> in () > > /usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py in > build(self, flowables, onFirstPage, onLaterPages, canvasmaker) > 985 if onLaterPages is _doNothing and > hasattr(self,'onLaterPages'): > 986 self.pageTemplates[1].beforeDrawPage = self.onLaterPages > --> 987 BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker) > 988 > 989 def progressCB(typ, value): > > /usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py in > build(self, flowables, filename, canvasmaker) > 754 try: > 755 first = flowables[0] > --> 756 self.handle_flowable(flowables) > 757 handled += 1 > 758 except: > > /usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py in > handle_flowable(self, flowables) > 655 if self.allowSplitting: > 656 # see if this is a splittable thing > --> 657 S = frame.split(f,canv) > 658 n = len(S) > 659 else: > > /usr/lib/python2.5/site-packages/reportlab/platypus/frames.py in split(self, > flowable, canv) > 196 s = max(s-self._prevASpace,0) > 197 flowable.canv = canv #some flowables might need this > --> 198 r = flowable.split(self._aW, y-p-s) > 199 del flowable.canv > 200 return r > > /usr/lib/python2.5/site-packages/reportlab/platypus/tables.py in split(self, > availWidth, availHeight) > 1271 return self._splitRows(availHeight) > 1272 else: > -> 1273 raise NotImplementedError > 1274 > 1275 def draw(self): > > : > > Thanks, > -- > Adrian Klaver > aklaver at comcast.net > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > -- Jonas From fbs at tinyerp.com Fri Jan 9 08:43:31 2009 From: fbs at tinyerp.com (Fabian) Date: Fri, 09 Jan 2009 14:43:31 +0100 Subject: [reportlab-users] Numerous pdfs generation In-Reply-To: <7BD2AAAB64E075479A228E83F77F0D7E977E@huntsrvr.HuntFamily.local> References: <4967264B.1060506@tinyerp.com> <956003ae0901090341y5205f02ie3474c1402acab78@mail.gmail.com> <7BD2AAAB64E075479A228E83F77F0D7E977E@huntsrvr.HuntFamily.local> Message-ID: <49675483.5080703@tinyerp.com> Yes, it's the 6M pages a day. Concerning that need for such a high number of pages/pdf : I'm responsible for the development of the Direct Marketing module for OpenERP. OpenERP (formerly TinyERP) uses reportlab to generate documents (invoices, purchase orders, etc.) and until now it has perfectly fits our needs. The client sponsoring the dm project is specialized in worldwide direct marketing (paper advertising) and the 300x20000 pages is an average of it's last month production. Each night, their actual system generates documents for around 300 marketing campaigns, with one pdf by campaign they manage and one campaign targeting around 2000 clients with usualy a 10 pages doc. The 20000 pages/pdf is what we should achieve but they already had to produce up to 100000 pages/doc. Fabian Bernie Hunt wrote: > I'm curious, do you mean 300 documents of 20,000 pages for a total of > 6,000,000 pages a day, or 300 documents of 66.7 pages for a total of > 20,000 a day? > > If it's the 6M pages a day, can you tell us what is the application? > That's a lot of pages! > > Bernie > > > -----Original Message----- > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Andy > Robinson > Sent: Friday, January 09, 2009 6:42 AM > To: Support list for users of Reportlab software > Subject: Re: [reportlab-users] Numerous pdfs generation > > 2009/1/9 Fabian : > >> Hello, >> >> I need to generate around 300pdfs of 20000 pages a day. And I'd like >> > to know > >> if reportlab/platypus could work in streamline (writing the pdf on >> > disk > >> without loading everything into memory) or if a flush method exists to >> > write > >> on disk and flush memory when wanted. >> > > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > -- Fabian Semal Project Manager OpenERP - Tiny sprl Web: http://www.openerp.com From andy at reportlab.com Fri Jan 9 08:49:55 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 9 Jan 2009 13:49:55 +0000 Subject: [reportlab-users] Numerous pdfs generation In-Reply-To: <49675483.5080703@tinyerp.com> References: <4967264B.1060506@tinyerp.com> <956003ae0901090341y5205f02ie3474c1402acab78@mail.gmail.com> <7BD2AAAB64E075479A228E83F77F0D7E977E@huntsrvr.HuntFamily.local> <49675483.5080703@tinyerp.com> Message-ID: <956003ae0901090549ma87adcfl86028b5058960b1e@mail.gmail.com> 2009/1/9 Fabian : > > Yes, it's the 6M pages a day. Have you actually done some experiments and looked at the resulting file sizes, and/or run out of memory? What limits do you hit? I presume that these are stacks of highly similar documents - for example a big stack of invoices. The trick here is to make very thorough use of 'form xobjects' for anything which is used frequently. So, for example, your invoice template and letterhead might need to be drawn and stored just once in that mega-pdf-file. Then you only need to render the words which differ on each page in the main story. If you use these techniques, it's amazing how many pages you can spit out and how quickly. And it's not worth an R&D effort if a couple of extra GB of RAM will do the trick. The second question I'd ask is if the client really needs each of these to be delivered as a single file. If they have, say, a 200,000 page stack of invoices, would they not be equally happy with a directory of files each containing 1000 pages, or by client IDs, or some other structure making it easy to find the PDF they want? When clients have asked me for huge docs in the past, they have always seen the wisdom of breaking it up a bit after some initial discussion. - Andy From bernie at huntfamily.com Fri Jan 9 09:13:15 2009 From: bernie at huntfamily.com (Bernie Hunt) Date: Fri, 09 Jan 2009 09:13:15 -0500 Subject: [reportlab-users] Numerous pdfs generation In-Reply-To: <49675483.5080703@tinyerp.com> References: <4967264B.1060506@tinyerp.com> <956003ae0901090341y5205f02ie3474c1402acab78@mail.gmail.com> <7BD2AAAB64E075479A228E83F77F0D7E977E@huntsrvr.HuntFamily.local> <49675483.5080703@tinyerp.com> Message-ID: <7BD2AAAB64E075479A228E83F77F0D7E977F@huntsrvr.HuntFamily.local> Wow! That is impressive. Sorry I can't answer the report lab question. I was just curious in that software geek kind of way. Good luck with the project! Bernie -----Original Message----- From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Fabian Sent: Friday, January 09, 2009 8:44 AM To: Support list for users of Reportlab software Subject: Re: [reportlab-users] Numerous pdfs generation Yes, it's the 6M pages a day. Concerning that need for such a high number of pages/pdf : I'm responsible for the development of the Direct Marketing module for OpenERP. OpenERP (formerly TinyERP) uses reportlab to generate documents (invoices, purchase orders, etc.) and until now it has perfectly fits our needs. The client sponsoring the dm project is specialized in worldwide direct marketing (paper advertising) and the 300x20000 pages is an average of it's last month production. Each night, their actual system generates documents for around 300 marketing campaigns, with one pdf by campaign they manage and one campaign targeting around 2000 clients with usualy a 10 pages doc. The 20000 pages/pdf is what we should achieve but they already had to produce up to 100000 pages/doc. Fabian Bernie Hunt wrote: > I'm curious, do you mean 300 documents of 20,000 pages for a total of > 6,000,000 pages a day, or 300 documents of 66.7 pages for a total of > 20,000 a day? > > If it's the 6M pages a day, can you tell us what is the application? > That's a lot of pages! > > Bernie > > > -----Original Message----- > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Andy > Robinson > Sent: Friday, January 09, 2009 6:42 AM > To: Support list for users of Reportlab software > Subject: Re: [reportlab-users] Numerous pdfs generation > > 2009/1/9 Fabian : > >> Hello, >> >> I need to generate around 300pdfs of 20000 pages a day. And I'd like >> > to know > >> if reportlab/platypus could work in streamline (writing the pdf on >> > disk > >> without loading everything into memory) or if a flush method exists to >> > write > >> on disk and flush memory when wanted. >> > > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > -- Fabian Semal Project Manager OpenERP - Tiny sprl Web: http://www.openerp.com _______________________________________________ reportlab-users mailing list reportlab-users at reportlab.com http://two.pairlist.net/mailman/listinfo/reportlab-users From fbs at tinyerp.com Fri Jan 9 09:49:29 2009 From: fbs at tinyerp.com (Fabian) Date: Fri, 09 Jan 2009 15:49:29 +0100 Subject: [reportlab-users] Numerous pdfs generation In-Reply-To: <956003ae0901090549ma87adcfl86028b5058960b1e@mail.gmail.com> References: <4967264B.1060506@tinyerp.com> <956003ae0901090341y5205f02ie3474c1402acab78@mail.gmail.com> <7BD2AAAB64E075479A228E83F77F0D7E977E@huntsrvr.HuntFamily.local> <49675483.5080703@tinyerp.com> <956003ae0901090549ma87adcfl86028b5058960b1e@mail.gmail.com> Message-ID: <496763F9.6020902@tinyerp.com> No test have been done yet, I was just requesting if any way to manage this size/speed concern already existed to avoid any bad surprise later. The document generation engine will be ready in about a month. I'll do some test then, and see if it will work fine with just a sufficient amount of RAM. In case it doens't, the "xobjects" and 'linearized pdf' seems to be two interesting tracks. Thank you Fabian PS : The pdf file must be unique for a marketing campaign, it's a constraint from the routing companies that manage the printing and sending of the mailings. Andy Robinson wrote: > 2009/1/9 Fabian : > >> Yes, it's the 6M pages a day. >> > > Have you actually done some experiments and looked at the resulting > file sizes, and/or run out of memory? What limits do you hit? > > I presume that these are stacks of highly similar documents - for > example a big stack of invoices. The trick here is to make very thorough > use of 'form xobjects' for anything which is used frequently. So, for > example, your invoice template and letterhead might need to be drawn > and stored just once in that mega-pdf-file. Then you only need to render > the words which differ on each page in the main story. If you use these > techniques, it's amazing how many pages you can spit out and how > quickly. And it's not worth an R&D effort if a couple of extra GB of RAM > will do the trick. > > The second question I'd ask is if the client really needs each of > these to be delivered as a single file. If they have, say, a 200,000 > page stack of invoices, would they not be equally happy with a directory > of files each containing 1000 pages, or by client IDs, or some > other structure making it easy to find the PDF they want? > > When clients have asked me for huge docs in the past, they have always > seen the wisdom of breaking it up a bit after some initial discussion. > > - Andy > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > From robin at reportlab.com Fri Jan 9 10:29:31 2009 From: robin at reportlab.com (Robin Becker) Date: Fri, 09 Jan 2009 15:29:31 +0000 Subject: [reportlab-users] Numerous pdfs generation In-Reply-To: <496763F9.6020902@tinyerp.com> References: <4967264B.1060506@tinyerp.com> <956003ae0901090341y5205f02ie3474c1402acab78@mail.gmail.com> <7BD2AAAB64E075479A228E83F77F0D7E977E@huntsrvr.HuntFamily.local> <49675483.5080703@tinyerp.com> <956003ae0901090549ma87adcfl86028b5058960b1e@mail.gmail.com> <496763F9.6020902@tinyerp.com> Message-ID: <49676D5B.9050904@chamonix.reportlab.co.uk> conceptually there are two memory bottle necks in platypus + canvas. First is the story itself a long list of flowables. This can be regarded as a simple sequence which could be kept on disk. There are a number of gotchas eg multiBuild where Andy throws caution to the wind and a copy of the entire list is used; that should be fixable as we probably only need to write the list just once so a copy can avoid recreating the list if it's clever. The second major storage item is the canvas._doc.Pages.pages list which stores the streams and data for each page as it is created. Again it should be possible to keep this list on disk. However, I suspect this approach will be quite slow. -- Robin Becker From gabor at tastebook.com Fri Jan 9 12:06:25 2009 From: gabor at tastebook.com (Gabor Torok) Date: Fri, 9 Jan 2009 09:06:25 -0800 Subject: [reportlab-users] layout question In-Reply-To: <49676D5B.9050904@chamonix.reportlab.co.uk> References: <4967264B.1060506@tinyerp.com> <956003ae0901090341y5205f02ie3474c1402acab78@mail.gmail.com> <7BD2AAAB64E075479A228E83F77F0D7E977E@huntsrvr.HuntFamily.local> <49675483.5080703@tinyerp.com> <956003ae0901090549ma87adcfl86028b5058960b1e@mail.gmail.com> <496763F9.6020902@tinyerp.com> <49676D5B.9050904@chamonix.reportlab.co.uk> Message-ID: <7670B648-D868-402D-BFCD-DA49BB38808A@tastebook.com> Hi, I'm trying to determine if the following is possible using platypus: M = an image P = a paragraph which is wrapped around the image L = an indented list (using Indent) which should start at the bottom of the paragraph P The trouble is that the bottom of P could be above or below the bottom of I. If I wrap M and P in an ImageAndFlowables then L will start after M (if M is longer than P). If I include L in the ImageAndFlowables then it gets wrapped around the image which is not what I need. (I need it to be a list starting at the bottom of P.) In other words, because the ImageAndFlowables acts as a single flowable element, I can't start a second paragraph after P, only after both P and M. Please let me know if what I'm trying to describe makes sense... Is what I'm trying to accomplish possible? Thanks for any info, --Gabor From robin at reportlab.com Fri Jan 9 12:41:04 2009 From: robin at reportlab.com (Robin Becker) Date: Fri, 09 Jan 2009 17:41:04 +0000 Subject: [reportlab-users] layout question In-Reply-To: <7670B648-D868-402D-BFCD-DA49BB38808A@tastebook.com> References: <4967264B.1060506@tinyerp.com> <956003ae0901090341y5205f02ie3474c1402acab78@mail.gmail.com> <7BD2AAAB64E075479A228E83F77F0D7E977E@huntsrvr.HuntFamily.local> <49675483.5080703@tinyerp.com> <956003ae0901090549ma87adcfl86028b5058960b1e@mail.gmail.com> <496763F9.6020902@tinyerp.com> <49676D5B.9050904@chamonix.reportlab.co.uk> <7670B648-D868-402D-BFCD-DA49BB38808A@tastebook.com> Message-ID: <49678C30.2000401@chamonix.reportlab.co.uk> Gabor Torok wrote: > Hi, > I'm trying to determine if the following is possible using platypus: > > M = an image > P = a paragraph which is wrapped around the image > L = an indented list (using Indent) which should start at the bottom of > the paragraph P > > The trouble is that the bottom of P could be above or below the bottom > of I. If I wrap M and P in an ImageAndFlowables then L will start after > M (if M is longer than P). If I include L in the ImageAndFlowables then > it gets wrapped around the image which is not what I need. (I need it to > be a list starting at the bottom of P.) > > In other words, because the ImageAndFlowables acts as a single flowable > element, I can't start a second paragraph after P, only after both P and M. > > Please let me know if what I'm trying to describe makes sense... Is what > I'm trying to accomplish possible? > > Thanks for any info, > --Gabor ......... It's not terribly obvious what's intended here Is this what you mean? case 1 I(mage) longer than P IIIIIIII PPPPPPPPPPPPPPP IIIIIIII PPPPPPPPPPPPPPP IIIIIIII LLLLLLLLLLLLLLL LLLLLLLLLLLLLLL LLLLLLLLLLLLLLL or case 2 IIIIIIII PPPPPPPPPPPPPPP IIIIIIII PPPPPPPPPPPPPPP IIIIIIII PPPPPPPPPPPPPPP PPPPPPPPPPPPPPPPPPPPPPPP PPPPPPPPPPPPPPPPPPPPPPPP LLLLLLLLLLLLLLLLLLLLLLLL LLLLLLLLLLLLLLLLLLLLLLLL etc etc. 1pic==1000words :) Currently we don't have a no flowaround option for the image and flowables. -- Robin Becker From gabor at tastebook.com Fri Jan 9 12:50:11 2009 From: gabor at tastebook.com (Gabor Torok) Date: Fri, 9 Jan 2009 09:50:11 -0800 Subject: [reportlab-users] layout question In-Reply-To: <49678C30.2000401@chamonix.reportlab.co.uk> References: <4967264B.1060506@tinyerp.com> <956003ae0901090341y5205f02ie3474c1402acab78@mail.gmail.com> <7BD2AAAB64E075479A228E83F77F0D7E977E@huntsrvr.HuntFamily.local> <49675483.5080703@tinyerp.com> <956003ae0901090549ma87adcfl86028b5058960b1e@mail.gmail.com> <496763F9.6020902@tinyerp.com> <49676D5B.9050904@chamonix.reportlab.co.uk> <7670B648-D868-402D-BFCD-DA49BB38808A@tastebook.com> <49678C30.2000401@chamonix.reportlab.co.uk> Message-ID: <5BF35B2A-D0B6-4252-9701-ABD20F1340F0@tastebook.com> It's case 1. Thanks for the info. --Gabor On Jan 9, 2009, at 9:41 AM, Robin Becker wrote: > Gabor Torok wrote: >> Hi, >> I'm trying to determine if the following is possible using platypus: >> M = an image >> P = a paragraph which is wrapped around the image >> L = an indented list (using Indent) which should start at the >> bottom of the paragraph P >> The trouble is that the bottom of P could be above or below the >> bottom of I. If I wrap M and P in an ImageAndFlowables then L will >> start after M (if M is longer than P). If I include L in the >> ImageAndFlowables then it gets wrapped around the image which is >> not what I need. (I need it to be a list starting at the bottom of >> P.) >> In other words, because the ImageAndFlowables acts as a single >> flowable element, I can't start a second paragraph after P, only >> after both P and M. >> Please let me know if what I'm trying to describe makes sense... >> Is what I'm trying to accomplish possible? >> Thanks for any info, >> --Gabor > ......... > > It's not terribly obvious what's intended here > > Is this what you mean? > > > case 1 I(mage) longer than P > IIIIIIII PPPPPPPPPPPPPPP > IIIIIIII PPPPPPPPPPPPPPP > IIIIIIII LLLLLLLLLLLLLLL > LLLLLLLLLLLLLLL > LLLLLLLLLLLLLLL > > > or case 2 > IIIIIIII PPPPPPPPPPPPPPP > IIIIIIII PPPPPPPPPPPPPPP > IIIIIIII PPPPPPPPPPPPPPP > PPPPPPPPPPPPPPPPPPPPPPPP > PPPPPPPPPPPPPPPPPPPPPPPP > LLLLLLLLLLLLLLLLLLLLLLLL > LLLLLLLLLLLLLLLLLLLLLLLL > > > etc etc. 1pic==1000words :) > > Currently we don't have a no flowaround option for the image and > flowables. > -- > Robin Becker > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From ijstokes at crystal.harvard.edu Mon Jan 12 10:21:47 2009 From: ijstokes at crystal.harvard.edu (Ian Stokes-Rees) Date: Mon, 12 Jan 2009 10:21:47 -0500 Subject: [reportlab-users] Broken download links Message-ID: <496B600B.2090609@crystal.harvard.edu> An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: ijstokes.vcf Type: text/x-vcard Size: 322 bytes Desc: not available Url : From alan.ezust at gmail.com Tue Jan 13 00:47:51 2009 From: alan.ezust at gmail.com (Alan Ezust) Date: Mon, 12 Jan 2009 21:47:51 -0800 Subject: [reportlab-users] Error: python was built with Visual Studio 2003 Message-ID: Hello, I was having difficulty building pyRXP lately. I get this error. running install running build running build_ext error: Python was built with Visual Studio 2003; extensions must be built with a compiler than can generate compati Visual Studio 2003 was not found on this system. If you have Cygwi you can try compiling with MingW32, by passing "-c mingw32" to set I happen to have MS Visual Studio 2005 with the latest PlatformSDK installed. On Windows XP SP2. Tried with Python 2.5 and Python 2.6. Same result. Any clues on what to try now? From gherman at darwin.in-berlin.de Tue Jan 13 03:57:11 2009 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Tue, 13 Jan 2009 09:57:11 +0100 Subject: [reportlab-users] svg rendering and groups In-Reply-To: References: <48E3AC8E.1050605@tromp.org> <78159F19-3C1D-4862-AF84-9C4973295AA7@darwin.in-berlin.de> <956003ae0810020322hfcf878aw4bfe0092f3f06809@mail.gmail.com> <48E87742.4040105@tromp.org> Message-ID: <2C17FB6C-0904-4710-86B3-BC38272DD029@darwin.in-berlin.de> jonas wustrack: > We had a closer look at Dinu's code and noticed that he is using > getCTM which returns the cumulative transformation matrix of the > current group and all its parents, while still outputting the parent > groups into the xml. Therefor transformations got applied twice or > more in nested groups. > Marcel's patch worked in a graphics POV because it serializing nested > groups. The patch below sets the non-cumulative transformation matrix > to each group, therefor preserving all the group information and still > producing the right graphics. > Can Dinu please review this, as he knows more about renderSVG.py than > we do. We can then apply this patch to our repository. Hi Jonas, thanks for evaluating this! Right now I don't have the time and ressources to test this thoroughly. The patch looks ok to me, but I'd advise to write some more tests in test_renderSVG.py to verify this. Regards, Dinu From robin at reportlab.com Wed Jan 14 05:15:41 2009 From: robin at reportlab.com (Robin Becker) Date: Wed, 14 Jan 2009 10:15:41 +0000 Subject: [reportlab-users] Error: python was built with Visual Studio 2003 In-Reply-To: References: Message-ID: <496DBB4D.30209@chamonix.reportlab.co.uk> Alan Ezust wrote: > Hello, I was having difficulty building pyRXP lately. I get this error. > > > running install > running build > running build_ext > error: Python was built with Visual Studio 2003; > extensions must be built with a compiler than can generate compati > Visual Studio 2003 was not found on this system. If you have Cygwi > you can try compiling with MingW32, by passing "-c mingw32" to set > > I happen to have MS Visual Studio 2005 with the latest PlatformSDK > installed. On Windows XP SP2. > Tried with Python 2.5 and Python 2.6. Same result. > > Any clues on what to try now? ......... how are you building or installing pyRXP? I have a process which builds 2.3, 2.4, 2.5 & 2.6 versions of the .pyds every night. I think the 2.3 versions need 2003 VS6, 2.4/2.5 needs 2005 VS7 and I believe 2.6 is using 2007 VS8. -- Robin Becker From lists at cheimes.de Wed Jan 14 14:11:43 2009 From: lists at cheimes.de (Christian Heimes) Date: Wed, 14 Jan 2009 20:11:43 +0100 Subject: [reportlab-users] Error: python was built with Visual Studio 2003 In-Reply-To: <496DBB4D.30209@chamonix.reportlab.co.uk> References: <496DBB4D.30209@chamonix.reportlab.co.uk> Message-ID: Robin Becker schrieb: > I have a process which builds 2.3, 2.4, 2.5 & 2.6 versions of the .pyds > every night. I think the 2.3 versions need 2003 VS6, 2.4/2.5 needs 2005 > VS7 and I believe 2.6 is using 2007 VS8. You got the version numbers and years mixed up. The official Windows builds of Python 2.4 and 2.5 are build with VC 7.1 aka VS 2003. Starting with Python 2.6 and 3.0 VC 9 aka VS 2008 are used. Visual Studio 2005 (VC 8) is not used for any official build. You can use MinGW32 to build Windows binaries for most Python versions though. Christian From robin at reportlab.com Thu Jan 15 05:11:34 2009 From: robin at reportlab.com (Robin Becker) Date: Thu, 15 Jan 2009 10:11:34 +0000 Subject: [reportlab-users] Error: python was built with Visual Studio 2003 In-Reply-To: References: <496DBB4D.30209@chamonix.reportlab.co.uk> Message-ID: <496F0BD6.50705@chamonix.reportlab.co.uk> Christian Heimes wrote: > Robin Becker schrieb: >> I have a process which builds 2.3, 2.4, 2.5 & 2.6 versions of the .pyds >> every night. I think the 2.3 versions need 2003 VS6, 2.4/2.5 needs 2005 >> VS7 and I believe 2.6 is using 2007 VS8. > > You got the version numbers and years mixed up. The official Windows > builds of Python 2.4 and 2.5 are build with VC 7.1 aka VS 2003. Starting > with Python 2.6 and 3.0 VC 9 aka VS 2008 are used. Visual Studio 2005 > (VC 8) is not used for any official build. > > You can use MinGW32 to build Windows binaries for most Python versions > though. > > Christian Well according to dependency walker 2.6 python.exe depends explicitly on msvcr90, 2.5/2.4 depends on msvcr71 and 2.3 depends on msvcrt version 7.0. When I run the setup.py script for the pyds which we build every day 2.6 uses c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe 2.5 uses C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe 2.4 uses C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\cl.exe 2.3 uses C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe I'm not exactly sure what VC98 is, but I think it's vs6. So yes you're right VS8 is nowhere, they skipped a number. Anyhow, that still doesn't explain why you're getting this message. -- Robin Becker From reportlab at justanyone.com Thu Jan 15 08:40:07 2009 From: reportlab at justanyone.com (reportlab at justanyone.com) Date: Thu, 15 Jan 2009 05:40:07 -0800 Subject: [reportlab-users] =?utf-8?q?RLExtras_in_apt-get_package=3F?= Message-ID: Hello: I noticed with some happiness the availability of the Ubuntu package python-reportlab. I also noticed the presence of python-reportlab-accel and python-reportlab-doc. Our installation requires more than this, however. Specifically, we require installation of the programs/packages of pyRXP, renderPM, rlextra, rml2pdf, and rl_accel (which is the same as python-reportlab-accel?). However, during build/installation, we had a problem with a GCC compile failing. It has been an ongoing problem for us getting our ReportLab installations correctly set up (possibly due to our using a 1.x version at the moment, though we want to change), and in the end I just copied the relevant directories from a box wherein it was already installed, which doesn't bode well for upgrading, etc. Life would be better for many here, and probably elsewhere, if we had an Ubuntu / debian file / apt-gettable installation for these components, as well as any others I'm forgetting that are part of ReportLab's suite (and yes, we are a paying customer of ReportLab). Thanks for the good work! -- Kevin _________________________________________________ Kevin J. Rice, Senior Software Engineer, Textura Corp. 1405 Lake Cook Road, Deerfield, IL 60015-5213 _________________________________________________ From andy at reportlab.com Thu Jan 15 09:26:14 2009 From: andy at reportlab.com (Andy Robinson) Date: Thu, 15 Jan 2009 14:26:14 +0000 Subject: [reportlab-users] RLExtras in apt-get package? In-Reply-To: References: Message-ID: <956003ae0901150626r2b8bb0acu86b1ddac6286c1ad@mail.gmail.com> 2009/1/15 : > Our installation requires more than this, however. Specifically, we > require installation of the programs/packages of pyRXP, renderPM, rlextra, > rml2pdf, and rl_accel (which is the same as python-reportlab-accel?). Hi Kevin, Since you are a commercial customer, and RML2PDF is closed-source and so will not be an ubuntu package any time soon, I will reply via direct email in a few minutes. For everyone: we don't actually produce the ubuntu packages, and were surprised last year to find out they existed. We have been learning and talking to the people who make them over the last couple of releases, to try and make it as easy as possible, and we expect our forthcoming 2.3 release (next couple of weeks) to include more dependencies. However, as far as I know the scope of ubuntu-reportlab would be the open source package including _rl_accel. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From lists at cheimes.de Thu Jan 15 11:22:52 2009 From: lists at cheimes.de (Christian Heimes) Date: Thu, 15 Jan 2009 17:22:52 +0100 Subject: [reportlab-users] Error: python was built with Visual Studio 2003 In-Reply-To: <496F0BD6.50705@chamonix.reportlab.co.uk> References: <496DBB4D.30209@chamonix.reportlab.co.uk> <496F0BD6.50705@chamonix.reportlab.co.uk> Message-ID: Robin Becker schrieb: > Well according to dependency walker 2.6 python.exe depends explicitly on > msvcr90, > 2.5/2.4 depends on msvcr71 and 2.3 depends on msvcrt version 7.0. Correct, every version of Visual Studio / Visual C++ has its own C runtime library. > So yes you're right VS8 is nowhere, they skipped a number. Anyhow, that > still doesn't explain why you're getting this message. Python's distutils refuses to compile an extension with a different compiler. Visual Studio 2005 can only link against msvcrt80 but Python 2.4 is linked against msvcrt71. You either have to use the same compiler version or you have to install and use MinGW32. Python refuses to mix C runtime libraries to protect the user against seg faults. The memory and file management functions don't work across multiple CRT versions. For example malloc()ing memory with msvcrt80 and free()ing the segment with msvcrt71 crashes the application. Christian From timr at probo.com Thu Jan 15 12:40:53 2009 From: timr at probo.com (Tim Roberts) Date: Thu, 15 Jan 2009 09:40:53 -0800 Subject: [reportlab-users] Error: python was built with Visual Studio 2003 In-Reply-To: <496F0BD6.50705@chamonix.reportlab.co.uk> References: <496DBB4D.30209@chamonix.reportlab.co.uk> <496F0BD6.50705@chamonix.reportlab.co.uk> Message-ID: <496F7525.7030008@probo.com> Robin Becker wrote: > > When I run the setup.py script for the pyds which we build every day > > 2.6 uses c:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\cl.exe > 2.5 uses C:\Program Files\Microsoft Visual Studio .NET > 2003\Vc7\bin\cl.exe > 2.4 uses C:\Program Files\Microsoft Visual Studio .NET > 2003\Vc7\bin\cl.exe > 2.3 uses C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe > > I'm not exactly sure what VC98 is, but I think it's vs6. Actually, it's kind of the other way around. The umbrella product was Visual Studio 98, which included as a component Visual C++ 98, which incorporated the C++ compiler version 6.0. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From robin at reportlab.com Thu Jan 15 13:15:06 2009 From: robin at reportlab.com (Robin Becker) Date: Thu, 15 Jan 2009 18:15:06 +0000 Subject: [reportlab-users] Error: python was built with Visual Studio 2003 In-Reply-To: References: <496DBB4D.30209@chamonix.reportlab.co.uk> <496F0BD6.50705@chamonix.reportlab.co.uk> Message-ID: <496F7D2A.6080400@chamonix.reportlab.co.uk> Christian Heimes wrote: > Robin Becker schrieb: >............ > Python's distutils refuses to compile an extension with a different > compiler. Visual Studio 2005 can only link against msvcrt80 but Python > 2.4 is linked against msvcrt71. You either have to use the same compiler > version or you have to install and use MinGW32. > > Python refuses to mix C runtime libraries to protect the user against > seg faults. The memory and file management functions don't work across > multiple CRT versions. For example malloc()ing memory with msvcrt80 and > free()ing the segment with msvcrt71 crashes the application. > I know that you have to have the right version, what's not clear is why you're getting this error? When I build pyRXP etc etc with a specific python setup.py figures out which compiler is needed and seems to use the right one. I have all three versions of the compiler installed so can build with python2.3-2.6. Presumably you're trying to use a python that requires 2003 or mingw. Is that the problem? There's nothing special about the pyRXP setup.py so far as I know. Have you tried removing the build dir and re-running? -- Robin Becker From arkadi at smartbit.be Fri Jan 16 09:11:24 2009 From: arkadi at smartbit.be (Arkadi Colson) Date: Fri, 16 Jan 2009 15:11:24 +0100 Subject: [reportlab-users] character spacing in paragraphs Message-ID: <4970958C.20400@smartbit.be> Hi all, with canvas it is possible to use character spacing. Is it also possible to define it within paragraphs? Thanks in advance. Best regards, Arkadi From robin at reportlab.com Fri Jan 16 09:48:51 2009 From: robin at reportlab.com (Robin Becker) Date: Fri, 16 Jan 2009 14:48:51 +0000 Subject: [reportlab-users] character spacing in paragraphs In-Reply-To: <4970958C.20400@smartbit.be> References: <4970958C.20400@smartbit.be> Message-ID: <49709E53.4000600@chamonix.reportlab.co.uk> Arkadi Colson wrote: > with canvas it is possible to use character spacing. Is it also possible > to define it within paragraphs? currently not in the builtin paragraph. -- Robin Becker From bernie at huntfamily.com Fri Jan 16 12:10:25 2009 From: bernie at huntfamily.com (Bernie Hunt) Date: Fri, 16 Jan 2009 12:10:25 -0500 Subject: [reportlab-users] Curving Text Message-ID: <7BD2AAAB64E075479A228E83F77F0D7E97A1@huntsrvr.HuntFamily.local> I'm working on a form that needs a logo watermarked in the background. I'm doing ok with recreating all the pieces except the test. The logo is circular and has text that flows around the edge of the circle. How would you recommend addressing this curved text in Reportlab? Is there a way to import an image file to use as a background? Thanks, Bernie -------------- next part -------------- An HTML attachment was scrubbed... URL: From gherman at darwin.in-berlin.de Fri Jan 16 13:42:12 2009 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 16 Jan 2009 19:42:12 +0100 Subject: [reportlab-users] Curving Text In-Reply-To: <7BD2AAAB64E075479A228E83F77F0D7E97A1@huntsrvr.HuntFamily.local> References: <7BD2AAAB64E075479A228E83F77F0D7E97A1@huntsrvr.HuntFamily.local> Message-ID: Bernie Hunt: > I?m working on a form that needs a logo watermarked in the > background. I?m doing ok with recreating all the pieces except the > test. The logo is circular and has text that flows around the edge > of the circle. > > How would you recommend addressing this curved text in Reportlab? > Hi Bernie, a long time ago I wrote a module for doing exactly that, but only using circles and no other curves and not strictly in a way that would make typographers happy (meaning I placed single characters along a circle. You can see some samples on my old site [1]. I'm willing to release this now, but since there is nothing like a plugin mechanism for external RL components, I'm not sure how to package that, such that it could be easily installed (not necessa- rily easy_installed). In any ase I can send you the pre-release code under GPL, if you really need it. You might also want to try importing a SVG graphic using my svglib [2], but be warned that text placement might not be its strongest feature. > Is there a way to import an image file to use as a background? > Yes, but RL will charge you a few thousend bucks for importing a PDF background. I can do it as well with a seperate module, but haven't finalised the code, and haven't decided on the license, yet. Make your choice... Dinu [1] http://python.net/~gherman/UnreleasedStuff.html [2] http://pypi.python.org/pypi/svglib From srichter at cosmos.phy.tufts.edu Fri Jan 16 14:16:39 2009 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Fri, 16 Jan 2009 11:16:39 -0800 Subject: [reportlab-users] Curving Text In-Reply-To: References: <7BD2AAAB64E075479A228E83F77F0D7E97A1@huntsrvr.HuntFamily.local> Message-ID: <200901161116.39900.srichter@cosmos.phy.tufts.edu> On Friday 16 January 2009, Dinu Gherman wrote: > > Is there a way to import an image file to use as a background? > > Yes, but RL will charge you a few thousend bucks for importing > a PDF background. I can do it as well with a seperate module, but > haven't finalised the code, and haven't decided on the license, yet. z3c.rml allows for merging PDFs via pyPdf. Regards, Stephan -- Stephan Richter Web Software Design, Development and Training Google me. "Zope Stephan Richter" From andy at reportlab.com Fri Jan 16 14:47:19 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 16 Jan 2009 19:47:19 +0000 Subject: [reportlab-users] Curving Text In-Reply-To: References: <7BD2AAAB64E075479A228E83F77F0D7E97A1@huntsrvr.HuntFamily.local> Message-ID: <956003ae0901161147i14bcbcebsa6782b50b7c2a8be@mail.gmail.com> 2009/1/16 Dinu Gherman : > Yes, but RL will charge you a few thousend bucks for importing > a PDF background. Low-volume use is nearer $1500 these days ;-) > I can do it as well with a seperate module, but > haven't finalised the code, and haven't decided on the license, yet. Better hurry before we undercut you ;-) - Andy From IStevens at globeandmail.com Mon Jan 19 15:53:04 2009 From: IStevens at globeandmail.com (Stevens, Ian) Date: Mon, 19 Jan 2009 15:53:04 -0500 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError Message-ID: We've got a weird issue on our production boxes and I'm hoping someone might be able to shed some light. We're using Reportlab with Django to serve PDFs over HTTP. Any fonts which may be required are loaded before a PDF is built from Flowables. However, occasionally Reportlab appears to think a font isn't loaded, will execute a brute search for the required font and then fail when reading in one of Reportlab's stock fonts. The font in question is reportlab/fonts/LeERC___.AFM. This error is intermittent, which is bothersome, and always occurs from the same line, executed within a PageTemplate's onPage() method. Here's a stacktrace of the error: == File "/usr/lib/python2.5/site-packages/Django-0.97_pre-py2.5.egg/django/core/ handlers/base.py", line 82, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/prod/prod-00/django/fundprofile/agf/fund.py", line 137, in pdf template.build(fund) File "/prod/prod-00/django/fundprofile/agf/templates/template.py", line 762, in build return BaseDocTemplate.build(self, fundPortfolio) File "/usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py", line 737, in build self.clean_hanging() File "/usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py", line 396, in clean_hanging self.handle_flowable(self._hanging) File "/usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py", line 633, in handle_flowable f.apply(self) File "/usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py", line 114, in apply getattr(doc,arn)(*args) File "/usr/lib/python2.5/site-packages/reportlab/platypus/doctemplate.py", line 421, in handle_pageBegin self.pageTemplate.onPage(self.canv,self) File "/prod/prod-00/django/app/template.py", line 24, in drawPage1Layout doc.drawPageLayout(canvas, "PAGE_ONE") File "/prod/prod-00/django/app/template.py", line 114, in drawPageLayout layout.drawFooterText(canvas) File "/prod/prod-00/django/app/components/layout.py", line 124, in drawFooterText canvas.setFont("ScalaSansRegular", 8) File "/usr/lib/python2.5/site-packages/reportlab/pdfgen/canvas.py", line 1302, in setFont font = pdfmetrics.getFont(self._fontname) File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 658, in findFontAndRegister face = getTypeFace(fontName) File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 629, in getTypeFace afm = bruteForceSearchForAFM(faceName) File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 227, in bruteForceSearchForAFM (topDict, glyphDict) = parseAFMFile(possible) File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 80, in parseAFMFile lines = open_and_readlines(afmFileName, 'r') File "/usr/lib/python2.5/site-packages/reportlab/lib/utils.py", line 452, in open_and_readlines return open_and_read(name,mode).split('\n') File "/usr/lib/python2.5/site-packages/reportlab/lib/utils.py", line 449, in open_and_read return open_for_read(name,mode).read() File "/usr/lib/python2.5/site-packages/reportlab/lib/utils.py", line 445, in open_for_read raise IOError('Cannot open resource "%s"' % name) IOError: Cannot open resource "/usr/lib/python2.5/site-packages/reportlab/fonts/LeERC___.AFM" == If it helps, all Python libraries are local while the Django app code is on a shared drive. We're using Apache 2.2 with mod_python 3.3.1 on Ubuntu. Any ideas would be extremely helpful. thanks, Ian. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Mon Jan 19 17:37:09 2009 From: andy at reportlab.com (Andy Robinson) Date: Mon, 19 Jan 2009 22:37:09 +0000 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: References: Message-ID: <956003ae0901191437pe94829ctd39af7b19a8bb50c@mail.gmail.com> 2009/1/19 Stevens, Ian : > This error is intermittent, which is bothersome, and always occurs from the > same line, executed within a PageTemplate's onPage() method. Here's a > stacktrace of the error: I have no ideas and no experience of anything similar - and we've been hosting serious 24x7 apps with a very similar architecture to yours for 2 years with no similar exceptions. Some more data would help. - which ReportLab version? - is it some kind of Linux? The OS may affect some paths through the code. - how are you running Django? FastCGI, mod_python? The font cache is once-per-process and does not get explicitly unloaded, so I wonder if the intermittent nature means it is something happening when the web server restarts Python processes. - would you be able to promote live a metered version which adds some logging statements? Alternatively, can you force similar issues in a test environment which you could then debug? We do have some code for resetting the font cache but I need to speak to a colleague in the (UK) morning to see what could trigger it. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From darren at ontrenet.com Tue Jan 20 03:50:13 2009 From: darren at ontrenet.com (Darren Govoni) Date: Tue, 20 Jan 2009 03:50:13 -0500 Subject: [reportlab-users] Embed Watermark? Message-ID: <1232441413.476.5.camel@nuraku> Hi, Can I read in an existing PDF with reportlab and make modifications to it and write it to new PDF file? I want to add watermarks (e.g. large DRAFT wording diagonal on every page). I wasn't sure if reportlab can process existing PDF's. thanks, Darren From gherman at darwin.in-berlin.de Tue Jan 20 04:08:24 2009 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Tue, 20 Jan 2009 10:08:24 +0100 Subject: [reportlab-users] Embed Watermark? In-Reply-To: <1232441413.476.5.camel@nuraku> References: <1232441413.476.5.camel@nuraku> Message-ID: <678AF4F2-B83D-4BF7-B42E-3285C920F10A@darwin.in-berlin.de> Darren Govoni: > Can I read in an existing PDF with reportlab and make modifications to > it and write it to new PDF file? I want to add watermarks (e.g. large > DRAFT wording diagonal on every page). I wasn't sure if reportlab can > process existing PDF's. A dozen people here (me included) would like to point you to a FAQ list, but unfortunately, the can't. So you might want to read the archives of this mailing list, available in the footer of each message posted here. Regards, Dinu From andy at reportlab.com Tue Jan 20 04:30:56 2009 From: andy at reportlab.com (Andy Robinson) Date: Tue, 20 Jan 2009 09:30:56 +0000 Subject: [reportlab-users] Embed Watermark? In-Reply-To: <1232441413.476.5.camel@nuraku> References: <1232441413.476.5.camel@nuraku> Message-ID: <956003ae0901200130x7de141ael947aaba835d679e9@mail.gmail.com> 2009/1/20 Darren Govoni : > Hi, > Can I read in an existing PDF with reportlab and make modifications to > it and write it to new PDF file? I want to add watermarks (e.g. large > DRAFT wording diagonal on every page). I wasn't sure if reportlab can > process existing PDF's. No, you can't. Our open source package only generates PDFs; it doesn't parse and modify them. There is a free command-line utility 'pdftk' which can do it. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From robin at reportlab.com Tue Jan 20 04:55:45 2009 From: robin at reportlab.com (Robin Becker) Date: Tue, 20 Jan 2009 09:55:45 +0000 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: References: Message-ID: <49759FA1.4020800@chamonix.reportlab.co.uk> Stevens, Ian wrote: > We've got a weird issue on our production boxes and I'm hoping someone > might be able to shed some light. We're using Reportlab with Django to > serve PDFs over HTTP. Any fonts which may be required are loaded before > a PDF is built from Flowables. However, occasionally Reportlab appears > to think a font isn't loaded, will execute a brute search for the > required font and then fail when reading in one of Reportlab's stock > fonts. The font in question is reportlab/fonts/LeERC___.AFM. > > This error is intermittent, which is bothersome, and always occurs from > the same line, executed within a PageTemplate's onPage() method. Here's > a stacktrace of the error: > >....... Since Django is a long running process there is one possible situation in which occasional font errors can occur. request A loads font1 and uses it request B just uses font1 If A is guaranteed to always occur first then no problem. There may be cases when in fact that doesn't happen eg in high load situation django (or apache) might just spawn a new thread or process that is not an exact copy of the original. If the new process then just runs B there will be a problem. To avoid this problem applications should really try and reset themselves to some standard condition before running again. We did some work with one of our long standing clients to improve throughput using fcgi (instead of our more usual cgi) and found that we needed to provide a reset mechanism for the toolkit and in addition some mechanism for ensuring that any standard arguments to the app constructor are recreated afresh each time a request gets handled. Resetting of reportlab is done after each request using from reportlab.rl_config import _reset _reset() this attempts to reset all the reportlab specific counters, caches etc etc so that the reportlab library is in a standard state. -- Robin Becker From robin at reportlab.com Tue Jan 20 05:05:18 2009 From: robin at reportlab.com (Robin Becker) Date: Tue, 20 Jan 2009 10:05:18 +0000 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: References: Message-ID: <4975A1DE.3090109@chamonix.reportlab.co.uk> I forgot to point out the most obvious problem which is that the RL toolkit is not threadsafe, so we now try and run using a spawned process model. -- Robin Becker From andy at reportlab.com Tue Jan 20 05:19:10 2009 From: andy at reportlab.com (Andy Robinson) Date: Tue, 20 Jan 2009 10:19:10 +0000 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: <49759FA1.4020800@chamonix.reportlab.co.uk> References: <49759FA1.4020800@chamonix.reportlab.co.uk> Message-ID: <956003ae0901200219g7fb2c8c4tc966461e591de6d@mail.gmail.com> 2009/1/20 Robin Becker : > Resetting of reportlab is done after each request using > > from reportlab.rl_config import _reset > _reset() So should web apps do this on every hit? and is it expensive i.e. does it reload all fonts? - Andy From robin at reportlab.com Tue Jan 20 06:30:36 2009 From: robin at reportlab.com (Robin Becker) Date: Tue, 20 Jan 2009 11:30:36 +0000 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: <956003ae0901200219g7fb2c8c4tc966461e591de6d@mail.gmail.com> References: <49759FA1.4020800@chamonix.reportlab.co.uk> <956003ae0901200219g7fb2c8c4tc966461e591de6d@mail.gmail.com> Message-ID: <4975B5DC.60400@chamonix.reportlab.co.uk> Andy Robinson wrote: > 2009/1/20 Robin Becker : >> Resetting of reportlab is done after each request using >> >> from reportlab.rl_config import _reset >> _reset() > > So should web apps do this on every hit? This depends on the forking/spawning model that's being used. If the process that's spawned is small and uninitialized then each one starts out fresh, but presumably if they get re-used over and over then the problem exists so yes. > and is it expensive i.e. does it reload all fonts? If you regard that as expensive then yes, so either you need to load all fonts at process start or you need to make each request completely self contained. I believe it's safer to have the application in a known state at the start of each request ie you should make no assumptions about resource availability. -- Robin Becker From aaron.barlow at gmail.com Tue Jan 20 10:19:01 2009 From: aaron.barlow at gmail.com (Aaron Barlow) Date: Tue, 20 Jan 2009 08:19:01 -0700 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: <956003ae0901200219g7fb2c8c4tc966461e591de6d@mail.gmail.com> References: <49759FA1.4020800@chamonix.reportlab.co.uk> <956003ae0901200219g7fb2c8c4tc966461e591de6d@mail.gmail.com> Message-ID: <3DBB4E95-14DC-49DA-9FBD-90D44F5A347E@gmail.com> Would this also work when using rml2pdf i.e. the commercial package? -- Aaron Barlow On Jan 20, 2009, at 3:19 AM, Andy Robinson wrote: > 2009/1/20 Robin Becker : >> Resetting of reportlab is done after each request using >> >> from reportlab.rl_config import _reset >> _reset() > > So should web apps do this on every hit? > and is it expensive i.e. does it reload all fonts? > > - Andy > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2427 bytes Desc: not available Url : From andy at reportlab.com Tue Jan 20 10:24:13 2009 From: andy at reportlab.com (Andy Robinson) Date: Tue, 20 Jan 2009 15:24:13 +0000 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: <3DBB4E95-14DC-49DA-9FBD-90D44F5A347E@gmail.com> References: <49759FA1.4020800@chamonix.reportlab.co.uk> <956003ae0901200219g7fb2c8c4tc966461e591de6d@mail.gmail.com> <3DBB4E95-14DC-49DA-9FBD-90D44F5A347E@gmail.com> Message-ID: <956003ae0901200724k28124184vfe6c59fbdfd66cf8@mail.gmail.com> 2009/1/20 Aaron Barlow : > Would this also work when using rml2pdf i.e. the commercial package? If you were experiencing the error, I guess it would. However, each time we process a new RML document we take care to reset the environment. All PDF-related code is wrapped up in calls to rml2pdf.go(...) And we've never seen this error in live while working with RML. - Andy From srichter at cosmos.phy.tufts.edu Tue Jan 20 10:57:28 2009 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Tue, 20 Jan 2009 07:57:28 -0800 Subject: [reportlab-users] Embed Watermark? In-Reply-To: <956003ae0901200130x7de141ael947aaba835d679e9@mail.gmail.com> References: <1232441413.476.5.camel@nuraku> <956003ae0901200130x7de141ael947aaba835d679e9@mail.gmail.com> Message-ID: <200901200757.29039.srichter@cosmos.phy.tufts.edu> On Tuesday 20 January 2009, Andy Robinson wrote: > There is a free command-line utility 'pdftk' which can do it. pyPdf works also. Regards, Stephan -- Stephan Richter Web Software Design, Development and Training Google me. "Zope Stephan Richter" From srichter at cosmos.phy.tufts.edu Tue Jan 20 11:00:25 2009 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Tue, 20 Jan 2009 08:00:25 -0800 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: <49759FA1.4020800@chamonix.reportlab.co.uk> References: <49759FA1.4020800@chamonix.reportlab.co.uk> Message-ID: <200901200800.25990.srichter@cosmos.phy.tufts.edu> On Tuesday 20 January 2009, Robin Becker wrote: > Resetting of reportlab is done after each request using > > from reportlab.rl_config import _reset > _reset() > > this attempts to reset all the reportlab specific counters, caches etc etc > so that the reportlab library is in a standard state. But this will only work, if you run everything in a single thread, since reportlab uses module-global variables, unless you use thread-local variables fr this, which I think you don't. The safest way is always to create a separate sub-process for PDF rendering. You may want to check out z3c.rml, which Roger Ineichen did just that. Regards, Stephan -- Stephan Richter Web Software Design, Development and Training Google me. "Zope Stephan Richter" From IStevens at globeandmail.com Tue Jan 20 12:35:23 2009 From: IStevens at globeandmail.com (Stevens, Ian) Date: Tue, 20 Jan 2009 12:35:23 -0500 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: <956003ae0901191437pe94829ctd39af7b19a8bb50c@mail.gmail.com> References: <956003ae0901191437pe94829ctd39af7b19a8bb50c@mail.gmail.com> Message-ID: I've been reading the follow-ups to this, so I'll add as much information as I can. Unfortunately, I'm not administering the production machine. - We're using Reportlab 2.1, both Debian and Ubuntu distributions, and Django is run under mod_python. - We've seen the problem under both prefork and threaded Apache configs, although it appears to happen more often under prefork on production with unlimited MaxRequestsPerChild. As for adding logging, I can probably get someone to make changes to a development server to exhibit the same errors. Ian. > -----Original Message----- > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of > Andy Robinson > Sent: January 19, 2009 5:37 PM > To: Support list for users of Reportlab software > Subject: Re: [reportlab-users] Intermittent failure to find > font,followed by IOError > > 2009/1/19 Stevens, Ian : > > This error is intermittent, which is bothersome, and always occurs > > from the same line, executed within a PageTemplate's > onPage() method. > > Here's a stacktrace of the error: > > I have no ideas and no experience of anything similar - and > we've been hosting serious 24x7 apps with a very similar > architecture to yours for 2 years with no similar > exceptions. Some more data would help. > - which ReportLab version? > - is it some kind of Linux? The OS may affect some paths > through the code. > - how are you running Django? FastCGI, mod_python? The font > cache is once-per-process and does not get explicitly > unloaded, so I wonder if the intermittent nature means it is > something happening when the web server restarts Python processes. > - would you be able to promote live a metered version which > adds some logging statements? Alternatively, can you force > similar issues in a test environment which you could then debug? > > We do have some code for resetting the font cache but I need > to speak to a colleague in the (UK) morning to see what could > trigger it. > > Best Regards, > > > -- > Andy Robinson > CEO/Chief Architect > ReportLab Europe Ltd. > Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, > UK Tel +44-20-8545-1570 > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > From andy at reportlab.com Tue Jan 20 12:39:54 2009 From: andy at reportlab.com (Andy Robinson) Date: Tue, 20 Jan 2009 17:39:54 +0000 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: References: <956003ae0901191437pe94829ctd39af7b19a8bb50c@mail.gmail.com> Message-ID: <956003ae0901200939g3d13a289ob80296b40e2923cc@mail.gmail.com> 2009/1/20 Stevens, Ian : > As for adding logging, I can probably get someone to make changes to a > development server to exhibit the same errors. If you can get your development server in shape to reproduce the errors, that would be a big step forwards. Are there a handful of easily identified fonts used in your application? And where do they live - in an app-specific directory, or in reportlab/fonts, or somewhere else? Feel free to email me directly; I'll be online again in about 3 hours and working late, and will try to suggest some code to preload fonts or at least to produce some trace statements. This one is very interesting to us, precisely because it's so rare. - Andy From IStevens at globeandmail.com Tue Jan 20 13:10:38 2009 From: IStevens at globeandmail.com (Stevens, Ian) Date: Tue, 20 Jan 2009 13:10:38 -0500 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: <956003ae0901200939g3d13a289ob80296b40e2923cc@mail.gmail.com> References: <956003ae0901191437pe94829ctd39af7b19a8bb50c@mail.gmail.com> <956003ae0901200939g3d13a289ob80296b40e2923cc@mail.gmail.com> Message-ID: Thanks Andy. I'll see if I can wrangle a spare machine on which to replicate those errors. We have code to load fonts in an app dir. These are just over 30 fonts which are loaded. Most are Postscript but there are a few TrueType fonts. Most of the fonts are easily-identified but we also have some which appear to be custom to one of our clients. Ian. > -----Original Message----- > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of > Andy Robinson > Sent: January 20, 2009 12:40 PM > To: Support list for users of Reportlab software > Subject: Re: [reportlab-users] Intermittent failure to find > font,followed by IOError > > 2009/1/20 Stevens, Ian : > > As for adding logging, I can probably get someone to make > changes to a > > development server to exhibit the same errors. > > > If you can get your development server in shape to reproduce > the errors, that would be a big step forwards. > > Are there a handful of easily identified fonts used in your > application? > And where do they live - in an app-specific directory, or in > reportlab/fonts, or somewhere else? > > Feel free to email me directly; I'll be online again in about > 3 hours and working late, and will try to suggest some code > to preload fonts or at least to produce some trace statements. > > This one is very interesting to us, precisely because it's so rare. > > - Andy > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > From robin at reportlab.com Tue Jan 20 13:23:06 2009 From: robin at reportlab.com (Robin Becker) Date: Tue, 20 Jan 2009 18:23:06 +0000 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: References: <956003ae0901191437pe94829ctd39af7b19a8bb50c@mail.gmail.com> <956003ae0901200939g3d13a289ob80296b40e2923cc@mail.gmail.com> Message-ID: <4976168A.2050406@chamonix.reportlab.co.uk> Stevens, Ian wrote: > Thanks Andy. I'll see if I can wrangle a spare machine on which to > replicate those errors. > > We have code to load fonts in an app dir. These are just over 30 fonts > which are loaded. Most are Postscript but there are a few TrueType > fonts. Most of the fonts are easily-identified but we also have some > which appear to be custom to one of our clients. > > Ian. > ....... are you using mod_python for the django interface? As for the _reset code I'm fairly sure that is in 2.1 so that might help. -- Robin Becker From IStevens at globeandmail.com Tue Jan 20 13:31:24 2009 From: IStevens at globeandmail.com (Stevens, Ian) Date: Tue, 20 Jan 2009 13:31:24 -0500 Subject: [reportlab-users] Intermittent failure to find font, followed by IOError In-Reply-To: <4976168A.2050406@chamonix.reportlab.co.uk> References: <956003ae0901191437pe94829ctd39af7b19a8bb50c@mail.gmail.com> <956003ae0901200939g3d13a289ob80296b40e2923cc@mail.gmail.com> <4976168A.2050406@chamonix.reportlab.co.uk> Message-ID: Thanks Robin. Yes, we are using mod_python with Django. And yes, _reset is in 2.1. I'll probably call it from a Django middleware. Ian. > -----Original Message----- > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of > Robin Becker > Sent: January 20, 2009 1:23 PM > To: Support list for users of Reportlab software > Subject: Re: [reportlab-users] Intermittent failure to find > font, followed by IOError > > Stevens, Ian wrote: > > Thanks Andy. I'll see if I can wrangle a spare machine on which to > > replicate those errors. > > > > We have code to load fonts in an app dir. These are just > over 30 fonts > > which are loaded. Most are Postscript but there are a few TrueType > > fonts. Most of the fonts are easily-identified but we also > have some > > which appear to be custom to one of our clients. > > > > Ian. > > > ....... > are you using mod_python for the django interface? As for the > _reset code I'm fairly sure that is in 2.1 so that might help. > -- > Robin Becker > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > From hans at marcans.nl Tue Jan 20 20:26:10 2009 From: hans at marcans.nl (Hans Brand) Date: Wed, 21 Jan 2009 02:26:10 +0100 Subject: [reportlab-users] doctemplate.py: use of isinstance on NullActionFlowable instance Message-ID: <497679B2.2010604@marcans.nl> Hello, this is my first use of this list. Please have a look at the following problem. I received the following error message: > Traceback (most recent call last): > File "/usr/local/www/Zope210/first/Extensions/StudentPDF_double.py", line 310, in StudentPDF_double > content = str(MakeStudent(self, date, termname, term, klas, format, report_type)) > File "/usr/local/www/Zope210/first/Extensions/StudentPDF_double.py", line 223, in __init__ > pdf_student.build(lst, onFirstPage=self.myAllPages, onLaterPages=self.myAllPages) > File "/usr/local/lib/python2.4/site-packages/reportlab/platypus/doctemplate.py", line 911, in build > BaseDocTemplate.build(self,flowables, canvasmaker=canvasmaker) > File "/usr/local/lib/python2.4/site-packages/reportlab/platypus/doctemplate.py", line 740, in build > self.handle_flowable(flowables) > File "/usr/local/lib/python2.4/site-packages/reportlab/platypus/doctemplate.py", line 633, in handle_flowable > f.apply(self) > TypeError: apply() takes exactly 1 argument (2 given) > Looking up the location in doctemplate.py gives the following code: > 628 self.handle_pageBreak(slow=1) > 629 else: > 630 self.handle_pageBreak() > 631 self.afterFlowable(f) > 632 elif isinstance(f,ActionFlowable): > 633 -> f.apply(self) > 634 self.afterFlowable(f) > 635 else: > 636 frame = self.frame > 637 #try to fit it then draw it > 638 if frame.add(f, self.canv, trySplit=self.allowSplitting): Using the pdb debugger I get the following results: > (Pdb) f > > (Pdb) isinstance(f,ActionFlowable) > True > (Pdb) isinstance(f,NullActionFlowable) > True > (Pdb) This reveals that f is a NullActionFlowable but that it is (also) recognised as being an ActionFlowable instance. So when f is a NullActionFlowable then the code at line > 632 elif isinstance(f,ActionFlowable): will be true. However, the NullActionFlowable.apply function: > class NullActionFlowable(ActionFlowable): > def apply(self): > pass differs from the ActionFlowable.apply function: > class ActionFlowable(Flowable): > '''This Flowable is never drawn, it can be used for data driven > controls > For example to change a page template (from one column to two, > for example) > use NextPageTemplate which creates an ActionFlowable. > ''' > def __init__(self,action=()): > #must call super init to ensure it has a width and height (of > zero), > #as in some cases the packer might get called on it... > Flowable.__init__(self) > if type(action) not in (ListType, TupleType): > action = (action,) > self.action = tuple(action) > > def apply(self,doc): The python documentation states: > *isinstance*( object, classinfo) > > Return true if the object argument is an instance of the classinfo > argument, or of a (direct or indirect) subclass thereof. My question is now whether the code > 632 elif isinstance(f,ActionFlowable): was not meant to include the NullActionFlowable OR that the apply function of the NullActionFlowable needs to include the doc parameter. Thanks in advance for your replies, Hans Brand From hans at marcans.nl Tue Jan 20 21:50:44 2009 From: hans at marcans.nl (Hans Brand) Date: Wed, 21 Jan 2009 03:50:44 +0100 Subject: [reportlab-users] doctemplate.py: use of isinstance on NullActionFlowable instance In-Reply-To: <497679B2.2010604@marcans.nl> References: <497679B2.2010604@marcans.nl> Message-ID: <49768D84.4000200@marcans.nl> Hans Brand wrote: > >> class NullActionFlowable(ActionFlowable): >> def apply(self): >> pass > > My question is now whether the code > >> 632 elif isinstance(f,ActionFlowable): > > was not meant to include the NullActionFlowable > OR > that the apply function of the NullActionFlowable > needs to include the doc parameter. > > Thanks in advance for your replies, > Hans Brand > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > Hi, me again, After changing the definition of apply to include the doc parameter the error did not occur any more and the resulting pdf file seems to look correct. doctemplate.py: class NullActionFlowable(ActionFlowable): def apply(self, doc): <<<=== add doc parameter pass Regards, Hans From volker.haas at brainbot.com Wed Jan 21 10:27:59 2009 From: volker.haas at brainbot.com (Volker Haas) Date: Wed, 21 Jan 2009 16:27:59 +0100 Subject: [reportlab-users] bug with justified text? Message-ID: <49773EFF.4020808@brainbot.com> Hi. I might have found a bug related to justified text. The "bug" only appears in a custom flowable I implemented, therefore I might be doing something wrong. For that reason I can't easily supply a minimal example just the diff of my "patch": 1 --- a/src/reportlab/platypus/paragraph.py Wed Jan 21 15:51:15 2009 +0100 2 +++ b/src/reportlab/platypus/paragraph.py Wed Jan 21 15:55:11 2009 +0100 3 @@ -322,7 +322,7 @@ 4 setXPos(tx,offset) 5 extraSpace = line.extraSpace 6 nSpaces = line.wordCount - 1 7 - if last or not nSpaces or abs(extraSpace)<=1e-8 or line.lineBreak: 8 + if last or not nSpaces or abs(extraSpace)<=1e-8 or getattr(line, 'lineBreak', None): 9 _putFragLine(offset, tx, line) #no space modification 10 else: 11 tx.setWordSpace(extraSpace / float(nSpaces)) The last lines of the traceback without the patch are: if last or not nSpaces or abs(extraSpace)<=1e-8 or line.lineBreak: AttributeError: ParaLines instance has no attribute 'lineBreak' That appens when calling the reportlab paragraph.draw method. I hope this makes sense to anyone ;) Regards, Volker -- volker haas brainbot technologies ag fon +49 6131 2116394 boppstra?e 64 fax +49 6131 2116392 55118 mainz volker.haas at brainbot.com http://www.brainbot.com/ From ralsina at netmanagers.com.ar Thu Jan 22 19:19:58 2009 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Thu, 22 Jan 2009 22:19:58 -0200 Subject: [reportlab-users] Indenting a table with platypus Message-ID: <200901222220.06527.ralsina@netmanagers.com.ar> Just what the subject says. Suppose I am doing a bulleted list, and one of the items contains a table. Here's how I would wat it to look (use monospaced font ;-): * This is a table-less item * This one has a table +---------------+ | xxxxxxxxxxxxx | +---------------+ But right now, the table uses 100% of the page width, which looks kinda ugly. Any pointers? I handle this all right for paragraphs, using leftIndent, of course. Is there something similar for tables? -- ("\''/").__..-''"`-. . Roberto Alsina `9_ 9 ) `-. ( ).`-._.`) KDE Developer (MFCH) (_Y_.)' ._ ) `._`. " -.-' http://lateral.netmanagers.com.ar _..`-'_..-_/ /-'_.' The 6,855th most popular site of Slovenia (l)-'' ((i).' ((!.' according to alexa.com (27/5/2007) Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. --Brian W. Kernighan From robin at reportlab.com Fri Jan 23 05:16:34 2009 From: robin at reportlab.com (Robin Becker) Date: Fri, 23 Jan 2009 10:16:34 +0000 Subject: [reportlab-users] Indenting a table with platypus In-Reply-To: <200901222220.06527.ralsina@netmanagers.com.ar> References: <200901222220.06527.ralsina@netmanagers.com.ar> Message-ID: <49799902.5090406@chamonix.reportlab.co.uk> Roberto Alsina wrote: > Just what the subject says. > > Suppose I am doing a bulleted list, and one of the items contains a table. > > Here's how I would wat it to look (use monospaced font ;-): > > * This is a table-less item > > * This one has a table > > +---------------+ > | xxxxxxxxxxxxx | > +---------------+ > > But right now, the table uses 100% of the page width, which looks kinda ugly. > Any pointers? > > I handle this all right for paragraphs, using leftIndent, of course. Is there > something similar for tables? > You can use an Indenter flowable before and after the table eg from reportlab.platypus.doctemplate import Indenter ..... story.append(Indenter(left=12)) story.append(myTable) story.append(Indenter(left=-12)) That may help achieve what you want. -- Robin Becker From ralsina at netmanagers.com.ar Fri Jan 23 05:31:01 2009 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 23 Jan 2009 08:31:01 -0200 Subject: [reportlab-users] Indenting a table with platypus In-Reply-To: <49799902.5090406@chamonix.reportlab.co.uk> References: <200901222220.06527.ralsina@netmanagers.com.ar> <49799902.5090406@chamonix.reportlab.co.uk> Message-ID: <200901230831.02142.ralsina@netmanagers.com.ar> On Friday 23 January 2009 08:16:34 Robin Becker wrote: > You can use an Indenter flowable before and after the table eg > > from reportlab.platypus.doctemplate import Indenter > > ..... > > story.append(Indenter(left=12)) > story.append(myTable) > story.append(Indenter(left=-12)) > > That may help achieve what you want. I had forgotten all about Indenter! Thanks. -- ("\''/").__..-''"`-. . Roberto Alsina `9_ 9 ) `-. ( ).`-._.`) KDE Developer (MFCH) (_Y_.)' ._ ) `._`. " -.-' http://lateral.netmanagers.com.ar _..`-'_..-_/ /-'_.' The 6,855th most popular site of Slovenia (l)-'' ((i).' ((!.' according to alexa.com (27/5/2007) Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. --Brian W. Kernighan From andy at reportlab.com Fri Jan 23 12:10:56 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 23 Jan 2009 17:10:56 +0000 Subject: [reportlab-users] Embed Watermark? In-Reply-To: <678AF4F2-B83D-4BF7-B42E-3285C920F10A@darwin.in-berlin.de> References: <1232441413.476.5.camel@nuraku> <678AF4F2-B83D-4BF7-B42E-3285C920F10A@darwin.in-berlin.de> Message-ID: <956003ae0901230910o5235a1bcrb85b370a042a138d@mail.gmail.com> 2009/1/20 Dinu Gherman : > Darren Govoni: > >> Can I read in an existing PDF with reportlab and make modifications to >> it and write it to new PDF file? > A dozen people here (me included) would like to point you > to a FAQ list, but unfortunately, the can't. I was reviewing the site just now when I was pleasantly surprised to find the following entry in the FAQ. I was even more happy to discover that it has said this for over 5 years ;-) http://www.reportlab.org/devfaq.html#2.1.5 - Andy From gherman at darwin.in-berlin.de Fri Jan 23 12:21:10 2009 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 23 Jan 2009 18:21:10 +0100 Subject: [reportlab-users] Embed Watermark? In-Reply-To: <956003ae0901230910o5235a1bcrb85b370a042a138d@mail.gmail.com> References: <1232441413.476.5.camel@nuraku> <678AF4F2-B83D-4BF7-B42E-3285C920F10A@darwin.in-berlin.de> <956003ae0901230910o5235a1bcrb85b370a042a138d@mail.gmail.com> Message-ID: <281A13C6-C2F0-4A70-BF09-508B9A76630E@darwin.in-berlin.de> Andy Robinson: > I was reviewing the site just now when I was pleasantly surprised to > find the following entry in the FAQ. I was even more happy to discover > that it has said this for over 5 years ;-) > > http://www.reportlab.org/devfaq.html#2.1.5 Great, then maybe people need to be pointed to it more often? Dinu -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Fri Jan 23 12:34:28 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 23 Jan 2009 17:34:28 +0000 Subject: [reportlab-users] Embed Watermark? In-Reply-To: <281A13C6-C2F0-4A70-BF09-508B9A76630E@darwin.in-berlin.de> References: <1232441413.476.5.camel@nuraku> <678AF4F2-B83D-4BF7-B42E-3285C920F10A@darwin.in-berlin.de> <956003ae0901230910o5235a1bcrb85b370a042a138d@mail.gmail.com> <281A13C6-C2F0-4A70-BF09-508B9A76630E@darwin.in-berlin.de> Message-ID: <956003ae0901230934r759ec18cy75e9992db50dfd01@mail.gmail.com> 2009/1/23 Dinu Gherman : > Great, then maybe people need to be pointed to it more often? Yes, ReportLab's staff had pretty much forgotten it was there too. We have to train ourselves to use it and point to it. - Andy From codesquid at gmail.com Wed Jan 28 16:45:05 2009 From: codesquid at gmail.com (Bob Luck) Date: Wed, 28 Jan 2009 16:45:05 -0500 Subject: [reportlab-users] ReportLab-2.2.win32-py2.5 and VS 2008 Compatibility Message-ID: <61ce23160901281345s6bb9a175wc4b1de38884eca90@mail.gmail.com> I have just downloaded the ReportLab-2.2.win32 open source PDF library and am not sure what its capabilities / limitations are. I need a PDF library that can seamlessly open single or multipage PDF source documents and then convert them to high resolution images from within my C# VS2008 WinForm application. In addition to opening and converting the PDF document to images on a page by page basis, I would like to be able split or concatenate the existing PDF documents in a batch mode? Can this be done with the ReportLab-2.2.win32 version library? Comments and suggestions appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From uwe at oss4u.com Wed Jan 28 16:56:11 2009 From: uwe at oss4u.com (Uwe C. Schroeder) Date: Wed, 28 Jan 2009 13:56:11 -0800 Subject: [reportlab-users] ReportLab-2.2.win32-py2.5 and VS 2008 Compatibility In-Reply-To: <61ce23160901281345s6bb9a175wc4b1de38884eca90@mail.gmail.com> References: <61ce23160901281345s6bb9a175wc4b1de38884eca90@mail.gmail.com> Message-ID: <200901281356.11865.uwe@oss4u.com> No. Reportlab is a PDF formatting library. You can create PDF files with it, but it can't open PDF's unless you buy the commercial addition from the makers of reportlab. You may want to look into pyPDF (don't know if it can make images out of a PDF, but it can open and modify PDF's) HTH Uwe On Wednesday 28 January 2009, Bob Luck wrote: > I have just downloaded the ReportLab-2.2.win32 open source PDF library and > am not sure what its capabilities / limitations are. > > > > I need a PDF library that can seamlessly open single or multipage PDF > source documents and then convert them to high resolution images from > within my C# VS2008 WinForm application. > > > > In addition to opening and converting the PDF document to images on a page > by page basis, I would like to be able split or concatenate the existing > PDF documents in a batch mode? > > > > Can this be done with the ReportLab-2.2.win32 version library? > > > > Comments and suggestions appreciated. From uwe at oss4u.com Wed Jan 28 18:30:56 2009 From: uwe at oss4u.com (Uwe C. Schroeder) Date: Wed, 28 Jan 2009 15:30:56 -0800 Subject: [reportlab-users] ReportLab-2.2.win32-py2.5 and VS 2008 Compatibility In-Reply-To: References: <61ce23160901281345s6bb9a175wc4b1de38884eca90@mail.gmail.com> <200901281356.11865.uwe@oss4u.com> Message-ID: <200901281530.56382.uwe@oss4u.com> On Wednesday 28 January 2009, Tony Meyer wrote: > > You may want to look into pyPDF (don't know if it can make images out of > > a PDF, but it can open and modify PDF's) > > It can't turn a PDF into an image, no. What's more, it's Python, so > unless Bob is planning on embedding Python in his C# project, it would > be much more worthwhile to investigate C# libraries that suit this > task. Well, last time I checked Reportlab was python too :-) From andy at reportlab.com Thu Jan 29 03:57:27 2009 From: andy at reportlab.com (Andy Robinson) Date: Thu, 29 Jan 2009 08:57:27 +0000 Subject: [reportlab-users] ReportLab-2.2.win32-py2.5 and VS 2008 Compatibility In-Reply-To: <61ce23160901281345s6bb9a175wc4b1de38884eca90@mail.gmail.com> References: <61ce23160901281345s6bb9a175wc4b1de38884eca90@mail.gmail.com> Message-ID: <956003ae0901290057n591870ccx13d2b1ea5d790e5f@mail.gmail.com> 2009/1/28 Bob Luck : > I have just downloaded the ReportLab-2.2.win32 open source PDF library and > am not sure what its capabilities / limitations are. > I need a PDF library that can seamlessly open single or multipage PDF source > documents and then convert them to high resolution images from within my C# > VS2008 WinForm application. Sorry, it deals with PDF generation, not parsing and rendering. We have a commercial library handling page splitting and combining, but that does not do rendering. The best renderers I know of are Ghostscript (which is not easily packaged on Windows), and Xpdf. The latter has commercial wrappers available (DLL, OCX etc) which are easy to deploy, and I previously found it worked well in its OCX incarnation, but I don't know enough about .NET. http://www.glyphandcog.com/ Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From andy at reportlab.com Thu Jan 29 04:06:42 2009 From: andy at reportlab.com (Andy Robinson) Date: Thu, 29 Jan 2009 09:06:42 +0000 Subject: [reportlab-users] Release 2.3 approaching... Message-ID: <956003ae0901290106k2c5b55c5v33c6f3fee2c4996d@mail.gmail.com> Hi everyone, We hope to release version 2.3 in the next few days. We are done with the code and are now focusing on a few remaining details about installers, packaging and download pages. And yes, the final release will go into PyPI. http://www.reportlab.org/whatsnew_2_3.html The daily build (current.zip/tgz) may be considered ''beta" for anyone wanting to take a look. We have fixed a lot of broken and obsolete documentation and dealt with all the recent patches and bug reports. By popular demand, we also have nice tables of contents in our user guides, and code you can re-use to do the same. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From simon.king at motorola.com Thu Jan 29 05:13:03 2009 From: simon.king at motorola.com (King Simon-NFHD78) Date: Thu, 29 Jan 2009 10:13:03 -0000 Subject: [reportlab-users] Release 2.3 approaching... In-Reply-To: <956003ae0901290106k2c5b55c5v33c6f3fee2c4996d@mail.gmail.com> Message-ID: <8D20BBB55F590E42AADF592A815E861703DC9831@zuk35exm65.ds.mot.com> > -----Original Message----- > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of > Andy Robinson > Sent: 29 January 2009 09:07 > To: Support list for users of Reportlab software > Subject: [reportlab-users] Release 2.3 approaching... > > Hi everyone, > > We hope to release version 2.3 in the next few days. We are done with > the code and are now focusing on a few remaining details about > installers, packaging and download pages. And yes, the final release > will go into PyPI. > > http://www.reportlab.org/whatsnew_2_3.html > > The daily build (current.zip/tgz) may be considered ''beta" for anyone > wanting to take a look. > > We have fixed a lot of broken and obsolete documentation and dealt > with all the recent patches and bug reports. By popular demand, we > also have nice tables of contents in our user guides, and code you can > re-use to do the same. > > Hi, I was wondering whether you had any more thoughts about including transparency support in ReportLab? When I asked last time (http://two.pairlist.net/pipermail/reportlab-users/2008-November/007709. html), Robin suggested that he wanted to introduce PDF-1.4 features in a controlled way. I updated my patch in a way that hopefully allowed for that, but didn't hear any more about it. In any case, I've updated the patch to apply cleanly to revision 3408 if anyone is interested. (The motivation for this was to create a matplotlib backend that produced reportlab Drawing objects, thus allowing Matplotlib plots to be embedded within Reportlab Thanks, Simon -------------- next part -------------- A non-text attachment was scrubbed... Name: reportlab_opacity_patch.patch Type: application/octet-stream Size: 11985 bytes Desc: reportlab_opacity_patch.patch Url : From hans at marcans.nl Thu Jan 29 05:29:39 2009 From: hans at marcans.nl (Hans Brand) Date: Thu, 29 Jan 2009 11:29:39 +0100 (CET) Subject: [reportlab-users] Release 2.3 approaching... In-Reply-To: <956003ae0901290106k2c5b55c5v33c6f3fee2c4996d@mail.gmail.com> References: <956003ae0901290106k2c5b55c5v33c6f3fee2c4996d@mail.gmail.com> Message-ID: <59828.213.10.61.26.1233224979.squirrel@marcans.nl> > We have fixed a lot of broken and obsolete documentation and dealt > with all the recent patches and bug reports. > > Hi Andy, Recently I mentioned a problem in doctemplate.py (http://two.pairlist.net/pipermail/reportlab-users/2009-January/007946.html) and also posted a possible solution. I never got any response but the change I suggested in doctemplate.py is functioning in my system perfectly fine. Is it possible for you to include this bugfix in Release 2.3? Gr, Hans From wstearns at gmail.com Thu Jan 29 07:53:55 2009 From: wstearns at gmail.com (William Stearns) Date: Thu, 29 Jan 2009 07:53:55 -0500 Subject: [reportlab-users] ReportLab-2.2.win32-py2.5 and VS 2008 Compatibility In-Reply-To: <956003ae0901290057n591870ccx13d2b1ea5d790e5f@mail.gmail.com> References: <61ce23160901281345s6bb9a175wc4b1de38884eca90@mail.gmail.com> <956003ae0901290057n591870ccx13d2b1ea5d790e5f@mail.gmail.com> Message-ID: Syncfusion has a nice library that I work with for .Net as well I've used PDFTron with a lot of success. Google is your friend for links. Bill On Thu, Jan 29, 2009 at 3:57 AM, Andy Robinson wrote: > 2009/1/28 Bob Luck : > > I have just downloaded the ReportLab-2.2.win32 open source PDF library > and > > am not sure what its capabilities / limitations are. > > I need a PDF library that can seamlessly open single or multipage PDF > source > > documents and then convert them to high resolution images from within my > C# > > VS2008 WinForm application. > > Sorry, it deals with PDF generation, not parsing and rendering. We > have a commercial library handling page splitting and combining, but > that does not do rendering. > > The best renderers I know of are Ghostscript (which is not easily > packaged on Windows), and Xpdf. The latter has commercial wrappers > available (DLL, OCX etc) which are easy to deploy, and I previously > found it worked well in its OCX incarnation, but I don't know enough > about .NET. http://www.glyphandcog.com/ > > Best Regards, > > > > -- > Andy Robinson > CEO/Chief Architect > ReportLab Europe Ltd. > Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK > Tel +44-20-8545-1570 > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From peter at maubp.freeserve.co.uk Thu Jan 29 08:19:41 2009 From: peter at maubp.freeserve.co.uk (Peter) Date: Thu, 29 Jan 2009 13:19:41 +0000 Subject: [reportlab-users] Reportlab and SVG output Message-ID: <320fb6e00901290519t18f7c732q3aea6e3249f49803@mail.gmail.com> Hi, I'm having a little trouble with the SVG output from reportlab - is it expected to produce conforming SVG stand-alone files? I've tried both ReportLab 2.1 on Mac OS X, and ReportLab 2.2 on Linux with the same results. I've included a minimal example script at the end of the email which uses the basic shape objects for strings, rectangles, ellipses, circles and polygons to construct a simple drawing which is then passed to the various render back ends. The resulting PDF, PS and PNG files are fine. However, the SVG file only works on a handful of tools: Mac OS 10.5 preview, Safari 3.2.1 and Firefox 3.0.5 all fail to show the SVG image, instead displaying roughly "... ... Hello world!" (no graphics, just text - the dots appear to come from the default title and description in the SVG file). On the bright side, Opera 9.20 and Adobe Illustrator CS3 will show it fine (although Illustrator does give a warning message "Clipping will be lost on roundtrip to Tiny"). Is this expected behaviour? I was hoping to use reportlab's SVG output within a web application, but that fact that neither of the top two browsers on the Mac (Safari and Firefox) work is a big drawback (I haven't tried Internet Explorer yet, but could live with just Firefox support as that is cross platform). I've found that by manually replacing the reportlab generated and tags with and tags copied from the example on http://www.mozilla.org/projects/svg/ the reportlab SVG output can be made to work on all the software I have tested. A similar solution was suggested back in 2006, just adding some missing values to the tag, and this also seems to work fine: http://two.pairlist.net/pipermail/reportlab-users/2006-June/005055.html Looking at SVN, this fix was never committed - was there a good reason for this? https://svn.reportlab.com/svn/public/reportlab/trunk/src/reportlab/graphics/renderSVG.py Thanks Peter ----- from reportlab.graphics import renderPS, renderPDF, renderSVG, renderPM from reportlab.lib.units import cm from reportlab.graphics import shapes from reportlab.lib import colors width = 10*cm height = 2*cm #Create very simple drawing object, drawing = shapes.Drawing(width, height) drawing.add(shapes.String(1*cm, 1*cm, "Hello World!", fillColor = colors.darkgreen)) drawing.add(shapes.Rect(4.5*cm, 0.5*cm, 5*cm, 1*cm, strokeColor = colors.blue, fillColor = colors.red)) drawing.add(shapes.Ellipse(7*cm, 1*cm, 2*cm, 0.95*cm, strokeColor = colors.black, fillColor = colors.yellow)) drawing.add(shapes.Circle(7*cm, 1*cm, 0.9*cm, strokeColor = colors.black, fillColor = colors.brown)) drawing.add(shapes.Ellipse(7*cm, 1*cm, 0.5*cm, 0.9*cm, strokeColor = colors.black, fillColor = colors.black)) drawing.add(shapes.Polygon([4.5*cm, 1.25*cm, 5*cm, 0.1*cm, 4*cm, 0.1*cm], strokeColor = colors.darkgreen, fillColor = colors.green)) renderPDF.drawToFile(drawing, "hello.pdf") renderPS.drawToFile(drawing, "hello.ps") renderSVG.drawToFile(drawing, "hello.svg") renderPM.drawToFile(drawing, "hello.png", "PNG") print "Done" From andy at reportlab.com Thu Jan 29 09:11:51 2009 From: andy at reportlab.com (Andy Robinson) Date: Thu, 29 Jan 2009 14:11:51 +0000 Subject: [reportlab-users] Reportlab and SVG output In-Reply-To: <320fb6e00901290519t18f7c732q3aea6e3249f49803@mail.gmail.com> References: <320fb6e00901290519t18f7c732q3aea6e3249f49803@mail.gmail.com> Message-ID: <956003ae0901290611g19ca08c0xb3fa6bb2654f9cfc@mail.gmail.com> 2009/1/29 Peter : ...snip... > A similar solution was suggested back in 2006, just adding some missing > values to the tag, and this also seems to work fine: > http://two.pairlist.net/pipermail/reportlab-users/2006-June/005055.html > > Looking at SVN, this fix was never committed - was there a good reason for this? (a) we were busy, understaffed and not tracking issues properly back then :-( (b) we were kind of hoping the original author would deal with SVG issues. However, we did put in one earlier patch on renderSVG recently and are starting to pay more attention. These sound like sensible changes so we'll give them a quick test and include one or the other shortly. This has been logged in the tracker as issue 1020: https://admin.reportlab.com/mantis/project/core/tracker/ I think it makes sense if we hold off on the 2.3 release for a few more days and try to include this. -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From peter at maubp.freeserve.co.uk Thu Jan 29 10:15:43 2009 From: peter at maubp.freeserve.co.uk (Peter) Date: Thu, 29 Jan 2009 15:15:43 +0000 Subject: [reportlab-users] Reportlab and SVG output In-Reply-To: <956003ae0901290611g19ca08c0xb3fa6bb2654f9cfc@mail.gmail.com> References: <320fb6e00901290519t18f7c732q3aea6e3249f49803@mail.gmail.com> <956003ae0901290611g19ca08c0xb3fa6bb2654f9cfc@mail.gmail.com> Message-ID: <320fb6e00901290715n20f9adb3yd187e2df7a04c0ea@mail.gmail.com> On Thu, Jan 29, 2009 at 2:11 PM, Andy Robinson wrote: > > 2009/1/29 Peter : > ...snip... >> A similar solution was suggested back in 2006, just adding some missing >> values to the tag, and this also seems to work fine: >> http://two.pairlist.net/pipermail/reportlab-users/2006-June/005055.html >> >> Looking at SVN, this fix was never committed - was there a good reason for this? > > (a) we were busy, understaffed and not tracking issues properly back then :-( > (b) we were kind of hoping the original author would deal with SVG issues. > > However, we did put in one earlier patch on renderSVG recently and are starting > to pay more attention. These sound like sensible changes so we'll give them a > quick test and include one or the other shortly. > > This has been logged in the tracker as issue 1020: > https://admin.reportlab.com/mantis/project/core/tracker/ Great. > I think it makes sense if we hold off on the 2.3 release for a few more days and > try to include this. I was hoping you would say that :) Peter From peter at maubp.freeserve.co.uk Thu Jan 29 10:22:48 2009 From: peter at maubp.freeserve.co.uk (Peter) Date: Thu, 29 Jan 2009 15:22:48 +0000 Subject: [reportlab-users] "Missing" user guide on website Message-ID: <320fb6e00901290722m5c9c5623j521860ad0b0e6f63@mail.gmail.com> Hi, I was just looking for the latest documentation, and found a number of broken links on this page: http://www.reportlab.org/os_documentation.html e.g. the following don't work: http://www.reportlab.com/docs/userguide.pdf http://www.reportlab.com/docs/graphguide.pdf http://www.reportlab.com/docs/graphics_reference.pdf http://www.reportlab.com/docs/reference.pdf Thankfully the doc folder is viewable, so I think the files are there but under new names, e.g. http://www.reportlab.com/docs/reportlab-userguide.pdf Peter From simon.king at motorola.com Thu Jan 29 10:26:14 2009 From: simon.king at motorola.com (King Simon-NFHD78) Date: Thu, 29 Jan 2009 15:26:14 -0000 Subject: [reportlab-users] Reportlab and SVG output In-Reply-To: <956003ae0901290611g19ca08c0xb3fa6bb2654f9cfc@mail.gmail.com> Message-ID: <8D20BBB55F590E42AADF592A815E861703DC9988@zuk35exm65.ds.mot.com> > -----Original Message----- > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of > Andy Robinson > Sent: 29 January 2009 14:12 > To: peter at maubp.freeserve.co.uk; Support list for users of > Reportlab software > Subject: Re: [reportlab-users] Reportlab and SVG output > > 2009/1/29 Peter : > ...snip... > > A similar solution was suggested back in 2006, just adding > some missing > > values to the tag, and this also seems to work fine: > > > http://two.pairlist.net/pipermail/reportlab-users/2006-June/00 > 5055.html > > > > Looking at SVN, this fix was never committed - was there a > good reason for this? > > [snip] Interestingly, the message after that one (SVG Part II) describes a 'bug' in renderSVG - the parameters to SVGCanvas.drawString are in a different order to those in the the PDF Canvas class. What's more, SVGCanvas.drawCentredString calls SVGCanvas.drawString, but passes the arguments in the wrong order! I guess no-one's using SVGCanvas.drawCentredString or drawRightString. :-) Simon From peter at maubp.freeserve.co.uk Thu Jan 29 10:37:36 2009 From: peter at maubp.freeserve.co.uk (Peter) Date: Thu, 29 Jan 2009 15:37:36 +0000 Subject: [reportlab-users] External hyperlinks in SVG output Message-ID: <320fb6e00901290737k1269fb4en92975edbcf87f88a@mail.gmail.com> Hi, As part of a dynamic website, I have to create complex clickable images. I currently use PNG images generated with ReportLab, and associated image maps in the parent HTML. Others have done similar things in the past of course, for example back in 2003 Dirk Datzert wrote his own reportlab/graphics/renderIM.py back end just for this: http://two.pairlist.net/pipermail/reportlab-users/2003-July/001805.html As an alternative, I'd like to try using SVG images which embed the links directly. For example, instead of having in the SVG output I want have things like: I imagine there are parallels here with PDF output, which can in theory also include externals URLs. Is any of this currently possible in ReportLab? I've been looking over the documentation and the source code, but have concluded that it is not yet supported. Thanks Peter From paul.barrass at safeonlinebilling.com Thu Jan 29 11:10:55 2009 From: paul.barrass at safeonlinebilling.com (Paul Barrass) Date: Thu, 29 Jan 2009 16:10:55 +0000 Subject: [reportlab-users] Suggested patch for "missing" SVG colours Message-ID: <4981D50F.7040400@safeonlinebilling.com> Hi, The discussion of SVG output reminded me to mention the (somewhat unrelated) "missing" SVG colour constants in the libs/colors.py file (I'll not mention the missing 'u' in the filename ;) ). The named colours match the SVG keywords with the exception of the duplicated UK/American spellings of the various greys - grey/gray are both present, but the other varieties such as lightgrey only exist in a single form, and unfortunately it's not entirely consistent which form is used. I've attached a patch against the latest SVN trunk which adds the "missing" greys - it's simply the following lines in the appropriate (maintaining alphabetical order) places: darkgrey = HexColor(0xA9A9A9) darkslategrey = HexColor(0x2F4F4F) dimgrey = HexColor(0x696969) lightgray = HexColor(0xD3D3D3) lightslategrey = HexColor(0x778899) slategrey = HexColor(0x708090) It's not massively critical, but would help confusion when I tell people they can use the "standard SVG" colours, then some of them not be recognised. Paul Barrass. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: SVG-greys.patch Url: From andy at reportlab.com Thu Jan 29 11:15:26 2009 From: andy at reportlab.com (Andy Robinson) Date: Thu, 29 Jan 2009 16:15:26 +0000 Subject: [reportlab-users] "Missing" user guide on website In-Reply-To: <320fb6e00901290722m5c9c5623j521860ad0b0e6f63@mail.gmail.com> References: <320fb6e00901290722m5c9c5623j521860ad0b0e6f63@mail.gmail.com> Message-ID: <956003ae0901290815o29fdc3c9n3b73bf009e79daba@mail.gmail.com> 2009/1/29 Peter : > Hi, > > I was just looking for the latest documentation, and found a number of > broken links on this page: > http://www.reportlab.org/os_documentation.html We're working on it as you write ;-) We just did some renaming; if you browse http://www.reportlab.com/docs/ you will find all the open source docs, now named reportlab-graphics-reference.pdf reportlab-reference.pdf reportlab-userguide.pdf Unfortunately the web site links did not get rewritten at 2am when they were generated, but they should be sorted by end of day today. - Andy From andy at reportlab.com Thu Jan 29 11:38:56 2009 From: andy at reportlab.com (Andy Robinson) Date: Thu, 29 Jan 2009 16:38:56 +0000 Subject: [reportlab-users] External hyperlinks in SVG output In-Reply-To: <320fb6e00901290737k1269fb4en92975edbcf87f88a@mail.gmail.com> References: <320fb6e00901290737k1269fb4en92975edbcf87f88a@mail.gmail.com> Message-ID: <956003ae0901290838g6393c59dxb36e52626ff6429c@mail.gmail.com> 2009/1/29 Peter : > I imagine there are parallels here with PDF output, which can in > theory also include externals URLs. Is any of this currently possible > in ReportLab? I've been looking over the documentation and the source > code, but have concluded that it is not yet supported. No. A few people have asked us about charts with click-throughs and drill-downs, but we never did it. There are two parts to this. First, the shapes hierarchy in reportlab/graphics would need some extra properties so that a shape could have link properties. This is straightforward for manually constructed shapes, but presumably for charts one would need to allow some subclass or callback mechanism so the caller can define what URLs a data point or bar would link to. Secondly, each renderer would need to do the right thing. I can see this would be really easy with SVG. If you're willing to do a little work on this and contribute patches for core and SVG back end, we'd be happy to help out and maybe do the same in PDF in step with it. Now that the browser Canvas is getting popular, maybe someone might even roll us a back end for that too ;-) Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From robin at reportlab.com Thu Jan 29 11:49:08 2009 From: robin at reportlab.com (Robin Becker) Date: Thu, 29 Jan 2009 16:49:08 +0000 Subject: [reportlab-users] Suggested patch for "missing" SVG colours In-Reply-To: <4981D50F.7040400@safeonlinebilling.com> References: <4981D50F.7040400@safeonlinebilling.com> Message-ID: <4981DE04.2030501@chamonix.reportlab.co.uk> Paul Barrass wrote: >........ > > darkgrey = HexColor(0xA9A9A9) > darkslategrey = HexColor(0x2F4F4F) > dimgrey = HexColor(0x696969) > lightgray = HexColor(0xD3D3D3) > lightslategrey = HexColor(0x778899) > slategrey = HexColor(0x708090) > > It's not massively critical, but would help confusion when I tell people > they can use the "standard SVG" colours, then some of them not be > recognised. ..... I think my book on HTML/XHTML etc etc uses GRAY rather than GREY and doesn't mention alternates. I have added your patch, but we probably ought to remove the mispellings if they eventually end up leading people astray. I guess we really ought to translate Color(green) into "green" when it's used in a textual context anyhow which might mean problems unless grey --> "gray" (if that is the official colour name). -- Robin Becker From andy at reportlab.com Thu Jan 29 11:55:57 2009 From: andy at reportlab.com (Andy Robinson) Date: Thu, 29 Jan 2009 16:55:57 +0000 Subject: [reportlab-users] Reportlab and SVG output In-Reply-To: <320fb6e00901290715n20f9adb3yd187e2df7a04c0ea@mail.gmail.com> References: <320fb6e00901290519t18f7c732q3aea6e3249f49803@mail.gmail.com> <956003ae0901290611g19ca08c0xb3fa6bb2654f9cfc@mail.gmail.com> <320fb6e00901290715n20f9adb3yd187e2df7a04c0ea@mail.gmail.com> Message-ID: <956003ae0901290855h7e144582rbafef13e0d7105e6@mail.gmail.com> 2009/1/29 Peter : >> I think it makes sense if we hold off on the 2.3 release for a few more days and >> try to include this. Robin has committed this already, going with Tim's suggestion. The top of each file now looks like this.... ... At some point post 2.3, we'll try to include all the graphics output nightly on the site somewhere.... -- Andy From paul.barrass at safeonlinebilling.com Thu Jan 29 12:58:46 2009 From: paul.barrass at safeonlinebilling.com (Paul Barrass) Date: Thu, 29 Jan 2009 17:58:46 +0000 Subject: [reportlab-users] Suggested patch for "missing" SVG colours In-Reply-To: <4981DE04.2030501@chamonix.reportlab.co.uk> References: <4981D50F.7040400@safeonlinebilling.com> <4981DE04.2030501@chamonix.reportlab.co.uk> Message-ID: <4981EE56.1070509@safeonlinebilling.com> Robin Becker wrote: > I think my book on HTML/XHTML etc etc uses GRAY rather than GREY and > doesn't mention alternates. I have added your patch, but we probably > ought to remove the mispellings if they eventually end up leading > people astray. > > I guess we really ought to translate Color(green) into "green" when > it's used in a textual context anyhow which might mean problems unless > grey --> "gray" (if that is the official colour name). Hi, The official W3 SVG spec defines both spellings - http://www.w3.org/TR/SVG/types.html#ColorKeywords . From my reading of the specs, HTML and CSS2 define only 17 colours (using the gray spelling), but most browsers also support the SVG list. CSS3 includes the full list of SVG colours, including both spellings of grey. On another note, I have noticed that my alphabetising is incorrect - the various greens should fall between the gray and greys, though I could just claim to be following Reportlab's precedent ;) Paul Barrass. From andy at reportlab.com Thu Jan 29 14:33:15 2009 From: andy at reportlab.com (Andy Robinson) Date: Thu, 29 Jan 2009 19:33:15 +0000 Subject: [reportlab-users] Suggested patch for "missing" SVG colours In-Reply-To: <4981EE56.1070509@safeonlinebilling.com> References: <4981D50F.7040400@safeonlinebilling.com> <4981DE04.2030501@chamonix.reportlab.co.uk> <4981EE56.1070509@safeonlinebilling.com> Message-ID: <956003ae0901291133p55c2006eu7287b2eb75c941ab@mail.gmail.com> 2009/1/29 Paul Barrass : > The official W3 SVG spec defines both spellings - > http://www.w3.org/TR/SVG/types.html#ColorKeywords . From my reading of the > specs, HTML and CSS2 define only 17 colours (using the gray spelling), but > most browsers also support the SVG list. CSS3 includes the full list of SVG > colours, including both spellings of grey. The possible confusion may occur with reverse lookups. For example, if one uses 'lightgrey' in code to create a Color object, it gets passed around as numbers internally, and one is then writing out HTML, one has to decide whether to use a 'reverse lookup' and find a name if one matches, or to just output the RGB values. I can also see a similar issue if anyone tried to build a GUI inspector with named colors (sorry, 'colours' - sic) in dropdowns. Anyway it's a theoretical future worry, not an actual one, so I''m quite happy to have any common and useful colour names in there. - Andy From peter at maubp.freeserve.co.uk Fri Jan 30 07:24:02 2009 From: peter at maubp.freeserve.co.uk (Peter) Date: Fri, 30 Jan 2009 12:24:02 +0000 Subject: [reportlab-users] drawToFile and drawToString docstrings Message-ID: <320fb6e00901300424w1db1421dke230a158b55039a1@mail.gmail.com> Hi, This is suggestion for how to improve a couple of the docstrings for the render back ends, reportlab/graphics/renderPDF.py reportlab/graphics/renderPS.py reportlab/graphics/renderSVG.py reportlab/graphics/renderPM.py In particular, for the drawToFile and drawToString methods (which to my mind are the most important methods), some of these files don't even define a docstring. For drawToFile, it would be nice to say that the fn argument can be a filename (I guess that's what fn stands for) OR a handle object for output (e.g. from opening a file in write mode, or a StringIO handle). Otherwise you have to work this out by trial and error, or reading the code and working it out. I was pleasantly surprised to discover this for myself, as I had needed to do this. For drawToString, I personally would find it informative to know this works by using a cStringIO or StringIO handle internally - but otherwise the current phasing is fine (when there is a docstring at all). Thanks, Peter From rvalyi at gmail.com Fri Jan 30 08:07:44 2009 From: rvalyi at gmail.com (=?ISO-8859-1?Q?Rapha=EBl_Valyi?=) Date: Fri, 30 Jan 2009 14:07:44 +0100 Subject: [reportlab-users] patch to make Reportlab work again on Jython Message-ID: <806313f00901300507o7c427687ic3900621755d79b7@mail.gmail.com> Dear Reportlab developers, Context of use: I'm an OpenERP integrator. That great (if not the greatest) ERP uses Reportlab for all its reports, from invoices to production orders and statistics. After a maturing stage, it's now taking the world of ERP's by storm. Still, in some large companies, some IT guys might be reluctant to adopt a Python based ERP because of Python medium performance, lack of multithreading or standardized environment like they might be used to in the Java world. That's why I'm currently porting it on Jython, the Java powered Python interpreter. You might know that Jython got a new momentum in 2008 after Sun Microsystem hired the two project leads and after JRuby proved a JVM based interpreter + JIT compilator can totally outperform C interpreters (up to 5 times faster on the same Ruby series). While not as ground breaking, Jython is now certainly going there too, probably by 2009 already (they benefit from JRuby a lot too and th JVM will get extra instruction to boost dynamic language JIT). Reportlab not usable directly in Jython currently: Overall, OpenERP is fairly portable to Jython already. Still, one of the biggest issue so far is a Jython bug preventing reportlab to load. Actually, in reportlab, you have some large list instantiations for font data for instance. The trouble is that the Java JVM spec doesn't allow having a class method larger than a certain amount of bytes. And if there is the sum of data structure instantiations is larger already in some Python class method, of course the method arround it will simply blow up the Java Virtual Machine. So yes, this is a Jython bug ( http://bugs.jython.org/issue527524 ) but it is not so easy to fix and it got a low priority because it occurs very rarely in some very specific situations like that one with reportlab. Proposed patch: So, advised by Charles Headius Nutter (the JRuby rock star who work around the kind of issue), I came up with a patch for the reportlab file (/reportlab/pdfbase/_fontdata.py), wrapping each of those very large list declarations inside dumb private method so that no method will get larger than the allowed size. I admit it, that's not particularily elegant. But it's not too ugly either and easy to refactor the right way when the Jython bug get fixed (after OpenERP on Java makes Sun release how much important this is). But more importantly, it's working and allow using Reportlab in Jython again (at least on Jython trunk, expect release in February)! So please could you consider including the attached patch (the whole file actually) in your trunk distro (it's made from the trunk SVN). I'm very sure it has not perf impact at all either. On the contrary, running on Jython could soon give you a serious boost when everything will JIT just as nicely as in JRuby. What is your position regarding to this? Rapha?l Valyi www.smile.fr -------------- next part -------------- A non-text attachment was scrubbed... Name: _fontdata.py Type: text/x-python Size: 62960 bytes Desc: not available Url : From robin at reportlab.com Fri Jan 30 08:20:27 2009 From: robin at reportlab.com (Robin Becker) Date: Fri, 30 Jan 2009 13:20:27 +0000 Subject: [reportlab-users] patch to make Reportlab work again on Jython In-Reply-To: <806313f00901300507o7c427687ic3900621755d79b7@mail.gmail.com> References: <806313f00901300507o7c427687ic3900621755d79b7@mail.gmail.com> Message-ID: <4982FE9B.8090604@chamonix.reportlab.co.uk> Rapha?l Valyi wrote: > Dear Reportlab developers, ........ > > Proposed patch: > > So, advised by Charles Headius Nutter (the JRuby rock star who work > around the kind of issue), I came up with a patch for the reportlab > file (/reportlab/pdfbase/_fontdata.py), wrapping each of those very > large list declarations inside dumb private method so that no method > will get larger than the allowed size. I admit it, that's not > particularily elegant. But it's not too ugly either and easy to > refactor the right way when the Jython bug get fixed (after OpenERP on > Java makes Sun release how much important this is). But more > importantly, it's working and allow using Reportlab in Jython again > (at least on Jython trunk, expect release in February)! > > So please could you consider including the attached patch (the whole > file actually) in your trunk distro (it's made from the trunk SVN). > I'm very sure it has not perf impact at all either. On the contrary, > running on Jython could soon give you a serious boost when everything > will JIT just as nicely as in JRuby. > > What is your position regarding to this? > > > Rapha?l Valyi > www.smile.fr ....... well we have an old working implementation that ran under jython which you can check out at http://svn.reportlab.com/svn/public/reportlab/branches/Jython-branch/reportlab In that code (which is now 5 years old) we did not find it necessary to touch any large arrays at all in _fontdata. So has jython regressed or is it java that's changed? -- Robin Becker From bfreeman at appropriatesolutions.com Fri Jan 30 09:48:33 2009 From: bfreeman at appropriatesolutions.com (Bill Freeman) Date: Fri, 30 Jan 2009 09:48:33 -0500 Subject: [reportlab-users] patch to make Reportlab work again on Jython In-Reply-To: <806313f00901300507o7c427687ic3900621755d79b7@mail.gmail.com> References: <806313f00901300507o7c427687ic3900621755d79b7@mail.gmail.com> Message-ID: <49831341.3050602@appropriatesolutions.com> Rapha?l Valyi wrote: > The trouble is that the Java JVM spec doesn't allow having a class > method larger than a certain amount of bytes. > It seems to me that the place to work around this issue is in jython, rather than in every application that is valid python but which exceeds the JVM's capricious limits. Bill From andy at reportlab.com Fri Jan 30 10:28:54 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 30 Jan 2009 15:28:54 +0000 Subject: [reportlab-users] drawToFile and drawToString docstrings In-Reply-To: <320fb6e00901300424w1db1421dke230a158b55039a1@mail.gmail.com> References: <320fb6e00901300424w1db1421dke230a158b55039a1@mail.gmail.com> Message-ID: <956003ae0901300728x456bc848j866073fe2531099e@mail.gmail.com> 2009/1/30 Peter : > Hi, > > This is suggestion for how to improve a couple of the docstrings for > the render back ends, Thanks. We've noted these, but I won't guarantee to fix them for the 2.3 release next week. In general ALL our docstrings need an overhaul by a good writer who knows the code, but since we derive no revenue from our open source activities and are perennially busy, we don't do as much documentation as we should. If you are willing to submit actual new paragraphs as replacements, or patches, we will definitely review them and put them in quickly. We're also happy to grant commit rights to anyone willing to work on the docs - just email me to ask. Instead of working through the docstrings, we are planning to put our 'community time' over the next couple of months into a web based mechanism to solicit better docs and comments. I'll let people know when this is ready, but it will be a few weeks. - Andy From peter at maubp.freeserve.co.uk Fri Jan 30 10:54:26 2009 From: peter at maubp.freeserve.co.uk (Peter) Date: Fri, 30 Jan 2009 15:54:26 +0000 Subject: [reportlab-users] drawToFile and drawToString docstrings In-Reply-To: <956003ae0901300728x456bc848j866073fe2531099e@mail.gmail.com> References: <320fb6e00901300424w1db1421dke230a158b55039a1@mail.gmail.com> <956003ae0901300728x456bc848j866073fe2531099e@mail.gmail.com> Message-ID: <320fb6e00901300754j4bf51c6dkf076284d3d3a6a21@mail.gmail.com> On Fri, Jan 30, 2009 at 3:28 PM, Andy Robinson wrote: > Thanks. We've noted these, but I won't guarantee to fix them for the 2.3 > release next week. In general ALL our docstrings need an overhaul by a > good writer who knows the code, but since we derive no revenue from our > open source activities and are perennially busy, we don't do as much > documentation as we should. That would be a big bonus for anyone new to ReportLab, or even those how have used it a fair bit. The PDF tutorials are good, but don't cover this low level stuff. > If you are willing to submit actual new paragraphs as replacements, > or patches, we will definitely review them and put them in quickly. We're > also happy to grant commit rights to anyone willing to work on the docs - > just email me to ask. At this point I doubt I'll have enough suggestions to warrant commit access, but we'll see. I could put together a diff against the trunk code to update the render modules' docstrings, but not right now. Hopefully next week... > Instead of working through the docstrings, we are planning to put our > 'community time' over the next couple of months into a web based > mechanism to solicit better docs and comments. I'll let people > know when this is ready, but it will be a few weeks. Fair enough. I would certainly vote for fixing up the docstrings a bit ;) Thanks, Peter From andy at reportlab.com Fri Jan 30 11:16:36 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 30 Jan 2009 16:16:36 +0000 Subject: [reportlab-users] patch to make Reportlab work again on Jython In-Reply-To: <806313f00901300507o7c427687ic3900621755d79b7@mail.gmail.com> References: <806313f00901300507o7c427687ic3900621755d79b7@mail.gmail.com> Message-ID: <956003ae0901300816v604f3c79kb7106e9ca21278dd@mail.gmail.com> 2009/1/30 Rapha?l Valyi : > Reportlab not usable directly in Jython currently: > What is your position regarding to this? It would be great to be Jython-compatible again. We'll take a look and do this if it's harmless. In return we'd be really grateful for some feedback or info from you on the level of Jython compatibility to write about on our site, and maybe some benchmark figures. The last time we got truly Jython compatible was in 2003. We used the 'invariant' flag on the Canvas to make non-time-dependent PDFs, and generated the test suite output from CPython and Jython, and proved the output directories were identical. And a Java developer here wrote an rl_accel.java which did the same as the C module. But nobody has maintained that or repeated the exercise. Are you using that module, or are you running without accelerators? Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From andy at reportlab.com Fri Jan 30 11:24:06 2009 From: andy at reportlab.com (Andy Robinson) Date: Fri, 30 Jan 2009 16:24:06 +0000 Subject: [reportlab-users] patch to make Reportlab work again on Jython In-Reply-To: <956003ae0901300816v604f3c79kb7106e9ca21278dd@mail.gmail.com> References: <806313f00901300507o7c427687ic3900621755d79b7@mail.gmail.com> <956003ae0901300816v604f3c79kb7106e9ca21278dd@mail.gmail.com> Message-ID: <956003ae0901300824v39358922p7f93d8452375c893@mail.gmail.com> Rapha?l, does Jython pay attention to '__all__' ? If so, perhaps we could do something less hacky and just list the bits we want in an '__all__' variable. Sorry but I don't have time to experiment on Jython itself. - Andy From rvalyi at gmail.com Fri Jan 30 14:44:29 2009 From: rvalyi at gmail.com (=?ISO-8859-1?Q?Rapha=EBl_Valyi?=) Date: Fri, 30 Jan 2009 20:44:29 +0100 Subject: [reportlab-users] patch to make Reportlab work again on Jython In-Reply-To: <4982FE9B.8090604@chamonix.reportlab.co.uk> References: <806313f00901300507o7c427687ic3900621755d79b7@mail.gmail.com> <4982FE9B.8090604@chamonix.reportlab.co.uk> Message-ID: <806313f00901301144w1fb2037dxef550e50e83254e1@mail.gmail.com> Robin, no Jython has been far from regressing. Actually the Jython bug has been first reported in 2002. I'm guessing that the reason why it broke up is that may be this file just got fatter. As it will be compiled to only one method body, that could explain why it's now broken. Rapha?l Valyi On Fri, Jan 30, 2009 at 2:20 PM, Robin Becker wrote: > Rapha?l Valyi wrote: >> >> Dear Reportlab developers, > > ........ >> >> Proposed patch: >> >> So, advised by Charles Headius Nutter (the JRuby rock star who work >> around the kind of issue), I came up with a patch for the reportlab >> file (/reportlab/pdfbase/_fontdata.py), wrapping each of those very >> large list declarations inside dumb private method so that no method >> will get larger than the allowed size. I admit it, that's not >> particularily elegant. But it's not too ugly either and easy to >> refactor the right way when the Jython bug get fixed (after OpenERP on >> Java makes Sun release how much important this is). But more >> importantly, it's working and allow using Reportlab in Jython again >> (at least on Jython trunk, expect release in February)! >> >> So please could you consider including the attached patch (the whole >> file actually) in your trunk distro (it's made from the trunk SVN). >> I'm very sure it has not perf impact at all either. On the contrary, >> running on Jython could soon give you a serious boost when everything >> will JIT just as nicely as in JRuby. >> >> What is your position regarding to this? >> >> >> Rapha?l Valyi >> www.smile.fr > > ....... > well we have an old working implementation that ran under jython which you > can check out at > > http://svn.reportlab.com/svn/public/reportlab/branches/Jython-branch/reportlab > > In that code (which is now 5 years old) we did not find it necessary to > touch any large arrays at all in _fontdata. So has jython regressed or is it > java that's changed? > -- > Robin Becker > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users >