From andy at reportlab.com Mon Sep 1 02:35:08 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 1 Sep 2008 07:35:08 +0100 Subject: [reportlab-users] Page numbers of bookmarks In-Reply-To: <200808311446.37491.ralsina@netmanagers.com.ar> References: <200808311446.37491.ralsina@netmanagers.com.ar> Message-ID: <956003ae0808312335v4fcd0fb1l1e6da2fc9026fc9f@mail.gmail.com> 2008/8/31 Roberto Alsina : > I don't know if this is possible, but I am trying to produce a book-like table > of contents, like this: > > 1. The first section ..........................1 > 2. The second.................................14 > > And link each one to the correct place in the document. > The hard part is, of course, figuring out the "1" and the "14" :-) If you can give me a day or two, I am busy producing some updated teaching examples (due for PyCON UK next Friday, 12th, but for general release too) and will try to make up a good example. In your architecture, is it easy to make a first pass over the content and work out what the section names will be, before the document is rendered? - Andy From gherman at darwin.in-berlin.de Mon Sep 1 03:52:52 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 1 Sep 2008 09:52:52 +0200 Subject: [reportlab-users] Page numbers of bookmarks In-Reply-To: <200808311446.37491.ralsina@netmanagers.com.ar> References: <200808311446.37491.ralsina@netmanagers.com.ar> Message-ID: <6F634FAE-B367-4AFD-80DE-9783D514D65E@darwin.in-berlin.de> Roberto Alsina: > 1. The first section ..........................1 > 2. The second.................................14 > > And link each one to the correct place in the document. > The hard part is, of course, figuring out the "1" and the "14" :-) > > Any hints as to where I should look? I guess what you mean is a table of contents, right? If so, try the following link if it works for you (it doesn't right now for me): http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/test/test_platypus_toc.py Or look in your RL installation for reportlab/test/test_platypus_toc.py. Or run the attached file which I've slightly modified. Regards, Dinu PS: And add an autoupdate feature for rst2pdf, please. ;-) -------------- next part -------------- A non-text attachment was scrubbed... Name: test_platypus_toc2.py Type: text/x-python-script Size: 6454 bytes Desc: not available Url : -------------- next part -------------- From andy at reportlab.com Mon Sep 1 04:29:18 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 1 Sep 2008 09:29:18 +0100 Subject: [reportlab-users] Subversion issue - use HTTPS not HTTP Message-ID: <956003ae0809010129h3b52d828id25ad9d8c129b7d5@mail.gmail.com> Hi all, As some of you know, the old subversion URL is not working. Our building switched ISPs recently and the new one is not forwarding port 80 to this server, and also doesn't know why or how to fix it :-( We will be moving to new offices and a new ISP in the next few weeks anyway, so we are not going to expend more time on this. For now please use https. I have amended the subversion page on the site to reflect this. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. 165 The Broadway, Wimbledon, London SW19 1NE, UK Tel +44-20-8544-8049 From andy at reportlab.com Mon Sep 1 04:31:30 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 1 Sep 2008 09:31:30 +0100 Subject: [reportlab-users] Page numbers of bookmarks In-Reply-To: <6F634FAE-B367-4AFD-80DE-9783D514D65E@darwin.in-berlin.de> References: <200808311446.37491.ralsina@netmanagers.com.ar> <6F634FAE-B367-4AFD-80DE-9783D514D65E@darwin.in-berlin.de> Message-ID: <956003ae0809010131q44405b0bve27932386104c77a@mail.gmail.com> 2008/9/1 Dinu Gherman : > http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/test/test_platypus_toc.py > That works but is hardly friendly, and it forces multiple rendering passes. I'm working on a slightly simpler "single pass" approach at the moment, based on what ReportLab does internally in RML projects. The idea is to use the 'deferred form' tricks to do the actual numbers, as done when people do "page x of y". - Andy From gherman at darwin.in-berlin.de Mon Sep 1 04:46:46 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 1 Sep 2008 10:46:46 +0200 Subject: [reportlab-users] Subversion issue - use HTTPS not HTTP In-Reply-To: <956003ae0809010129h3b52d828id25ad9d8c129b7d5@mail.gmail.com> References: <956003ae0809010129h3b52d828id25ad9d8c129b7d5@mail.gmail.com> Message-ID: <870A3EE2-1A18-472E-8455-5CEE8F712979@darwin.in-berlin.de> Andy Robinson: > As some of you know, the old subversion URL is not working. Our > building switched ISPs recently and the new one is not forwarding port > 80 to this server, and also doesn't know why or how to fix it :-( > > We will be moving to new offices and a new ISP in the next few weeks > anyway, so we are not going to expend more time on this. For now > please use https. I have amended the subversion page on the site to > reflect this. I had copied the link http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/test/test_platypus_toc.py from the file test_platypus_toc.py itself. Using HTTPS with the link https://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/test/test_platypus_toc.py doesn't work either, since I'm getting a login panel for www.reportlab.co.uk:443 ... FWIW, Dinu -------------- next part -------------- An HTML attachment was scrubbed... URL: From robin at reportlab.com Mon Sep 1 06:05:54 2008 From: robin at reportlab.com (Robin Becker) Date: Mon, 01 Sep 2008 11:05:54 +0100 Subject: [reportlab-users] Problem with KeepInFrame in 2.1 In-Reply-To: <200808311149.12881.ralsina@netmanagers.com.ar> References: <200808310907.00446.ralsina@netmanagers.com.ar> <48BA9595.2000509@jessikat.plus.net> <200808311149.12881.ralsina@netmanagers.com.ar> Message-ID: <48BBBE82.7030308@chamonix.reportlab.co.uk> Roberto Alsina wrote: ........ok like. > > Sorry I was not clear. > > Look at the preformatted code fragments (the ones with beige background). They > are supposed to have a border all around them, but only the left edge is > shown,and the rest is not visible. > > If I make the border thicker, it is visible all around, but the left edge is > always thicker. > > Looking a bit harder, it seems the problem is that the border is apparently > drawn "outside" the XPreformatted's area. Since the KeepInFrame clips like > this: > > p = canv.beginPath() > p.rect(x, y, self.width,self.height) > canv.clipPath(p,stroke=0) > > The border gets clipped. I don't know why the left edge is still visible, > though. > I just got tow colleagues to look at this document with various viewers and they both agreed with me that the borders look fine. It is certainly true that keepInFrame will brutally truncate stuff if you use that mode. Truncate should logically only be used when you are debugging (there may be other use cases, but I can't think of them right now). We don't normally want to truncate content. ReportLab's box model is arguably wrong as we don't really deal with stroke width. -- Robin Becker From andy at reportlab.com Mon Sep 1 06:44:56 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 1 Sep 2008 11:44:56 +0100 Subject: [reportlab-users] Problem with KeepInFrame in 2.1 In-Reply-To: <48BBBE82.7030308@chamonix.reportlab.co.uk> References: <200808310907.00446.ralsina@netmanagers.com.ar> <48BA9595.2000509@jessikat.plus.net> <200808311149.12881.ralsina@netmanagers.com.ar> <48BBBE82.7030308@chamonix.reportlab.co.uk> Message-ID: <956003ae0809010344h3ba28b2cj1136fedaf51ec2ac@mail.gmail.com> 2008/9/1 Robin Becker : > ReportLab's box model is arguably wrong as we don't really deal with stroke > width. It's certainly different to HTML, but I don't think it's "wrong";-) It's a lot easier to work out the size of a table by adding the row heights or column widths, than to correct for all the line widths. We don't pretend to follow the (various) CSS box model(s), we just do what's easy for us to render. - Andy From ralsina at netmanagers.com.ar Mon Sep 1 06:45:30 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Mon, 1 Sep 2008 07:45:30 -0300 Subject: [reportlab-users] Page numbers of bookmarks In-Reply-To: <956003ae0808312335v4fcd0fb1l1e6da2fc9026fc9f@mail.gmail.com> References: <200808311446.37491.ralsina@netmanagers.com.ar> <956003ae0808312335v4fcd0fb1l1e6da2fc9026fc9f@mail.gmail.com> Message-ID: <200809010745.31168.ralsina@netmanagers.com.ar> On Monday 01 September 2008 03:35:08 Andy Robinson wrote: > 2008/8/31 Roberto Alsina : > > I don't know if this is possible, but I am trying to produce a book-like > > table of contents, like this: > > > > 1. The first section ..........................1 > > 2. The second.................................14 > > > > And link each one to the correct place in the document. > > The hard part is, of course, figuring out the "1" and the "14" :-) > > If you can give me a day or two, I am busy producing some updated teaching > examples (due for PyCON UK next Friday, 12th, but for general release too) > and will try to make up a good example. > > In your architecture, is it easy to make a first pass over the content and > work out what the section names will be, before the document is rendered? Yes, that is easy. -- ("\''/").__..-''"`-. . 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 ralsina at netmanagers.com.ar Mon Sep 1 06:46:27 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Mon, 1 Sep 2008 07:46:27 -0300 Subject: [reportlab-users] Page numbers of bookmarks In-Reply-To: <6F634FAE-B367-4AFD-80DE-9783D514D65E@darwin.in-berlin.de> References: <200808311446.37491.ralsina@netmanagers.com.ar> <6F634FAE-B367-4AFD-80DE-9783D514D65E@darwin.in-berlin.de> Message-ID: <200809010746.28200.ralsina@netmanagers.com.ar> On Monday 01 September 2008 04:52:52 Dinu Gherman wrote: > Roberto Alsina: > > 1. The first section ..........................1 > > 2. The second.................................14 > > > > And link each one to the correct place in the document. > > The hard part is, of course, figuring out the "1" and the "14" :-) > > > > Any hints as to where I should look? > > I guess what you mean is a table of contents, right? > > If so, try the following link if it works for you (it doesn't right now > for me): > > > http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/repor >tlab/test/test_platypus_toc.py > > Or look in your RL installation for reportlab/test/test_platypus_toc.py. > Or run the attached file which I've slightly modified. Will do. > PS: And add an autoupdate feature for rst2pdf, please. ;-) Autoupdate? -- ("\''/").__..-''"`-. . 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 ralsina at netmanagers.com.ar Mon Sep 1 06:48:50 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Mon, 1 Sep 2008 07:48:50 -0300 Subject: [reportlab-users] Problem with KeepInFrame in 2.1 In-Reply-To: <48BBBE82.7030308@chamonix.reportlab.co.uk> References: <200808310907.00446.ralsina@netmanagers.com.ar> <200808311149.12881.ralsina@netmanagers.com.ar> <48BBBE82.7030308@chamonix.reportlab.co.uk> Message-ID: <200809010748.50806.ralsina@netmanagers.com.ar> On Monday 01 September 2008 07:05:54 Robin Becker wrote: > Roberto Alsina wrote: > ........ok like. > > > Sorry I was not clear. > > > > Look at the preformatted code fragments (the ones with beige background). > > They are supposed to have a border all around them, but only the left > > edge is shown,and the rest is not visible. > > > > If I make the border thicker, it is visible all around, but the left edge > > is always thicker. > > > > Looking a bit harder, it seems the problem is that the border is > > apparently drawn "outside" the XPreformatted's area. Since the > > KeepInFrame clips like this: > > > > p = canv.beginPath() > > p.rect(x, y, self.width,self.height) > > canv.clipPath(p,stroke=0) > > > > The border gets clipped. I don't know why the left edge is still visible, > > though. > > I just got tow colleagues to look at this document with various viewers and > they both agreed with me that the borders look fine. It is certainly true > that keepInFrame will brutally truncate stuff if you use that mode. > Truncate should logically only be used when you are debugging (there may be > other use cases, but I can't think of them right now). We don't normally > want to truncate content. I'll just switch the default to shrink. > ReportLab's box model is arguably wrong as we don't really deal with stroke > width. -- ("\''/").__..-''"`-. . 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 Mon Sep 1 07:17:04 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 1 Sep 2008 12:17:04 +0100 Subject: [reportlab-users] ReportLab 2.2 deployment options Message-ID: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> Hi everyone, We are hoping to do 2.2 in a couple of week's time. No major features but hopefully collect and partly-document the fixes and enhancements since the last one 15 months ago. I am giving a tutorial at PyCon-UK on Friday 12th and would like to release it then or soon after, and we should have some web pages up in a couple of days summarising what's coming. Two key questions today: Q1. How badly do people want setuptools, eggs, easy_install and so on? Is plain old distutils good enough? Q2. Should we try to do "batteries included", with the accelerator, optional C libraries for rendering bitmaps and the type 1 fonts included in the basic package and one setup script to build it all? Our worry is: you can use a lot of functionality with just the Python code and maybe the _rl_accel.c extension. But if we want to put the graphics extensions "in the box", we introduce dependencies on libart, freetype, libjpeg, PIL and so on. Due to limited resources, we'd aim to test on Ubuntu 8.04 and Windows, but we would not want to spend our own time trying to make convoluted setup scripts work with a gazillion distros. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. 165 The Broadway, Wimbledon, London SW19 1NE, UK Tel +44-20-8544-8049 From haraldarminmassa at gmail.com Mon Sep 1 07:51:29 2008 From: haraldarminmassa at gmail.com (Harald Armin Massa) Date: Mon, 1 Sep 2008 13:51:29 +0200 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> Message-ID: <7be3f35d0809010451u558e9ba0tcd981afd6dfa363@mail.gmail.com> Andy, > Q1. How badly do people want setuptools, eggs, easy_install and so on? > Is plain old distutils good enough? > actually I install reportlab by copying it into my application repository. On new libraries I really like easy_install. > > Q2. Should we try to do "batteries included", with the accelerator, > optional C libraries for rendering bitmaps and the type 1 fonts > included in the basic package and one setup script to build it all? > It would be nice to have the COMPILED c-libraries somehow included. for PIL et all a good documentation or helpfull error-msg are good enough, I think. Especially as there are quite other challenges on including images that people have to learn. best wishes, 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! -------------- next part -------------- An HTML attachment was scrubbed... URL: From gherman at darwin.in-berlin.de Mon Sep 1 08:11:22 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 1 Sep 2008 14:11:22 +0200 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> Message-ID: <7DFA4547-511A-46E1-B389-B37FA505F65A@darwin.in-berlin.de> Andy Robinson: > Q1. How badly do people want setuptools, eggs, easy_install and so on? > Is plain old distutils good enough? I'm still not a big fan of setuptools, but I also use it now and, unfortunately (or rather: unfortunately we don't have anything better), it has taken off already and enough people want it *really* badly. > Q2. Should we try to do "batteries included", with the accelerator, > optional C libraries for rendering bitmaps and the type 1 fonts > included in the basic package and one setup script to build it all? Yes. > Our worry is: you can use a lot of functionality with just the Python > code and maybe the _rl_accel.c extension. But if we want to put the > graphics extensions "in the box", we introduce dependencies on > libart, freetype, libjpeg, PIL and so on. Due to limited resources, > we'd aim to test on Ubuntu 8.04 and Windows, but we would not want to > spend our own time trying to make convoluted setup scripts work with a > gazillion distros. Friendly error messages and comprehensive testing will be your friends... Dinu From dirk.holtwick at gmail.com Mon Sep 1 08:12:44 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Mon, 01 Sep 2008 14:12:44 +0200 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> Message-ID: <48BBDC3C.6090401@gmail.com> Andy Robinson schrieb: > Q1. How badly do people want setuptools, eggs, easy_install and so on? > Is plain old distutils good enough? Setuptools is very nice indeed. I think this would be a great "plus" for ReportLab and maybe makes again more popular. It would also be great for third party software like Pisa to set the dependencies for Reportlab in their installations too ;) > Q2. Should we try to do "batteries included", with the accelerator, > optional C libraries for rendering bitmaps and the type 1 fonts > included in the basic package and one setup script to build it all? I think that you should split up the whole thing into two separate distributions: - reportlab_toolkit - reportlab_addons This way you have less trouble setting up with setuptools and less dependencies. Or you might also split up like this - reportlab_toolkit or reportlab_toolkit_minimal - reportlab_toolkit_complete So that the dependencies are from the second package to the first and not the other way. This wy you can also avoid having difficult dependencies like "PIL". Hope this was useful Dirk From andy at reportlab.com Mon Sep 1 08:30:51 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 1 Sep 2008 13:30:51 +0100 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <7DFA4547-511A-46E1-B389-B37FA505F65A@darwin.in-berlin.de> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> <7DFA4547-511A-46E1-B389-B37FA505F65A@darwin.in-berlin.de> Message-ID: <956003ae0809010530g5ada7e84i7f173e9524b45b6d@mail.gmail.com> 2008/9/1 Dinu Gherman : > Friendly error messages and comprehensive testing will be your > friends... Yes, we have a separate checking tool (rl_check.py), but it probably ought to be at the top level of the package and run when you run the test suite. - Andy From andy at reportlab.com Mon Sep 1 08:40:07 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 1 Sep 2008 13:40:07 +0100 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <48BBDC3C.6090401@gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> <48BBDC3C.6090401@gmail.com> Message-ID: <956003ae0809010540g4d3adc0bw8188265ab67530e8@mail.gmail.com> 2008/9/1 Dirk Holtwick : > - reportlab_toolkit > - reportlab_addons That's how it works in subversion. But if we want it "easy", I fear that would just double our workload, and the dependency questions. The key question is, should the ability to create bitmap charts be in the standard package? If so then we need _renderPM.c and the Type 1 fonts, and renderPM drags in PIL, freetype, libjpeg etc etc. - Andy From dirk.holtwick at gmail.com Mon Sep 1 09:05:24 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Mon, 01 Sep 2008 15:05:24 +0200 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <956003ae0809010540g4d3adc0bw8188265ab67530e8@mail.gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> <48BBDC3C.6090401@gmail.com> <956003ae0809010540g4d3adc0bw8188265ab67530e8@mail.gmail.com> Message-ID: <48BBE894.5060303@gmail.com> Andy Robinson schrieb: > 2008/9/1 Dirk Holtwick : >> - reportlab_toolkit >> - reportlab_addons > That's how it works in subversion. But if we want it "easy", I fear > that would just double our workload, and the dependency questions. > > The key question is, should the ability to create bitmap charts be in > the standard package? If so then we need _renderPM.c and the Type 1 > fonts, and renderPM drags in PIL, freetype, libjpeg etc etc. I think bitmap creation is not needed in the standard package. For most users I believe the focus is on PDF. BTW: You should give PyLint a try. It finds a lot of hidden bugs sleeping in the code ;) Best way (because of a bug in PyLint) to install it is: http://pypi.python.org/pypi/logilab.pylintinstaller/0.1.1 Then run: $ pylint -e reportlab Very very useful is to use it within Eclipse PyDev: http://pydev.sourceforge.net/pylint.html Dirk From gherman at darwin.in-berlin.de Mon Sep 1 09:11:08 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 1 Sep 2008 15:11:08 +0200 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <48BBE894.5060303@gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> <48BBDC3C.6090401@gmail.com> <956003ae0809010540g4d3adc0bw8188265ab67530e8@mail.gmail.com> <48BBE894.5060303@gmail.com> Message-ID: <3D3AED74-0FAF-4346-91AF-76099294871A@darwin.in-berlin.de> Dirk Holtwick: > BTW: You should give PyLint a try. It finds a lot of hidden bugs > sleeping in the code ;) Right! Last time I tried it PyLint gave RL 0.7 points out of ten... Dinu From robin at reportlab.com Mon Sep 1 09:21:59 2008 From: robin at reportlab.com (Robin Becker) Date: Mon, 01 Sep 2008 14:21:59 +0100 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <48BBDC3C.6090401@gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> <48BBDC3C.6090401@gmail.com> Message-ID: <48BBEC77.6010008@chamonix.reportlab.co.uk> We just had a show and tell in the office and it seems quite hard to do this generally for all distributions. For example even using the reportlab test suite fails. By default we build the documents in place during the test and lo and behold the user installed as root and then tested as a user. He failed one test because we tried to build the user documents in /usr/lib/...site-packages/reportlab/docs. Of course you could argue that the tests shouldn't be installed by default or that the document builder should respect the 'correct' location for documents eg some variation of /usr/local/share /usr/share /share etc etc etc. The problem with distutils and by implication similar tools is that so far they have failed to abstract the logic for this into some usable api. The renderpm stuff depends on freetype a fairly common installation on unix systems, but I look in vain for the correct way to obtain the right settings. In the end we all copy from our favourite proxy setup.py (I think I followed PIL's). Do we end up just duplicating autoconf or is there some easier way with easyinstall? -- Robin Becker From andy at reportlab.com Mon Sep 1 09:28:44 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 1 Sep 2008 14:28:44 +0100 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <3D3AED74-0FAF-4346-91AF-76099294871A@darwin.in-berlin.de> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> <48BBDC3C.6090401@gmail.com> <956003ae0809010540g4d3adc0bw8188265ab67530e8@mail.gmail.com> <48BBE894.5060303@gmail.com> <3D3AED74-0FAF-4346-91AF-76099294871A@darwin.in-berlin.de> Message-ID: <956003ae0809010628l5712bfa0r2b89c6f9e8938582@mail.gmail.com> 2008/9/1 Dinu Gherman : > Dirk Holtwick: > >> BTW: You should give PyLint a try. It finds a lot of hidden bugs >> sleeping in the code ;) > > Right! Last time I tried it PyLint gave RL 0.7 points out of ten... Good idea, but making a general tidyup pass through the code is probably going to run into future releases. - Andy From andy at reportlab.com Mon Sep 1 10:04:51 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 1 Sep 2008 15:04:51 +0100 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <956003ae0809010628l5712bfa0r2b89c6f9e8938582@mail.gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> <48BBDC3C.6090401@gmail.com> <956003ae0809010540g4d3adc0bw8188265ab67530e8@mail.gmail.com> <48BBE894.5060303@gmail.com> <3D3AED74-0FAF-4346-91AF-76099294871A@darwin.in-berlin.de> <956003ae0809010628l5712bfa0r2b89c6f9e8938582@mail.gmail.com> Message-ID: <956003ae0809010704p108bb26ja017d7fcbac94dea@mail.gmail.com> >> Dirk Holtwick: >> >>> BTW: You should give PyLint a try. It finds a lot of hidden bugs >>> sleeping in the code ;) I tried it. It certainly finds some bugs which I'll look at, and probably indicates areas of "unused code" or objects which need more test cases. However there are MANY cases I can see where we are dynamically creating object attributes lazily, and it can't know about those. Thanks for the pointer... - Andy From gherman at darwin.in-berlin.de Mon Sep 1 10:53:19 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 1 Sep 2008 16:53:19 +0200 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <956003ae0809010704p108bb26ja017d7fcbac94dea@mail.gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> <48BBDC3C.6090401@gmail.com> <956003ae0809010540g4d3adc0bw8188265ab67530e8@mail.gmail.com> <48BBE894.5060303@gmail.com> <3D3AED74-0FAF-4346-91AF-76099294871A@darwin.in-berlin.de> <956003ae0809010628l5712bfa0r2b89c6f9e8938582@mail.gmail.com> <956003ae0809010704p108bb26ja017d7fcbac94dea@mail.gmail.com> Message-ID: <7AA4A065-D6E1-4847-B499-FA88F1FBBA45@darwin.in-berlin.de> Andy Robinson: > I tried it. It certainly finds some bugs which I'll look at, and > probably > indicates areas of "unused code" or objects which need more test > cases. However there are MANY cases I can see where we are > dynamically creating object attributes lazily, and it can't know about > those. ... unless you tell it about in a config file. Dinu From andy at reportlab.com Mon Sep 1 11:34:48 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 1 Sep 2008 16:34:48 +0100 Subject: [reportlab-users] More 2.2 questions - package rearrangement Message-ID: <956003ae0809010834j6d630827tb4789c766a173342@mail.gmail.com> I would like peoples' opinions on a package rearrangement. This should make it a bit easier to build standard distutils outputs and be more in line with what other, younger Python packages do. When we first started in 2000, the top-level directory in our CVS rep WAS the 'reportlab' package, and we added all our docs, tests and demos underneath it. This also made distutils harder to use, as the setup.py was under 'reportlab' rather than above it, which used to confuse distutils. Now we're in SVN, it's easy to rearrange things a little. The suggestion is that the >=2.2 source, when checked out or downloaded as a .tar.gz, might contain the more conventional layout like this.... - README, CHANGES etc - setup.py - reportlab/ - the pure python package - reportlab/fonts/ - has more fonts added - rl_addons/ - contains all C source code rl_accel/ renderPM/ - docs/ - code for userguide etc, moved up out of the Python package - tests/ - ditto - demos/ - ditto Setup.py can be written in such a way that it would build and install the extensions if it could; but if not, it would print a message then continue, just installing the pure python code. So a "mininal" Python-only distro is achieved by leaving out the rl_addons directory. --- Does this change look worthwhile? Would it help anyone or hinder anyone, or are people indifferent? Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. 165 The Broadway, Wimbledon, London SW19 1NE, UK Tel +44-20-8544-8049 From dirk.holtwick at gmail.com Mon Sep 1 11:50:13 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Mon, 01 Sep 2008 17:50:13 +0200 Subject: [reportlab-users] More 2.2 questions - package rearrangement In-Reply-To: <956003ae0809010834j6d630827tb4789c766a173342@mail.gmail.com> References: <956003ae0809010834j6d630827tb4789c766a173342@mail.gmail.com> Message-ID: <48BC0F35.9@gmail.com> Andy Robinson schrieb: > - README, CHANGES etc I would like to them be called: README.txt, CHANGES.txt, LICENSE.txt etc because this way most Operating Systems know how to open them. > - setup.py > - reportlab/ - the pure python package > - reportlab/fonts/ - has more fonts added > > - rl_addons/ - contains all C source code > rl_accel/ > renderPM/ These two directories could also be placed under "src/". In your setup.py with Setuptools you then just have to add the line: package_dir = { '': 'src' }, Maybe reportlab/fonts/ and reportlab/tools/ should also move to the top directory because they are not an essential part of reportlab toolkit. > - docs/ - code for userguide etc, moved up out of the Python package > - tests/ - ditto You might add: test_suite = "tests", to setup.py then, so the tests may be executed easily like this: $ python setup.py test > Does this change look worthwhile? Would it help anyone or hinder > anyone, or are people indifferent? I think this is a good idea to cleanup a bit. Dirk From chad at mgproductscnc.com Mon Sep 1 11:56:13 2008 From: chad at mgproductscnc.com (Chad George) Date: Mon, 1 Sep 2008 11:56:13 -0400 Subject: [reportlab-users] Flowable for duplex printing Message-ID: I'm working on a project where the document needs to be able to be duplex printed. The document being generated is actually a collection of a lot of smaller documents. I want to ensure that each sub-document starts on a "front/odd" page when the entire package is printed duplex. To this end I want to have a Flowable that will do either one-or-two pagebreaks to ensure the next page written on is "odd". I looked at the Flowable interface but couldn't see how to access the current document object to determine which page it is currently "drawing" on (odd or even). Thanks, Chad From henning.vonbargen at arcor.de Mon Sep 1 12:10:33 2008 From: henning.vonbargen at arcor.de (Henning von Bargen) Date: Mon, 1 Sep 2008 18:10:33 +0200 Subject: [reportlab-users] More 2.2 questions - package rearrangement References: Message-ID: > From: Dirk Holtwick > Subject: Re: [reportlab-users] More 2.2 questions - package > rearrangement > I would like to them be called: README.txt, CHANGES.txt, LICENSE.txt etc > because this way most Operating Systems know how to open them. > >> - setup.py >> - reportlab/ - the pure python package >> - reportlab/fonts/ - has more fonts added >> >> - rl_addons/ - contains all C source code >> rl_accel/ >> renderPM/ > > These two directories could also be placed under "src/". In your > setup.py with Setuptools you then just have to add the line: > > package_dir = { > '': 'src' > }, > > Maybe reportlab/fonts/ and reportlab/tools/ should also move to the top > directory because they are not an essential part of reportlab toolkit. > > I think this is a good idea to cleanup a bit. > +1 from me. From andy at reportlab.com Mon Sep 1 12:17:33 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 1 Sep 2008 17:17:33 +0100 Subject: [reportlab-users] More 2.2 questions - package rearrangement In-Reply-To: <48BC0F35.9@gmail.com> References: <956003ae0809010834j6d630827tb4789c766a173342@mail.gmail.com> <48BC0F35.9@gmail.com> Message-ID: <956003ae0809010917i7a8cbd2am22d2dcf324023ba0@mail.gmail.com> 2008/9/1 Dirk Holtwick : > Maybe reportlab/fonts/ and reportlab/tools/ should also move to the top > directory because they are not an essential part of reportlab toolkit. I agree on text files ending in .txt. Not sure about reportlab/fonts. If people want it to work "out of the box" with the bitmap graphics then we must include a specific set of base fonts where the code can always find them. If people unzip to a temporary directory and run 'setup.py install', they want a library that "just works" - this includes making a chart, adding some text and saving it to a .png. - Andy From henning.vonbargen at arcor.de Mon Sep 1 12:20:28 2008 From: henning.vonbargen at arcor.de (Henning von Bargen) Date: Mon, 1 Sep 2008 18:20:28 +0200 Subject: [reportlab-users] Adding charSpace as a paragraph style attribute References: Message-ID: <93BD2C3DED1747AC8165EBA6C085C1A9@max> Looking at Paul's patch submitted here a few days ago, I don't see how and where the different charSpace value contributes to the string width calculations. So wouldn't a large charSpace value result in wrong line-breaking? Thinking about it, modifying the charSpace in a paragraph might be an excellent way to improve the quality of justified paragraphs... It could probably done automatically inside the _justifyDrawParaLine and _justifyDrawParaLineX functions of paragraph.py. Henning From gherman at darwin.in-berlin.de Mon Sep 1 12:29:02 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 1 Sep 2008 18:29:02 +0200 Subject: [reportlab-users] Flowable for duplex printing In-Reply-To: References: Message-ID: <44AA093E-43FD-4DF1-B6C7-A2BC71C3A5A3@darwin.in-berlin.de> Chad George: > I'm working on a project where the document needs to be able to be > duplex printed. > > The document being generated is actually a collection of a lot of > smaller documents. I want to ensure that each sub-document starts on a > "front/odd" page when the entire package is printed duplex. > > To this end I want to have a Flowable that will do either one-or-two > pagebreaks to ensure the next page written on is "odd". > > I looked at the Flowable interface but couldn't see how to access the > current document object to determine which page it is currently > "drawing" on (odd or even). I haven't tried this yet, but a flowable usually makes use of its "canv" instance variable (see e.g. XBox.draw). And the Canvas class keeps a "_pageNumber" instance variable. So, normally I'd expect you to get something like a DoublePageBreak class by subclassing the PageBreak one. Hmmm, looking at the code... or by making a variant of its UseUpSpace base class... Regards, Dinu From robin at reportlab.com Mon Sep 1 12:30:27 2008 From: robin at reportlab.com (Robin Becker) Date: Mon, 01 Sep 2008 17:30:27 +0100 Subject: [reportlab-users] More 2.2 questions - package rearrangement In-Reply-To: <48BC0F35.9@gmail.com> References: <956003ae0809010834j6d630827tb4789c766a173342@mail.gmail.com> <48BC0F35.9@gmail.com> Message-ID: <48BC18A3.30609@chamonix.reportlab.co.uk> Dirk Holtwick wrote: > Andy Robinson schrieb: >> - README, CHANGES etc > > I would like to them be called: README.txt, CHANGES.txt, LICENSE.txt etc > because this way most Operating Systems know how to open them. > >> - setup.py >> - reportlab/ - the pure python package >> - reportlab/fonts/ - has more fonts added >> >> - rl_addons/ - contains all C source code >> rl_accel/ >> renderPM/ > > These two directories could also be placed under "src/". In your > setup.py with Setuptools you then just have to add the line: > > package_dir = { > '': 'src' > }, > OK so what packages get built with this scheme? reportlab is a package, but rl_addons is just a folder containing sources for two extensions. Surely I have to refer to those codes in the same way as before. > Maybe reportlab/fonts/ and reportlab/tools/ should also move to the top > directory because they are not an essential part of reportlab toolkit. > >> - docs/ - code for userguide etc, moved up out of the Python package >> - tests/ - ditto > > You might add: > > test_suite = "tests", > > to setup.py then, so the tests may be executed easily like this: > > $ python setup.py test > what actually gets executed when this happens? There is presumably some standard entry point, but looking in the 2.5 "Distributing Python Modules" stuff I can't see the word test anywhere in the index. ...... > I think this is a good idea to cleanup a bit. > Another thing which came up in my preliminary testing of this scheme is that we need to refer to files which are either in the docs folder or the tests folder. Previously we did this by assuming that the container was a package that could be imported. Now if tests/docs etc are not packages I need to have some more utilities to locate my files. What's the correct way to do that? I know that normally people will cd into tests to do python runAll.py, but nothing prevents them from doing stuff like python verylongpath/tests/runAll.py so presumably I need to obtain my script path and ensure it(or its parent) is on the path so I can locate my modules etc etc. -- Robin Becker From dirk.holtwick at gmail.com Mon Sep 1 12:34:35 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Mon, 01 Sep 2008 18:34:35 +0200 Subject: [reportlab-users] More 2.2 questions - package rearrangement In-Reply-To: <956003ae0809010917i7a8cbd2am22d2dcf324023ba0@mail.gmail.com> References: <956003ae0809010834j6d630827tb4789c766a173342@mail.gmail.com> <48BC0F35.9@gmail.com> <956003ae0809010917i7a8cbd2am22d2dcf324023ba0@mail.gmail.com> Message-ID: <48BC199B.9040400@gmail.com> Andy Robinson schrieb: > Not sure about reportlab/fonts. If people want it to work "out of the box" > with the bitmap graphics then we must include a specific set of base fonts > where the code can always find them. If people unzip to a temporary > directory and > run 'setup.py install', they want a library that "just works" - this includes > making a chart, adding some text and saving it to a .png. But as you mentioned before these are features of a somewhat "extended" reportlab version that also needs PIL and renderPM I suppose? Are they really needed there or are they just needed by the tests and demos? If the fonts are not essential to the toolkit I would vote for putting them somewhere else... A practical example is Google App Engine: they just allow 1000 files to be uploaded. Okay, this will change some day and it can be worked around easily, but for most users it will be difficult to find out which files are really needed by reportlab and which are not. Maybe the best would be to put them not in the reportlab directory and give a warning (and a hint where to find them) if the files are needed but missing ;) Dirk From gherman at darwin.in-berlin.de Mon Sep 1 12:36:41 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 1 Sep 2008 18:36:41 +0200 Subject: [reportlab-users] More 2.2 questions - package rearrangement In-Reply-To: <48BC18A3.30609@chamonix.reportlab.co.uk> References: <956003ae0809010834j6d630827tb4789c766a173342@mail.gmail.com> <48BC0F35.9@gmail.com> <48BC18A3.30609@chamonix.reportlab.co.uk> Message-ID: Robin Becker: >> You might add: >> test_suite = "tests", >> to setup.py then, so the tests may be executed easily like this: >> $ python setup.py test > what actually gets executed when this happens? There is presumably > some standard entry point, but looking in the 2.5 "Distributing > Python Modules" stuff I can't see the word test anywhere in the index. Sine I was also missing a "test" command for setuptools I'm faking this kind of thing like this (in setup.py): # test before building/installing setupCommand = sys.argv[-1] if setupCommand == "test": print "running test suite" cmd = "cd src; %s test_mygreatapp.py" % sys.executable os.system(cmd) sys.exit() Dinu From dirk.holtwick at gmail.com Mon Sep 1 12:45:35 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Mon, 01 Sep 2008 18:45:35 +0200 Subject: [reportlab-users] More 2.2 questions - package rearrangement In-Reply-To: <48BC18A3.30609@chamonix.reportlab.co.uk> References: <956003ae0809010834j6d630827tb4789c766a173342@mail.gmail.com> <48BC0F35.9@gmail.com> <48BC18A3.30609@chamonix.reportlab.co.uk> Message-ID: <48BC1C2F.7030207@gmail.com> Robin Becker schrieb: > OK so what packages get built with this scheme? reportlab is a package, > but rl_addons is just a folder containing sources for two extensions. > Surely I have to refer to those codes in the same way as before. A package usually resides in its own namespace. If import will be done like this: import reportlab import rl_addons These are two packages. In setup.py they get defined more or less like this: packages = [ "reportlab", "rl_addons", ], More on setuptools here: > what actually gets executed when this happens? There is presumably some > standard entry point, but looking in the 2.5 "Distributing Python > Modules" stuff I can't see the word test anywhere in the index. Get more informations from here: > Another thing which came up in my preliminary testing of this scheme is > that we need to refer to files which are either in the docs folder or > the tests folder. Previously we did this by assuming that the container > was a package that could be imported. Now if tests/docs etc are not > packages I need to have some more utilities to locate my files. What's > the correct way to do that? I know that normally people will cd into > tests to do python runAll.py, but nothing prevents them from doing stuff > like python verylongpath/tests/runAll.py so presumably I need to obtain > my script path and ensure it(or its parent) is on the path so I can > locate my modules etc etc. You can assume that the directory structure will be as defined before: src/ test/ fonts/ ;) So you may find the parent directory from runAll.py like this: import os.path parent = os.path.join(os.path.dirname(__file__), os.pardir) A developer should also register his working version on his machine like this: $ python setup.py develop This makes programmers live a lot easier ;) Dirk From robin at reportlab.com Mon Sep 1 13:33:15 2008 From: robin at reportlab.com (Robin Becker) Date: Mon, 01 Sep 2008 18:33:15 +0100 Subject: [reportlab-users] Adding charSpace as a paragraph style attribute In-Reply-To: <93BD2C3DED1747AC8165EBA6C085C1A9@max> References: <93BD2C3DED1747AC8165EBA6C085C1A9@max> Message-ID: <48BC275B.6040007@chamonix.reportlab.co.uk> Henning von Bargen wrote: > Looking at Paul's patch submitted here a few days ago, > I don't see how and where the different charSpace value > contributes to the string width calculations. > So wouldn't a large charSpace value result in wrong line-breaking? > > Thinking about it, modifying the charSpace in a paragraph might be an > excellent way to improve the quality of justified paragraphs... > It could probably done automatically inside the _justifyDrawParaLine > and _justifyDrawParaLineX functions of paragraph.py. > > Henning ...... you are right, I've been pondering whether charSpace can get in with the upcoming release. There are two things that affect this one is charSpace and the other is the space adjustment itself. I'm not sure if they are independent so I need to do some simple testing to see if we can just scale all stringWidths or if we need something more complex. -- Robin Becker From andy at reportlab.com Mon Sep 1 15:41:44 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 1 Sep 2008 20:41:44 +0100 Subject: [reportlab-users] More 2.2 questions - package rearrangement In-Reply-To: <48BC1C2F.7030207@gmail.com> References: <956003ae0809010834j6d630827tb4789c766a173342@mail.gmail.com> <48BC0F35.9@gmail.com> <48BC18A3.30609@chamonix.reportlab.co.uk> <48BC1C2F.7030207@gmail.com> Message-ID: <956003ae0809011241h996f18ch2bb0d7204e2cad7e@mail.gmail.com> 2008/9/1 Dirk Holtwick : > More on setuptools here: > Aha. We're talking at cross purposes. Since lunchtime Robin and I have been talking about making a distutils-based package, and you're assuming a setuptools-based one. (I spent half of today figuring out what had messed up my site-packages after "easy-installing" something which installed separate versions of reportlab, PIL, and a load of zope packages it didn't even need, without asking my permission first. -1 for an initial experience! But I concede that setuptools sounds good...) > So you may find the parent directory from runAll.py like this: > > import os.path > parent = os.path.join(os.path.dirname(__file__), os.pardir) I agree with this. The docs, demos and tests can assume "import reportlab" works, because the developer will have either installed it already or will have put 'src' on the path. But if they want to find each other (e.g. a test to verify that the docs will build, or find a logo or something), they should just backtrack up the directory tree rather than looking 'relative to the package'. FYI no one will EVER execute "import rl_addons". That is a physical directory containing the C extension source code, which (when built and installled) will result in two extensions "_renderPM" and "_rl_accel" being available on the path. It would not be there in a build Windows distro, for example. We have a separate directory in version control because people didn't like having a ton of C source mixed in with the Python code. Sounds like we are getting there on the layout. - Andy From srichter at cosmos.phy.tufts.edu Tue Sep 2 01:39:55 2008 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Mon, 1 Sep 2008 22:39:55 -0700 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> Message-ID: <200809012239.55586.srichter@cosmos.phy.tufts.edu> On Monday 01 September 2008, Andy Robinson wrote: > Q1. How badly do people want setuptools, eggs, easy_install and so on? > Is plain old distutils good enough? Very bad. In our big Zope 3 packages test suite, I have to deactivate z3c.rml tests, because of a lack of a proper ReportLab package. > > Q2. Should we try to do "batteries included", with the accelerator, > optional C libraries for rendering bitmaps and the type 1 fonts > included in the basic package and one setup script to build it all? setuptools supports extra-includes, where you can specify additional dependencies on extended functionality. Regards, Stephan -- Stephan Richter Web Software Design, Development and Training Google me. "Zope Stephan Richter" From andy at reportlab.com Tue Sep 2 03:45:51 2008 From: andy at reportlab.com (Andy Robinson) Date: Tue, 2 Sep 2008 08:45:51 +0100 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <200809012239.55586.srichter@cosmos.phy.tufts.edu> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> <200809012239.55586.srichter@cosmos.phy.tufts.edu> Message-ID: <956003ae0809020045i3b74586bq83df83c4d2321f58@mail.gmail.com> 2008/9/2 Stephan Richter : > On Monday 01 September 2008, Andy Robinson wrote: >> Q1. How badly do people want setuptools, eggs, easy_install and so on? >> Is plain old distutils good enough? > > Very bad. In our big Zope 3 packages test suite, I have to deactivate z3c.rml > tests, because of a lack of a proper ReportLab package. Is setuptools now a "de facto standard" in the Zope 3 world? >> Q2. Should we try to do "batteries included", with the accelerator, >> optional C libraries for rendering bitmaps and the type 1 fonts >> included in the basic package and one setup script to build it all? > > setuptools supports extra-includes, where you can specify additional > dependencies on extended functionality. OK, I see that, but it's not the important question. What matters most now is how many people actually want a package without the C extensions. I suspect this will be a small number (doing Jython, AppEngine, Obscurix-1982-with-dodgy-C-compilers etc) and we can probably handle them with a short paragraph on the web site and readme saying "it's OK to delete the following...." - or a separate "python-only" distro if enough ask for it. -- Andy From srichter at cosmos.phy.tufts.edu Tue Sep 2 10:42:39 2008 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Tue, 2 Sep 2008 07:42:39 -0700 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <956003ae0809020045i3b74586bq83df83c4d2321f58@mail.gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> <200809012239.55586.srichter@cosmos.phy.tufts.edu> <956003ae0809020045i3b74586bq83df83c4d2321f58@mail.gmail.com> Message-ID: <200809020742.39904.srichter@cosmos.phy.tufts.edu> On Tuesday 02 September 2008, Andy Robinson wrote: > 2008/9/2 Stephan Richter : > > On Monday 01 September 2008, Andy Robinson wrote: > >> Q1. How badly do people want setuptools, eggs, easy_install and so on? > >> Is plain old distutils good enough? > > > > Very bad. In our big Zope 3 packages test suite, I have to deactivate > > z3c.rml tests, because of a lack of a proper ReportLab package. > > Is setuptools now a "de facto standard" in the Zope 3 world? Yeah. We use it and eggs on PyPI exclusively. This is probably the reson the Zope project produces about 25% of all packages in PyPI. (Though for backwards-compatibility we still produce a large tar ball.) See here for some example: http://svn.zope.org/z3c.rml/trunk/setup.py?view=auto There are also several other examples in the Zope repository that compile C-extensions. > >> Q2. Should we try to do "batteries included", with the accelerator, > >> optional C libraries for rendering bitmaps and the type 1 fonts > >> included in the basic package and one setup script to build it all? > > > > setuptools supports extra-includes, where you can specify additional > > dependencies on extended functionality. > > OK, I see that, but it's not the important question. ?What matters most > now is how many people actually want a package without the C extensions. > I suspect this will be a small number (doing Jython, AppEngine, > Obscurix-1982-with-dodgy-C-compilers etc) and > we can probably handle them with a short paragraph on the web site > and readme saying "it's OK to delete the following...." - or a separate > "python-only" distro if enough ask for it. Oh, I see. Fools. :-) I prefer the C extensions of course. Regards, Stephan -- Stephan Richter Web Software Design, Development and Training Google me. "Zope Stephan Richter" From doko at ubuntu.com Tue Sep 2 14:23:05 2008 From: doko at ubuntu.com (Matthias Klose) Date: Tue, 02 Sep 2008 20:23:05 +0200 Subject: [reportlab-users] More 2.2 questions - package rearrangement In-Reply-To: <956003ae0809010834j6d630827tb4789c766a173342@mail.gmail.com> References: <956003ae0809010834j6d630827tb4789c766a173342@mail.gmail.com> Message-ID: <48BD8489.2020702@ubuntu.com> some maybe unrelated comments: The most important thing for people packaging reportlab for a (Linux) distribution is the possibility to actually be able to distribute it. This was already mentioned for the 1.x releases and again for the 2.0 release, even patches were sent to the ML, but silently ignored. I think even a statement that the reportlab project does not want to address these issues would be more honest than this non-comment. The stuff which hinders unmodifed distribution are: - inclusion of non-free fonts, which is not necessary, and these can be replaced by free fonts as well (or maybe add configuration options to use fonts which are available on the system). - the use of a copyrighted example text (the translation of the Homer text is copyrighted, and you are not allowed to change it, one criterium to be able to distribute it as part of free software). It should be easy to find a non-problematic text. The other proposed changes, including the inclusion of the addons extension into the main source is welcome. It would be nice if reportlab can be installed using pure distutils, and doesn't rely on setuptools. Thanks, Matthias (packaging for Ubuntu and Debian) Andy Robinson schrieb: > I would like peoples' opinions on a package rearrangement. This > should make it a bit easier to build standard distutils outputs and be > more in line with what other, younger Python packages do. > > When we first started in 2000, the top-level directory in our CVS rep > WAS the 'reportlab' package, and we added all our docs, tests and > demos underneath it. This also made distutils harder to use, as the > setup.py was under 'reportlab' rather than above it, which used to > confuse distutils. Now we're in SVN, it's easy to rearrange things a > little. The suggestion is that the >=2.2 source, when checked out or > downloaded as a .tar.gz, might contain the more conventional layout > like this.... > > > - README, CHANGES etc > - setup.py > - reportlab/ - the pure python package > - reportlab/fonts/ - has more fonts added > > - rl_addons/ - contains all C source code > rl_accel/ > renderPM/ > > - docs/ - code for userguide etc, moved up out of the Python package > - tests/ - ditto > - demos/ - ditto > > Setup.py can be written in such a way that it would build and install > the extensions if it could; but if not, it would print a message then > continue, just installing the pure python code. So a "mininal" > Python-only distro is achieved by leaving out the rl_addons directory. > > --- > > Does this change look worthwhile? Would it help anyone or hinder > anyone, or are people indifferent? > > > Best Regards, > From doko at ubuntu.com Tue Sep 2 14:31:29 2008 From: doko at ubuntu.com (Matthias Klose) Date: Tue, 02 Sep 2008 20:31:29 +0200 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> Message-ID: <48BD8681.4060503@ubuntu.com> Andy Robinson schrieb: > Q2. Should we try to do "batteries included", with the accelerator, > optional C libraries for rendering bitmaps and the type 1 fonts > included in the basic package and one setup script to build it all? please don't make it harder for (Linux) distributors to only build and install reportlab. if these things are included and installed unconditionally, please provide options to use the stuff installed on the system instead. Matthias From andy at reportlab.com Tue Sep 2 17:48:30 2008 From: andy at reportlab.com (Andy Robinson) Date: Tue, 2 Sep 2008 22:48:30 +0100 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <48BD8681.4060503@ubuntu.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> <48BD8681.4060503@ubuntu.com> Message-ID: <956003ae0809021448y730901d8obfb5f14210d61181@mail.gmail.com> 2008/9/2 Matthias Klose : > Andy Robinson schrieb: >> Q2. Should we try to do "batteries included", with the accelerator, >> optional C libraries for rendering bitmaps and the type 1 fonts >> included in the basic package and one setup script to build it all? > > please don't make it harder for (Linux) distributors to only build and install > reportlab. if these things are included and installed unconditionally, please > provide options to use the stuff installed on the system instead. > Which specific things are you talking about? What would make it harder? We have 2 C extensions which add substantial performance in one case, and substantial functionality in another. I'm just talking about having them included by default, rather than making people follow extra instructions to compile them. I presume that if distutils builds it all out of the box on Ubuntu 8.04 (which several of us now use), and we handle the fonts and sample text issue in your other email, we're OK? In any event we should be able to provide a preview distro for comment in a couple of days. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. 165 The Broadway, Wimbledon, London SW19 1NE, UK Tel +44-20-8544-8049 From doko at ubuntu.com Tue Sep 2 19:26:43 2008 From: doko at ubuntu.com (Matthias Klose) Date: Wed, 03 Sep 2008 01:26:43 +0200 Subject: [reportlab-users] ReportLab 2.2 deployment options In-Reply-To: <956003ae0809021448y730901d8obfb5f14210d61181@mail.gmail.com> References: <956003ae0809010417u2d16eddh550bb9df29e2ad98@mail.gmail.com> <48BD8681.4060503@ubuntu.com> <956003ae0809021448y730901d8obfb5f14210d61181@mail.gmail.com> Message-ID: <48BDCBB3.1060506@ubuntu.com> Andy Robinson schrieb: > 2008/9/2 Matthias Klose : >> Andy Robinson schrieb: >>> Q2. Should we try to do "batteries included", with the accelerator, >>> optional C libraries for rendering bitmaps and the type 1 fonts >>> included in the basic package and one setup script to build it all? >> please don't make it harder for (Linux) distributors to only build and install >> reportlab. if these things are included and installed unconditionally, please >> provide options to use the stuff installed on the system instead. >> > > Which specific things are you talking about? What would make it harder? it would be harder to evaluate each upstream source release, if it is distributable or not. we had some private communicatations about this. currently it is difficult to get official information on the license for specific files. > We have 2 C extensions which add substantial performance in one case, > and substantial functionality in another. I'm just talking about having them > included by default, rather than making people follow extra instructions to > compile them. this sounds ok. as a distributor I am able to specify build dependencies which are required for the build. anything which allows me to configure this works fine with me. > I presume that if distutils builds it all out of the box on Ubuntu 8.04 (which > several of us now use), and we handle the fonts > and sample text issue in your other email, we're OK? I would appreciate it very much if you can address these other issues. I'm happy to test any release candidate. Matthias From andy at reportlab.com Tue Sep 2 19:29:53 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 3 Sep 2008 00:29:53 +0100 Subject: [reportlab-users] 2.2 - Debian-friendly sample text and fonts Message-ID: <956003ae0809021629w695e4d8bj9e8c1628b077131c@mail.gmail.com> 2008/9/2 Matthias Klose : > some maybe unrelated comments: I changed the subject line as this really is a different subject. > The most important thing for people packaging reportlab for a (Linux) > distribution is the possibility to actually be able to distribute it. This was > already mentioned for the 1.x releases and again for the 2.0 release, even > patches were sent to the ML, but silently ignored. I think even a statement that > the reportlab project does not want to address these issues would be more honest > than this non-comment. Failure to comment on mailing lists is not usually dishonesty, it's just being busy or having higher priorities. You're right though, we really didn't want to spend time changing our code to satisfy concerns that seem extremely, er, theoretical and unrelated to any engineering issue. > The stuff which hinders unmodifed distribution are: > - inclusion of non-free fonts > - the use of a copyrighted example text I remember a brief discussion 5 years ago on the fonts, but no mention of Homer: http://two.pairlist.net/pipermail/reportlab-users/2003-May/001639.html To be honest we are always short of time and staff might well have ignored things which did not involve any actual bug or feature and would have needed a few hours work to implement. Lots of people in open source would rather spend their limited time on useful functionality rather than theorizing about license issues. Nevertheless, Ubuntu is now so huge (I'm typing on it right now) that I do regard being compatible as an "engineering issue". We would be willing to make these changes if it makes your life easier. I am just not sure if we can do it in time, as we have very few man-hours to spare for open source work in the next week and have our hands full with the rearrangement and documenting the changes. It may be that we'd need to do a 2.2.1 or 2.3 a few weeks later. >From a practical viewpoint, we need to include a set of "reasonably standard" font files to allow our tests and demos to run identically and out of the box on Windows, Mac OS and Linux; as well as a couple of "obviously weird fonts". It looks like either Bitstream Vera or Liberation will work for the former need; neither was available last time we looked at this. Do they both meet your approval? For the "obviously weird" category, I'll look around. We will then need to do some work on font aliasing mechanisms. As for the sample text (and tonight is the first time I heard of this issue), I just did some homework: the statement at the bottom of our odyssey text file is actually a copyright statement for the Internet Classics Archive at MIT, whence that text file came. But the actual translation by Butler seems to be in the public domain, according to www.gutenberg.org. Does this mean I can just delete the misleading copyright statement and put in a note saying that it's in the public domain? BTW, Gutenberg usually says "Not copyrighted in the United States. If you live elsewhere check the laws of your country before downloading this ebook." Is this good enough or do we need to find an explicitly "open source" sample text? If so, what would you recommend? I don't want any GPL'd fonts or texts sneakily infecting our BSD-licensed code ;-) > The other proposed changes, including the inclusion of the addons extension into > the main source is welcome. It would be nice if reportlab can be installed using > pure distutils, and doesn't rely on setuptools. Our thinking right now is distutils this time, then maybe to add an optional setuptools script or setuptools-based packaging of the same code a bit later. Primarily as we just don't have time to learn all the issues with setuptools. Does setuptools actually make things harder for you? - Andy From alet at librelogiciel.com Tue Sep 2 19:42:33 2008 From: alet at librelogiciel.com (alet at librelogiciel.com) Date: Wed, 3 Sep 2008 01:42:33 +0200 Subject: [reportlab-users] 2.2 - Debian-friendly sample text and fonts In-Reply-To: <956003ae0809021629w695e4d8bj9e8c1628b077131c@mail.gmail.com> References: <956003ae0809021629w695e4d8bj9e8c1628b077131c@mail.gmail.com> Message-ID: <20080902234232.GB24357@vazy.pykota.com> On Wed, Sep 03, 2008 at 12:29:53AM +0100, Andy Robinson wrote: > As for the sample text (and tonight is the first time I heard of this > issue), I just did some homework: the statement at the bottom of our > odyssey text file is actually a copyright statement for the Internet > Classics Archive at MIT, whence that text file came. But the actual > translation by Butler seems to be in the public domain, according to > www.gutenberg.org. Does this mean I can just delete the misleading > copyright statement and put in a note saying that it's in the public > domain? You could also remove the translation and only include the original Greek text by Homer. Since when The Poet was alive Disney wasn't there to buy stupid laws, chances are that Homer's relatives or his original editor (was oral anyway IIRC) won't mind much and probably won't sue you ! ;-) Jerome Alet From andy at reportlab.com Tue Sep 2 19:56:17 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 3 Sep 2008 00:56:17 +0100 Subject: [reportlab-users] 2.2 - Debian-friendly sample text and fonts In-Reply-To: <20080902234232.GB24357@vazy.pykota.com> References: <956003ae0809021629w695e4d8bj9e8c1628b077131c@mail.gmail.com> <20080902234232.GB24357@vazy.pykota.com> Message-ID: <956003ae0809021656l13fa5a3bg6e1eb47ed5aa6a6f@mail.gmail.com> 2008/9/3 : > You could also remove the translation and only include the original Greek > text by Homer. Since when The Poet was alive Disney wasn't there to buy > stupid laws, chances are that Homer's relatives or his original editor (was > oral anyway IIRC) won't mind much and probably won't sue you ! Surely by now Disney has persuaded Congress to extend copyright back in time to anything in the chain of causation which gave rise to any of their works? Seriously if the issue is "who will sue ReportLab?", we've always been fine. You, however, might be exposed to an enraged Dutch typographer with BDFL backup, if you inadvertently chose to distort some glyphs of one of his fonts in your homework-inkblot examples ;-) If the issue is "does it meet Debian's concerns?", frankly we just have to let Matthias and co. tell us what's needed. As long as I don't have to personally reason with Richard Stallman... - Andy From andy at reportlab.com Tue Sep 2 20:00:47 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 3 Sep 2008 01:00:47 +0100 Subject: [reportlab-users] 2.2 - distutils versus setuptools Message-ID: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> We decided today that we'll concentrate our own efforts this week and next on an initial 2.2 candidate with plain old distutils. The package rearrangement is pretty much as Dirk suggested, with an explicit src/ subdirectory, and all demos/tests/docs separate to this. I have no problem with subsequently making up a setuptools-based distribution, or adding an alternate "setuptools-setup.py" script in the package if that's workable. We could probably do this a week or two later. But we'd have to rely on a few egg-lovers to get that script right. - Andy From andy at reportlab.com Wed Sep 3 02:44:52 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 3 Sep 2008 07:44:52 +0100 Subject: [reportlab-users] Implementation of drawImage anchoring In-Reply-To: <00b101c90483$6d074670$0502000a@ad.altalang.com> References: <00b101c90483$6d074670$0502000a@ad.altalang.com> Message-ID: <956003ae0809022344v2699b119gd9fe9d224e7e15c@mail.gmail.com> 2008/8/22 Yoann Roman : > I've been reading (and re-reading) the doc for drawImage in Canvas, and I'm > pretty sure the implementation doesn't match what's described. To quote: > Yoann, I wasn't following this last week, but I have just read this thread and I think you (and the docs) are right and our implementation is wrong. This started out as a feature to align a VECTOR image within a box, using our commercial PageCatcher library. Within RML, it was very convenient to be able to say "draw 'logo.pdf' in a box on the page". We therefore tried to add the corresponding extra arguments to our bitmap, open-source drawImage code, but got it wrong and never eyeballed the results. I attach the docstring from rlextra.pagecatcher.pagecatcher.drawPdfImage: def drawPdfImage(fileName, canv, x=0, y=0, width=None, height=None, preserveAspectRatio=False, pageNumber=0, showBoundary=False,anchor='sw', boxType='MediaBox'): """Like a PDF version of canvas.drawImage...used by RML2PDF. This is designed to make it easy to place EPS artwork by distilling to PDF. - it will use the PDF file's MediaBox to determine the 'image' size, unless you explicitly request a different box such as the ArtBox in the boxType parameter (drawings made in Illustrator may use this) - if x and y are not set, it presumes 0 - if width and height are given, it will stretch and squeeze the image to fit in the given rectangle. - if width and height are NOT given, it will take the natural size as defined by the media box (or other box) of the PDF file - if width and height are given and preserveAspectRatio is set, it will shrink/grow the image to fit centered inside the defined box. Note that it can only look at the bounding box of the EPS file and has no idea of the visual shape of whatever logos or designs that might contain! - showBoundary will draw a small line around the image box to help in seeing what's going on. """ We will try to fix this and add a test case in the open source distro. - Andy From gherman at darwin.in-berlin.de Wed Sep 3 04:16:27 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed, 3 Sep 2008 10:16:27 +0200 Subject: [reportlab-users] Fixing bugs in RL 2.2 Message-ID: <131909DD-4E44-49CE-8237-B66A49449F63@darwin.in-berlin.de> Hi, I'm excited to read about the plans for releasing RL 2.2. I wonder, though, which of the bugs reported on this list over the last 15+ months can the RL community expect to be fixed in a future 2.2 re- lease? I'm only reminding everybody here of Henning's patch for the paragraph class which makes proper hyphenation much easier. I do not have a comprehensive list of such bugs, of course, but I do hope RL can use some filtering technology to extract them from this mailing list. Regards, Dinu From dirk.holtwick at gmail.com Wed Sep 3 04:29:11 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Wed, 03 Sep 2008 10:29:11 +0200 Subject: [reportlab-users] Fixing bugs in RL 2.2 In-Reply-To: <131909DD-4E44-49CE-8237-B66A49449F63@darwin.in-berlin.de> References: <131909DD-4E44-49CE-8237-B66A49449F63@darwin.in-berlin.de> Message-ID: <48BE4AD7.70503@gmail.com> Hi, I would like to suggest an approach to make contributing to ReportLab easier: Why don't you put ReportLab Toolkit to Google Code or something similar. The maintenance of projects there is very simple. The direct benefits would be: - Issue tracking (!) - Wiki for developer centric informations - Very responsive Subversion Repository - Easy way for contributions of external developers - No more annoying server administration for ReportLab ;) I think this would also bring some relief to Reportlab and it's commercial work if external open source developers contribute their manpower ;) If you need help on how to set up such a site, please let me know. Dirk Dinu Gherman schrieb: > Hi, > > I'm excited to read about the plans for releasing RL 2.2. I wonder, > though, which of the bugs reported on this list over the last 15+ > months can the RL community expect to be fixed in a future 2.2 re- > lease? I'm only reminding everybody here of Henning's patch for the > paragraph class which makes proper hyphenation much easier. > > I do not have a comprehensive list of such bugs, of course, but I do > hope RL can use some filtering technology to extract them from this > mailing list. > > Regards, > > Dinu > > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From andy at reportlab.com Wed Sep 3 04:32:57 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 3 Sep 2008 09:32:57 +0100 Subject: [reportlab-users] Fixing bugs in RL 2.2 In-Reply-To: <131909DD-4E44-49CE-8237-B66A49449F63@darwin.in-berlin.de> References: <131909DD-4E44-49CE-8237-B66A49449F63@darwin.in-berlin.de> Message-ID: <956003ae0809030132o14a7f28byced0bb39136825ec@mail.gmail.com> 2008/9/3 Dinu Gherman : > Hi, > > I'm excited to read about the plans for releasing RL 2.2. I wonder, > though, which of the bugs reported on this list over the last 15+ > months can the RL community expect to be fixed in a future 2.2 re- > lease? I'm only reminding everybody here of Henning's patch for the > paragraph class which makes proper hyphenation much easier. Robin, any idea if we tackled that one? (The practical problem is of course seeing if it conflicts with any other paragraph features people on the user group might not have tested, and it's hard to create a comprehensive test suite for this as eyeballs are needed). > I do not have a comprehensive list of such bugs, of course, but I do > hope RL can use some filtering technology to extract them from this > mailing list. We have been through the list and the commits and have a draft changelist internally. I am hoping to put it up on a - hold your breath, Dinu, this is the big moment - Wiki(!) around this weekend, so anyone on this list can remind us of things we've missed. - Andy From wilk at flibuste.net Wed Sep 3 04:38:27 2008 From: wilk at flibuste.net (William Dode) Date: Wed, 3 Sep 2008 08:38:27 +0000 (UTC) Subject: [reportlab-users] Fixing bugs in RL 2.2 References: <131909DD-4E44-49CE-8237-B66A49449F63@darwin.in-berlin.de> <48BE4AD7.70503@gmail.com> Message-ID: On 03-09-2008, Dirk Holtwick wrote: > Hi, > > I would like to suggest an approach to make contributing to ReportLab > easier: Why don't you put ReportLab Toolkit to Google Code > or something similar. The maintenance > of projects there is very simple. The direct benefits would be: > > - Issue tracking (!) +++ ! -- William Dod? - http://flibuste.net Informaticien Ind?pendant From robin at reportlab.com Wed Sep 3 05:20:02 2008 From: robin at reportlab.com (Robin Becker) Date: Wed, 03 Sep 2008 10:20:02 +0100 Subject: [reportlab-users] Fixing bugs in RL 2.2 In-Reply-To: <956003ae0809030132o14a7f28byced0bb39136825ec@mail.gmail.com> References: <131909DD-4E44-49CE-8237-B66A49449F63@darwin.in-berlin.de> <956003ae0809030132o14a7f28byced0bb39136825ec@mail.gmail.com> Message-ID: <48BE56C2.8060200@chamonix.reportlab.co.uk> Andy Robinson wrote: > 2008/9/3 Dinu Gherman : >> Hi, >> >> I'm excited to read about the plans for releasing RL 2.2. I wonder, >> though, which of the bugs reported on this list over the last 15+ >> months can the RL community expect to be fixed in a future 2.2 re- >> lease? I'm only reminding everybody here of Henning's patch for the >> paragraph class which makes proper hyphenation much easier. > I think the last time we looked at this it foundered on some licensing issue. I believe Henning's stuff is GPL. > Robin, any idea if we tackled that one? (The practical problem is > of course seeing if it conflicts with any other paragraph features > people on the user group might not have tested, and it's hard > to create a comprehensive test suite for this as eyeballs are needed). -- Robin Becker From ralf at brainbot.com Wed Sep 3 06:37:14 2008 From: ralf at brainbot.com (Ralf Schmitt) Date: Wed, 03 Sep 2008 12:37:14 +0200 Subject: [reportlab-users] 2.2 - distutils versus setuptools In-Reply-To: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> References: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> Message-ID: <48BE68DA.2000603@brainbot.com> Andy Robinson wrote: > We decided today that we'll concentrate our own efforts this week and > next on an initial 2.2 candidate with plain old distutils. The > package rearrangement is pretty much as Dirk suggested, with an > explicit src/ subdirectory, and all demos/tests/docs separate to this. > > I have no problem with subsequently making up a setuptools-based > distribution, or adding an alternate "setuptools-setup.py" script in > the package if that's workable. We could probably do this a week or > two later. But we'd have to rely on a few egg-lovers to get that > script right. > Have a look at: http://code.pediapress.com/hg/mwlib.ext/file/591826c10e77/setup.py We packaged reportlab and the _rl_accel module as an "external dependency" for the mwlib library under the name mwlib.ext. The complete repo can be found here: http://code.pediapress.com/hg/mwlib.ext/ - Ralf From gherman at darwin.in-berlin.de Wed Sep 3 06:59:21 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed, 3 Sep 2008 12:59:21 +0200 Subject: [reportlab-users] Fixing bugs in RL 2.2 In-Reply-To: <48BE56C2.8060200@chamonix.reportlab.co.uk> References: <131909DD-4E44-49CE-8237-B66A49449F63@darwin.in-berlin.de> <956003ae0809030132o14a7f28byced0bb39136825ec@mail.gmail.com> <48BE56C2.8060200@chamonix.reportlab.co.uk> Message-ID: <7C1FC5A8-223F-4500-883C-A34D50248E43@darwin.in-berlin.de> Robin Becker : > Andy Robinson wrote: >> 2008/9/3 Dinu Gherman : >>> I'm only reminding everybody here of Henning's patch for the >>> >>> paragraph class which makes proper hyphenation much easier. > > I think the last time we looked at this it foundered on some > licensing issue. I believe Henning's stuff is GPL. Robin, would you mind explaining the problem you see with that? (And also, citing only the relevant text bits, which makes reading and replying to emails on mobile devices a lot easier.) Thanks, Dinu From robin at reportlab.com Wed Sep 3 07:51:50 2008 From: robin at reportlab.com (Robin Becker) Date: Wed, 03 Sep 2008 12:51:50 +0100 Subject: [reportlab-users] Fixing bugs in RL 2.2 In-Reply-To: <7C1FC5A8-223F-4500-883C-A34D50248E43@darwin.in-berlin.de> References: <131909DD-4E44-49CE-8237-B66A49449F63@darwin.in-berlin.de> <956003ae0809030132o14a7f28byced0bb39136825ec@mail.gmail.com> <48BE56C2.8060200@chamonix.reportlab.co.uk> <7C1FC5A8-223F-4500-883C-A34D50248E43@darwin.in-berlin.de> Message-ID: <48BE7A56.3010908@chamonix.reportlab.co.uk> Dinu Gherman wrote: > Robin Becker : > >> Andy Robinson wrote: >>> 2008/9/3 Dinu Gherman : >>>> I'm only reminding everybody here of Henning's patch for the >>>> >>>> paragraph class which makes proper hyphenation much easier. >> >> I think the last time we looked at this it foundered on some licensing >> issue. I believe Henning's stuff is GPL. > > Robin, would you mind explaining the problem you see with that? (And > also, citing only the relevant text bits, which makes reading and > replying to emails on mobile devices a lot easier.) > > Thanks, > > Dinu ...... ReportLab is BSD so I don't think we can use his code unless we can agree on the more liberal license. -- Robin Becker From andy at reportlab.com Wed Sep 3 08:20:24 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 3 Sep 2008 13:20:24 +0100 Subject: [reportlab-users] 2.2 - distutils versus setuptools In-Reply-To: <48BE68DA.2000603@brainbot.com> References: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> <48BE68DA.2000603@brainbot.com> Message-ID: <956003ae0809030520v3001f9e0m249cc8d37c79d332@mail.gmail.com> 2008/9/3 Ralf Schmitt : > Andy Robinson wrote: >> >> I have no problem with subsequently making up a setuptools-based >> distribution, or adding an alternate "setuptools-setup.py" script in >> the package if that's workable. We could probably do this a week or >> two later. > Have a look at: > > http://code.pediapress.com/hg/mwlib.ext/file/591826c10e77/setup.py > Thanks, Ralf. But we are going to start with a distutils script first, as many people have indicated their active dislike for setuptools. It occurs to me that it would be trivial to have two scripts in SVN: setup_distutils.py setup_setuptools.py We can then either make a package like that, if it would work; or if setuptools really needs to be called 'setup.py', then build one tar.gz file of each kind and register the setuptools one on PyPI. Any 'repackagers' could just pick the one they liked best. - Andy From andy at reportlab.com Wed Sep 3 08:49:11 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 3 Sep 2008 13:49:11 +0100 Subject: [reportlab-users] Fixing bugs in RL 2.2 In-Reply-To: <7C1FC5A8-223F-4500-883C-A34D50248E43@darwin.in-berlin.de> References: <131909DD-4E44-49CE-8237-B66A49449F63@darwin.in-berlin.de> <956003ae0809030132o14a7f28byced0bb39136825ec@mail.gmail.com> <48BE56C2.8060200@chamonix.reportlab.co.uk> <7C1FC5A8-223F-4500-883C-A34D50248E43@darwin.in-berlin.de> Message-ID: <956003ae0809030549x105e8a87t38056513225d76bd@mail.gmail.com> 2008/9/3 Dinu Gherman : > Robin, would you mind explaining the problem you see with that? If we add GPL code, won't it infect our more liberal BSD-licensed package? This in turn which would force possibly hundreds of commercial products to stop using our libraries from 2.2. Henning is busy the next 2 days but if he says later on that he is happy to assign this code under our BSD license then it removes the issue. We may not have been clear enough about this in the past, but generally any contributor to an open source project should assign their code to the project and accept that it goes out under that project's license. - Andy From dirk.holtwick at gmail.com Wed Sep 3 09:07:25 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Wed, 03 Sep 2008 15:07:25 +0200 Subject: [reportlab-users] Fixing bugs in RL 2.2 In-Reply-To: <956003ae0809030549x105e8a87t38056513225d76bd@mail.gmail.com> References: <131909DD-4E44-49CE-8237-B66A49449F63@darwin.in-berlin.de> <956003ae0809030132o14a7f28byced0bb39136825ec@mail.gmail.com> <48BE56C2.8060200@chamonix.reportlab.co.uk> <7C1FC5A8-223F-4500-883C-A34D50248E43@darwin.in-berlin.de> <956003ae0809030549x105e8a87t38056513225d76bd@mail.gmail.com> Message-ID: <48BE8C0D.3040207@gmail.com> > We may not have been clear enough about this in the past, > but generally any contributor to an open source project should > assign their code to the project and accept that it goes out > under that project's license. ... or even better the MIT license which is more permissive. See: "Q: Can I always "relicense" BSD licensed-software under a new license?" https://osi.osuosl.org/wiki/help/license Dirk From andy at reportlab.com Wed Sep 3 09:35:49 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 3 Sep 2008 14:35:49 +0100 Subject: [reportlab-users] Fixing bugs in RL 2.2 In-Reply-To: <48BE8C0D.3040207@gmail.com> References: <131909DD-4E44-49CE-8237-B66A49449F63@darwin.in-berlin.de> <956003ae0809030132o14a7f28byced0bb39136825ec@mail.gmail.com> <48BE56C2.8060200@chamonix.reportlab.co.uk> <7C1FC5A8-223F-4500-883C-A34D50248E43@darwin.in-berlin.de> <956003ae0809030549x105e8a87t38056513225d76bd@mail.gmail.com> <48BE8C0D.3040207@gmail.com> Message-ID: <956003ae0809030635o67e5955g5a4e3a59e406c010@mail.gmail.com> 2008/9/3 Dirk Holtwick : > ... or even better the MIT license which is more permissive. When we picked ours, we just took the shortest and least scary one we could find at the time, and we'd possibly have picked MIT had we seen it first. But a change in our license is out of scope for next week ;-) - Andy From andy at reportlab.com Wed Sep 3 15:37:40 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 3 Sep 2008 20:37:40 +0100 Subject: [reportlab-users] First stage of trunk rearrangement committed Message-ID: <956003ae0809031237m61abcd2co1a296dc5f95f2c6c@mail.gmail.com> Hi everyone, Robin has committed the first stage of the repository rearrangement. Anyone who develops on SVN copies should probably not update for a couple of days while we test a bit more. If you are curious, and want to take a look or try the setup script, you can do something like I just did.... [prompt]:~$ cd temp [prompt]:~/temp$ svn co https://www.reportlab.co.uk/svn/public/reportlab/trunk reportlab-root There are some brief notes in the INSTALL.txt. All feedback is welcome. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. 165 The Broadway, Wimbledon, London SW19 1NE, UK Tel +44-20-8544-8049 From mjf at pearson.co.uk Thu Sep 4 07:25:20 2008 From: mjf at pearson.co.uk (Matt Folwell) Date: Thu, 04 Sep 2008 12:25:20 +0100 Subject: [reportlab-users] buglet in Frame.split() Message-ID: <48BFC5A0.2030901@pearson.co.uk> When Frame.split() calls Flowable.split() it doesn't take into account overlapAttachedSpace, so the flowable thinks it has less space available than it should. Patch attached. Matt -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: frame_split.patch Url: From yroman-reportlab at altalang.com Thu Sep 4 09:11:34 2008 From: yroman-reportlab at altalang.com (Yoann Roman) Date: Thu, 4 Sep 2008 09:11:34 -0400 Subject: [reportlab-users] Implementation of drawImage anchoring In-Reply-To: <956003ae0809022344v2699b119gd9fe9d224e7e15c@mail.gmail.com> References: <00b101c90483$6d074670$0502000a@ad.altalang.com> <956003ae0809022344v2699b119gd9fe9d224e7e15c@mail.gmail.com> Message-ID: <001401c90e8f$c15f4bd0$0502000a@ad.altalang.com> Andy Robinson wrote... > 2008/8/22 Yoann Roman : > > I've been reading (and re-reading) the doc for drawImage in Canvas, and > > I'm pretty sure the implementation doesn't match what's described. To > > quote: > > Yoann, I wasn't following this last week, but I have just read this thread > and I think you (and the docs) are right and our implementation is wrong. > > [snip] > > We will try to fix this and add a test case in the open source distro. Should it help, I've attached my boxstuff.py patch to implement the documented behavior. anchorAdjustXY now returns (x, y) unchanged, but I left it as is to avoid patching canvas.py and pdfimages.py, too. I've also attached boxstuff_tests.py, which I used to check my math. It's certainly not exhaustive in the image dimensions it checks against. HTH, -- Yoann Roman -------------- next part -------------- A non-text attachment was scrubbed... Name: boxstuff.diff Type: application/octet-stream Size: 1493 bytes Desc: not available Url : -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: boxstuff_tests.py Url: From robin at reportlab.com Thu Sep 4 09:20:36 2008 From: robin at reportlab.com (Robin Becker) Date: Thu, 04 Sep 2008 14:20:36 +0100 Subject: [reportlab-users] buglet in Frame.split() In-Reply-To: <48BFC5A0.2030901@pearson.co.uk> References: <48BFC5A0.2030901@pearson.co.uk> Message-ID: <48BFE0A4.6030400@chamonix.reportlab.co.uk> Matt Folwell wrote: > When Frame.split() calls Flowable.split() it doesn't take into account > overlapAttachedSpace, so the flowable thinks it has less space available > than it should. Patch attached. > > > Matt ........ Thanks Matt, seems reasonable and didn't cause any blowouts. -- Robin Becker From gherman at darwin.in-berlin.de Thu Sep 4 09:30:24 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Thu, 4 Sep 2008 15:30:24 +0200 Subject: [reportlab-users] 2.2 - distutils versus setuptools In-Reply-To: <956003ae0809030520v3001f9e0m249cc8d37c79d332@mail.gmail.com> References: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> <48BE68DA.2000603@brainbot.com> <956003ae0809030520v3001f9e0m249cc8d37c79d332@mail.gmail.com> Message-ID: Andy Robinson: > Thanks, Ralf. But we are going to start with a distutils script > first, as > many people have indicated their active dislike for setuptools. Have I missed something? I can see only replies in favour of setuptools (counting my own as +1-epislon) and we don't have the vote of Henning, yet. Also, I'm not sure if your answer means going for distutils in 2.2 and setuptools in 2.3 or so or anything else. Maybe you can clearify? Thanks, Dinu From andy at reportlab.com Thu Sep 4 09:59:42 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 4 Sep 2008 14:59:42 +0100 Subject: [reportlab-users] 2.2 - distutils versus setuptools In-Reply-To: References: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> <48BE68DA.2000603@brainbot.com> <956003ae0809030520v3001f9e0m249cc8d37c79d332@mail.gmail.com> Message-ID: <956003ae0809040659w913d977s6c4f59cec9079ed0@mail.gmail.com> 2008/9/4 Dinu Gherman : > Andy Robinson: > >> Thanks, Ralf. But we are going to start with a distutils script first, as >> many people have indicated their active dislike for setuptools. > > Have I missed something? I can see only replies in favour > of setuptools (counting my own as +1-epislon) and we don't > have the vote of Henning, yet. Matthias, the Ubuntu/Debian packager, was in favour of classic distutils (which is a pretty big vote) . So are we within ReportLab. Our own main reasons are that (a) it's the official Python standard at this time, (b) we already have a working script only needing a little rearrangement, and (c) we hate the way setuptools installs and upgrades other packages without prompting you. That doesn't mean "against setuptools" forever, it just means "the distutils package should be available somewhere". > > Also, I'm not sure if your answer means going for distutils > in 2.2 and setuptools in 2.3 or so or anything else. Maybe > you can clearify? Having both kinds of setup script in our repo, ASAP, would be ideal. (I don't yet know if that means making two source packages available, or if we can get away with one package and two explicitly named setup scripts in it.) Our target for 2.2 is 11th or 12th September. The critical features for 2.2 are the package rearrangements, pending bug fixes, and documenting the various changes since 2.1 in a coherent manner. The 'nice to have' features are the font and text licensing changes for Ubuntu, and the setuptools scripts. If these resulted in a 2.3 or 2.2.1 release in late Sep or early Oct, so be it; but we're moving quite fast and it's possible we could deal with those things too with your help. The thing we don't have time for is personally learning all about setuptools in the remaining time. Are there any volunteers willing to "maintain" egg-related matters over the next few weeks? i.e. contribute a script, do some testing, and field any followup requests arising from it? - Andy From dirk.holtwick at gmail.com Thu Sep 4 10:28:35 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Thu, 04 Sep 2008 16:28:35 +0200 Subject: [reportlab-users] 2.2 - distutils versus setuptools In-Reply-To: <956003ae0809040659w913d977s6c4f59cec9079ed0@mail.gmail.com> References: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> <48BE68DA.2000603@brainbot.com> <956003ae0809030520v3001f9e0m249cc8d37c79d332@mail.gmail.com> <956003ae0809040659w913d977s6c4f59cec9079ed0@mail.gmail.com> Message-ID: <48BFF093.50506@gmail.com> Andy Robinson schrieb: > Are there any volunteers willing to "maintain" egg-related matters over > the next few weeks? i.e. contribute a script, do some testing, and field > any followup requests arising from it? My personal opinion is that the recent setup script is by far too complex but I don't know how to make it better ;) As a starting point I added a SetupTools script that just does the basic stuff. It collects all needed data and that's it. You can test it by starting it like this: $ python setup_egg.py sdist -k It will produce a directory containing all collected data. To create EGGs do like this $ python setup_egg.py bdist_egg This way you get a nice EGG placed in "dist". Open it with an unzipper to look inside the EGG. You will see, there are just the essential data included ;) If you type $ python setup_egg.py bdist_egg upload the EGG will be published to PYPI. But this is another lesson ;) As a plus I added a small script setup_version.py that modifies version information of specific files files. The version number is placed in VERSION.txt. (BTW I recommend changing names to upper case for the other files too, like LICENSE.txt etc) Hope this helps. If you need further assistance please let me know. Dirk -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: setup_version.py Url: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: VERSION.txt Url: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ez_setup.py Url: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: setup_egg.py Url: From andy at reportlab.com Thu Sep 4 12:37:57 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 4 Sep 2008 17:37:57 +0100 Subject: [reportlab-users] 2.2 - distutils versus setuptools In-Reply-To: <48BFF093.50506@gmail.com> References: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> <48BE68DA.2000603@brainbot.com> <956003ae0809030520v3001f9e0m249cc8d37c79d332@mail.gmail.com> <956003ae0809040659w913d977s6c4f59cec9079ed0@mail.gmail.com> <48BFF093.50506@gmail.com> Message-ID: <956003ae0809040937q6bca2fe4o7b4a8d6a7d60e41b@mail.gmail.com> 2008/9/4 Dirk Holtwick : [Dirk sends complete set of eggy stuff... ] Thanks very much for these - I'll study these and try to get them in place tomorrow. (I'm in the middle of another deadline tonight). > My personal opinion is that the recent setup script is by far too complex > but I don't know how to make it better ;) I agree. For the record, I think distutils is a monstrosity, which is why we ignored it for so many years; I have never seen a clean non-trivial setup script. > (BTW I recommend changing names to upper case for the other > files too, like LICENSE.txt etc) Done in subversion just now... - Andy From robin at reportlab.com Thu Sep 4 13:16:33 2008 From: robin at reportlab.com (Robin Becker) Date: Thu, 04 Sep 2008 18:16:33 +0100 Subject: [reportlab-users] 2.2 - distutils versus setuptools In-Reply-To: <48BFF093.50506@gmail.com> References: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> <48BE68DA.2000603@brainbot.com> <956003ae0809030520v3001f9e0m249cc8d37c79d332@mail.gmail.com> <956003ae0809040659w913d977s6c4f59cec9079ed0@mail.gmail.com> <48BFF093.50506@gmail.com> Message-ID: <48C017F1.7070401@chamonix.reportlab.co.uk> Dirk Holtwick wrote: > Andy Robinson schrieb: >> Are there any volunteers willing to "maintain" egg-related matters over >> the next few weeks? i.e. contribute a script, do some testing, and field >> any followup requests arising from it? > >....... The main problem with our setup script is that we need to find freetype2. It seems that the proper way to do this requires us to override build_ext.build_extension so that we can get access to the compiler that gets used at build time ie we need to do things inside out as FLundh does for PIL. The unix way then asks the compiler to search for freetype amongst the library dirs that have been set up. The windows way just cannot do that; so we're forced back to using a setup.cfg type mechanism. Have the egg people solved the library search problem? -- Robin Becker From dirk.holtwick at gmail.com Thu Sep 4 13:33:51 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Thu, 04 Sep 2008 19:33:51 +0200 Subject: [reportlab-users] 2.2 - distutils versus setuptools In-Reply-To: <48C017F1.7070401@chamonix.reportlab.co.uk> References: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> <48BE68DA.2000603@brainbot.com> <956003ae0809030520v3001f9e0m249cc8d37c79d332@mail.gmail.com> <956003ae0809040659w913d977s6c4f59cec9079ed0@mail.gmail.com> <48BFF093.50506@gmail.com> <48C017F1.7070401@chamonix.reportlab.co.uk> Message-ID: <48C01BFF.1020706@gmail.com> Robin Becker schrieb: > The main problem with our setup script is that we need to find freetype2. > > It seems that the proper way to do this requires us to override > build_ext.build_extension so that we can get access to the compiler that > gets used at build time ie we need to do things inside out as FLundh > does for PIL. > > The unix way then asks the compiler to search for freetype amongst the > library dirs that have been set up. The windows way just cannot do that; > so we're forced back to using a setup.cfg type mechanism. > > Have the egg people solved the library search problem? I am not so familiar with extension building with setuptools, but if I understand the concept right all eggs are *pre built* for the target operating system. This is one of the big advantages of the egg concept. Normal users on Windows and Mac usually don't have installed any compilers so they are happy to get it all perfectly prepared ;) Maybe you can get inspirations form the setup file of lxml or any other Python project using extensions and egg: http://pypi.python.org/pypi/lxml/0.9 BTW: Can't you bundle freetype with the Reportlab distribution? Dirk From andy at reportlab.com Thu Sep 4 15:26:22 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 4 Sep 2008 20:26:22 +0100 Subject: [reportlab-users] 2.2 - distutils versus setuptools In-Reply-To: <956003ae0809040937q6bca2fe4o7b4a8d6a7d60e41b@mail.gmail.com> References: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> <48BE68DA.2000603@brainbot.com> <956003ae0809030520v3001f9e0m249cc8d37c79d332@mail.gmail.com> <956003ae0809040659w913d977s6c4f59cec9079ed0@mail.gmail.com> <48BFF093.50506@gmail.com> <956003ae0809040937q6bca2fe4o7b4a8d6a7d60e41b@mail.gmail.com> Message-ID: <956003ae0809041226s19a1150eje30e21ef092a34ee@mail.gmail.com> > [Dirk sends complete set of eggy stuff... ] I have committed these scripts now. They seem to work fine but there's a couple more things to fix in the next few days: (a) it doesn't attempt to build the C extensions yet (b) we keep the official "version number" in reportlab/__init__.py (which I just bumped to "2.2pre"). Either the setup info should pull it from there (which is what Django's script does), or the setup_version.py script should modify the copy in the code. Not sure which yet. - Andy From dirk.holtwick at gmail.com Thu Sep 4 16:15:24 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Thu, 04 Sep 2008 22:15:24 +0200 Subject: [reportlab-users] 2.2 - distutils versus setuptools In-Reply-To: <956003ae0809041226s19a1150eje30e21ef092a34ee@mail.gmail.com> References: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> <48BE68DA.2000603@brainbot.com> <956003ae0809030520v3001f9e0m249cc8d37c79d332@mail.gmail.com> <956003ae0809040659w913d977s6c4f59cec9079ed0@mail.gmail.com> <48BFF093.50506@gmail.com> <956003ae0809040937q6bca2fe4o7b4a8d6a7d60e41b@mail.gmail.com> <956003ae0809041226s19a1150eje30e21ef092a34ee@mail.gmail.com> Message-ID: <48C041DC.30603@gmail.com> Andy Robinson schrieb: > (b) we keep the official "version number" in reportlab/__init__.py > (which I just bumped to "2.2pre"). Either the setup info should > pull it from there (which is what Django's script does), or the > setup_version.py script should modify the copy in the code. > Not sure which yet. I have chosen to use the setup_version.py string because of some reasons: - I often experienced problems importing a Python module that should be installed in the very same script. For example if you import your __init__.py file which contains the version number this file might try to import other modules that are not yet installed. I prefer the setup.py file to be independent from the package that will be installed. - If I want to use the version number in the documentation (I write it in HTML and then convert them to PDF via pisa, see there http://www.htmltopdf.org/) then it is useless to have the version number in a Python module. - Another nice feature is, that the script offers a simple way to write a continuous build number and the current date and time. This makes identifying ad hoc distributions to be identified much easier. Just add all files that should be updated in these lines like this: FILES = [ "setup_egg.py", "src/reportlab/__init__py", ] Dirk From IStevens at globeandmail.com Thu Sep 4 17:32:06 2008 From: IStevens at globeandmail.com (Stevens, Ian) Date: Thu, 4 Sep 2008 17:32:06 -0400 Subject: [reportlab-users] Pie chart with all wedge labels to one side, with horizontal label pointers Message-ID: I'm looking to create a pie chart where all the wedge labels are aligned to one side of the pie, connected to their respective wedges by a horizontal label pointer. This would be similar to a pie chart with the legend to one side, except that instead of a color swatch a horizontal label pointer connects to the wedge. I need a chart like this as there's not enough room to have labels on both left and right sides, but I'd still like pointers. Can this be done with the existing Pie charts? Is it feasible as a customisation? thanks, Ian. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Thu Sep 4 18:12:11 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 4 Sep 2008 23:12:11 +0100 Subject: [reportlab-users] 2.2 - distutils versus setuptools In-Reply-To: <48C041DC.30603@gmail.com> References: <956003ae0809021700s27f7ede3ub66044e70d7ef5c5@mail.gmail.com> <48BE68DA.2000603@brainbot.com> <956003ae0809030520v3001f9e0m249cc8d37c79d332@mail.gmail.com> <956003ae0809040659w913d977s6c4f59cec9079ed0@mail.gmail.com> <48BFF093.50506@gmail.com> <956003ae0809040937q6bca2fe4o7b4a8d6a7d60e41b@mail.gmail.com> <956003ae0809041226s19a1150eje30e21ef092a34ee@mail.gmail.com> <48C041DC.30603@gmail.com> Message-ID: <956003ae0809041512j2bf8a613j4074234bc9d2769f@mail.gmail.com> 2008/9/4 Dirk Holtwick : > - Another nice feature is, that the script offers a simple way to write a > continuous build number and the current date and time. This makes > identifying ad hoc distributions to be identified much easier. Your approach makes sense. We do almost exactly the same when we package whole apps for clients (using our packager which is a lot simpler than distutils/setuptools), right down to the version.txt file and including timestamps in the package name. - Andy From andy at reportlab.com Thu Sep 4 18:17:46 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 4 Sep 2008 23:17:46 +0100 Subject: [reportlab-users] Pie chart with all wedge labels to one side, with horizontal label pointers In-Reply-To: References: Message-ID: <956003ae0809041517g47bd96edw1d0fdac2af3ff763@mail.gmail.com> 2008/9/4 Stevens, Ian : > I'm looking to create a pie chart where all the wedge labels are aligned to > one side of the pie, connected to their respective wedges by a horizontal > label pointer. This would be similar to a pie chart with the legend to one > side, except that instead of a color swatch a horizontal label pointer > connects to the wedge. I need a chart like this as there's not enough room > to have labels on both left and right sides, but I'd still like pointers. > Can this be done with the existing Pie charts? > No. > Is it feasible as a customisation? Sure, unless you want really intelligent drawing of the connectors and labels. You're probably best to copy the piechart code and make a new class, and add in some drawing instructions to extend a line from each wedge to the side, and draw the labels there. - Andy From IStevens at globeandmail.com Thu Sep 4 18:35:52 2008 From: IStevens at globeandmail.com (Stevens, Ian) Date: Thu, 4 Sep 2008 18:35:52 -0400 Subject: [reportlab-users] Pie chart with all wedge labels to one side, with horizontal label pointers In-Reply-To: <956003ae0809041517g47bd96edw1d0fdac2af3ff763@mail.gmail.com> References: <956003ae0809041517g47bd96edw1d0fdac2af3ff763@mail.gmail.com> Message-ID: > You're probably best to copy the piechart code and make a new > class, and add in some drawing instructions to extend a line > from each wedge to the side, and draw the labels there. This is what I figured. Thanks. Ian. From robin at reportlab.com Fri Sep 5 05:25:10 2008 From: robin at reportlab.com (Robin Becker) Date: Fri, 05 Sep 2008 10:25:10 +0100 Subject: [reportlab-users] Pie chart with all wedge labels to one side, with horizontal label pointers In-Reply-To: References: <956003ae0809041517g47bd96edw1d0fdac2af3ff763@mail.gmail.com> Message-ID: <48C0FAF6.8060604@chamonix.reportlab.co.uk> Stevens, Ian wrote: >> You're probably best to copy the piechart code and make a new >> class, and add in some drawing instructions to extend a line >> from each wedge to the side, and draw the labels there. > > This is what I figured. Thanks. > > Ian. ...... there is already code to to pointer style labelling for pies, but it is fairly flimsy. To get labels all on one side you need to have a good start angle and set up several parameters (and have all slices visible from that side). -- Robin Becker From ralsina at netmanagers.com.ar Fri Sep 5 07:48:35 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 5 Sep 2008 08:48:35 -0300 Subject: [reportlab-users] Type 3 fonts Message-ID: <200809050848.36991.ralsina@netmanagers.com.ar> Does reportlab support type 3 fonts? From the docs I am guessing not, but just wanted to be sure because it's a user request. Best regards, -- ("\''/").__..-''"`-. . 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 Sep 5 07:56:16 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 5 Sep 2008 12:56:16 +0100 Subject: [reportlab-users] Type 3 fonts In-Reply-To: <200809050848.36991.ralsina@netmanagers.com.ar> References: <200809050848.36991.ralsina@netmanagers.com.ar> Message-ID: <956003ae0809050456t51687347wddda3d25a0f42c27@mail.gmail.com> 2008/9/5 Roberto Alsina : > Does reportlab support type 3 fonts? > No, I'm sorry. BTW I have yet to get my simplified "table of contents" demo done - sorry, it's been a very busy week. I hope to do this before next Fridays tutorial at PyCon UK. You might also want to look at our trunk code as we are getting ready for 2.2, and I could not yet run your 2.1-based rst2pdf package against our trunk. Do you want to try and keep rst2pdf in sync with our trunk, as soon as we have a new package out? - Andy From ralsina at netmanagers.com.ar Fri Sep 5 08:03:46 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 5 Sep 2008 09:03:46 -0300 Subject: [reportlab-users] Type 3 fonts In-Reply-To: <956003ae0809050456t51687347wddda3d25a0f42c27@mail.gmail.com> References: <200809050848.36991.ralsina@netmanagers.com.ar> <956003ae0809050456t51687347wddda3d25a0f42c27@mail.gmail.com> Message-ID: <200809050903.46681.ralsina@netmanagers.com.ar> On Friday 05 September 2008 08:56:16 Andy Robinson wrote: > 2008/9/5 Roberto Alsina : > > Does reportlab support type 3 fonts? > > No, I'm sorry. No problem. It turns out it was a Type 1 font anyway. > BTW I have yet to get my simplified "table of contents" demo > done - sorry, it's been a very busy week. I hope to do this before > next Fridays tutorial at PyCon UK. Don't worry, it's not exactly urgent :-) > You might also want to look at our trunk code as we are getting > ready for 2.2, and I could not yet run your 2.1-based rst2pdf package > against our trunk. Do you want to try and keep rst2pdf in sync > with our trunk, as soon as we have a new package out? Sure. I expect to have it working soon. -- ("\''/").__..-''"`-. . 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 jerald_13 at yahoo.com Fri Sep 5 14:38:49 2008 From: jerald_13 at yahoo.com (Brian) Date: Fri, 5 Sep 2008 11:38:49 -0700 (PDT) Subject: [reportlab-users] Stacked bar chart broken when negative values are involved Message-ID: <670259.96152.qm@web50903.mail.re2.yahoo.com> There seems to be a problem with negative values being fed into the data. Results seem very erratic. Here is what I need to do: Plot 4 stacked bars, that will usually span from negative to positive, that include a "data span" range (min value to max value of a data set), and a bar on each side of the mean value that represents the standard deviation. So to recap: Bar0: (invisible): 0 to Min Bar1: Min to (Mean - STD) Bar2: (Mean-STD) to Mean Bar3: Mean to (Mean + STD) Bar4: (Mean+STD) to Max The problem is, any time a bar crosses the axis, strange things start happening. It will do up to the axes in the expected color, and add whatever's left to the next bar (in the color of the next bar). I read somewhere that the issues can be avoided by plotting from top to bottom, but this doesn't work either. Sometimes bars disappear, sometimes they're plotted in the wrong color, sometimes they're cut off and added to the next bar, and this is only the case when dealing with negatives. Here is some sample code to reproduce the problem. Here is the code (before i tried height tracking to work around boundaries, which broke because it started plotting things in the wrong color): from reportlab.graphics.shapes import Drawing from reportlab.graphics.charts.barcharts import VerticalBarChart from reportlab.graphics.charts.legends import * from reportlab.lib import colors import math class CompressedBarChart: def __init__(self, title, stdcolor="green", spancolor="yellow"): self.mindata = [] self.mincolor = None self.maxdata = [] self.maxcolor = None self.meandata = [] self.meancolor = None self.stddata = [] self.stdcolor = None self.minvalue = 0 self.maxvalue = -90000000 self.ticks = [] self.title=title self.curbars = [] if hasattr(colors, stdcolor): self.stdcolor = getattr(colors, stdcolor) else: self.stdcolor = colors.green if hasattr(colors, spancolor): self.spancolor = getattr(colors, spancolor) else: self.spancolor = colors.yellow def addBar(self, name, minval, maxval, meanval=None, stdval=None): self.ticks.append(name) if not minval == None: self.mindata.append(minval) if minval < self.minvalue: self.minvalue = math.ceil(minval/10 - 2)*10 if not maxval == None: self.maxdata.append(maxval) if maxval > self.maxvalue: self.maxvalue = math.ceil(maxval/10 + 2)*10 if not meanval == None: self.meandata.append(meanval) if not stdval == None: self.stddata.append(stdval) self.curbars.append(0) def createPlots(self): if len(self.mindata) == 0 or len(self.maxdata) == 0: return if not len(self.mindata) == len(self.maxdata): return if not len(self.mindata) == len(self.meandata): hasmean = False hasstd = False else: hasmean = True if not len(self.mindata) == len(self.stddata): hasstd = False else: hasstd = True data = [] bc = VerticalBarChart() bc.categoryAxis.style='stacked' if hasstd: lspan = [x- y-z for x,y,z in zip(self.meandata, self.mindata, self.stddata)] uspan = [x- (y+z) for x,y,z in zip(self.maxdata, self.meandata, self.stddata)] data.append(tuple(self.mindata)) data.append(tuple(lspan)) data.append(tuple(self.stddata)) data.append(tuple(self.stddata)) data.append(tuple(uspan)) bc.bars[0].fillColor = None bc.bars[0].strokeColor = None bc.bars[1].fillColor = self.spancolor bc.bars[2].fillColor = self.stdcolor bc.bars[3].fillColor = self.stdcolor bc.bars[4].fillColor = self.spancolor print str(data) bc.data = data bc.x = 50 bc.y = 50 bc.height = 125 bc.width = 300 bc.strokeColor = colors.black #set the range and tick marks on the y-axis bc.valueAxis.valueMin = self.minvalue bc.valueAxis.valueMax = self.maxvalue #make the ticks on some multiple of 10 bc.valueAxis.valueStep = int((self.maxvalue-self.minvalue)/10) bc.valueAxis.valueStep += (10-bc.valueAxis.valueStep % 10) bc.categoryAxis.labels.boxAnchor = 'ne' bc.categoryAxis.labels.dx = 8 bc.categoryAxis.labels.dy = -2 bc.categoryAxis.labels.angle = 30 bc.categoryAxis.categoryNames = self.ticks bc.valueAxis.visibleGrid=0 #set 1 for horizontal tick lines bc.groupSpacing=5 #change to change spacing between bars drawing = Drawing(550,200) drawing.add(bc) legend = Legend() legend.x = 300+70 legend.y = 125-5 legend.dx = 20 legend.dy = 5 legend.deltax = 0 legend.boxAnchor = 'nw' legend.colorNamePairs = [] legend.colorNamePairs.append((self.spancolor, 'Span Min to Max')) if hasstd: legend.colorNamePairs.append((self.stdcolor, 'Mean +/- one STD')) drawing.add(legend) drawing.add(String(175,190,self.title), name='title') from reportlab.graphics import renderPDF renderPDF.drawToFile(drawing, 'funchart.pdf', 'Simple Bar Chart') graphobj = CompressedBarChart(title="Sample Chart", stdcolor="purple", spancolor="yellow") graphobj.addBar(name="BAD1", minval=-15, maxval=0, meanval=-7, stdval=3)# everything is shifted up because it made thee lower bounds of the span invisible graphobj.addBar(name="BAD2", minval=-15, maxval=15, meanval=2, stdval=10)# The lower bound STD is cut off at the axis and the remainder is left as part of the span graphobj.addBar(name="GOOD!", minval=15, maxval=50, meanval=35, stdval=5) graphobj.createPlots() From henning.vonbargen at arcor.de Fri Sep 5 17:27:02 2008 From: henning.vonbargen at arcor.de (henning.vonbargen at arcor.de) Date: Fri, 5 Sep 2008 23:27:02 +0200 (CEST) Subject: [reportlab-users] fixing bugs in 2.2 / Hyphenation support In-Reply-To: References: Message-ID: <13161370.1220650022283.JavaMail.ngmail@webmail18.arcor-online.net> Regarding the licence: Since I wrote all of the wordaxe code alone, I think I am allowed to release it using another licence. The modified BSD licence used by ReportLab seems ok for me, so feel free to include it with ReportLab. However, I took the dictionaries used for the pyhnj hyphenation from OpenOffice - they are licenced under the GNU LGPL license. I don't know if this is problematic... Maybe Matthias Klose can shed some light on these licence details? Now from a technical point of view: 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. Let me explain how the hyphenation works: The line-breaking algorithm in the standard RL paragraph implementation scans the current line word by word. If the next word does not fit into the current line, it will be pushed to the next line (even if it is wider than the available width - this results in an ugly overflow). The modified algorithm used in the wordaxe paragraph class will hyphenate the word instead and consider the following options: * squeeze the word into the current line (resulting in slightly too narrower inter-word spacing) * hyphenate the word at one of the possible hyphenation points, appending the left part to the current line and pushing the right part to the next line * push the whole word to the next line * if the current line is empty and there are no suitable hyphenation points, create a (wrong) hyphenation point such that as much letters as possible fit into the current line, pushing the rest to the next line (this avoids overflowing for very long unknown/nonsense words). For each of these options, a rating is computed, and the option with the best rating is chosen. As you can see, the idea is actually quite simple. The hyphenation library supports a concept of hyphenation point quality, which is taken into account by the rating function. For example, whereas "Urin-stinkt" is a valid hyphenation of "Urinstinkt" (primal instinct), it is better to use "Ur-instinkt", even if "Urin-" would fit into the current line. In order to hyphenate a word, the word's language must be known. (From a linguistic point of view, the context would be needed as well, but I think this is out of reach for the next few years...) And there may be different hyphenator implementations even for a single language. For example, the hyphenation quality of the dictionary-based wordaxe DCWHyphenator (given a good dictionary) is by far better than that of the pattern-based PyHnjHyphenator, but on the other hand PyHnjHyphenator is a lot faster. And maybe you want to use automatic hyphenation for one paragraph but not for the other. So I decided for wordaxe that I needed at least two properties (at the paragraph level): * If to use automatic hyphenation at all * The language Unfortunately, the standard RL ParagraphStyle does not accept attributes it does not know. That's why I needed a derived ParagraphStyle class as well. ==> It would be nice if these two attributes could make it into the standard RL repository: 'language':None, 'hyphenation':False, ==> I made a very little change in graphdocpy.py: headerline = string.join(canvas.headerLine, ' \xc2\x8d '.decode('utf8')) I added the decode(...) here. I don't think this is important, as it's only used for generating the header line of the docco, but perhaps it could go into the RL standard. ==> I also changed paraparser.py slightly: Now you can set the parser's encoding explicitly, which allows to parse using encodings different from "utf-8". I don't remember why this was necessary, but I think it was for using some symbols. I don't think it would break existing code, so it would be nice if this could make it into RL standard, too. In xpreformatted.py I had to make a very little change to supply the base class Paragraph with an encoding: class XPreformatted(_orig_preformatted): def __init__(self, text, style, bulletText = None, frags=None, caseSensitive=1, dedent=0, encoding='utf8'): self.encoding = encoding ... ==> This shouldn't break existing code and could perhaps make it into the RL standard, too. Last but least: The derived Paragraph class wordaxe.rl.Paragraph. Now, while the basic idea is simple, this turned out to be very hard work. The problem is about str/unicode conversion. And the wordaxe paragraph implementation still has one major bug: When the paragraph is split across frames, the first frame is rendered correctly, but the next frame is more or less rubbish. I changed the HyphenatedWord instance recently to derive from unicode, with a __str__ method that returns an utf-8 string. I hope that this modification - will allow me to rewrite the paragraph implementation from scratch or - to be more precise - from the standard paragraph.py - in a more clean way: The goal is to ONLY change the breakLines method. ---------------------- To make things short: * The licence shouldn't be an issue, please feel free to use the wordaxe code in the RL toolkit under the (3-clause) BSD licence. * However, some dict files are from OpenOffice and under LGPL; these are needed for the PyHnjHyphenator but not for other hyphenators. * Please try to integrate the changes marked with "==>" into the RL 2.2 release - or at least RL 2.2.x a few days later! (I can imagine hearing Dinu saying: "days, not years") * This will allow me to concentrate on the derived Paragraph class in order to fix the splitting bug etc. * From my point of view, due to the serious bug mentioned above, and in order to not further delay the 2.2 release, this the best solution. To make things even shorter (in Python syntax): def bestSolution(): for f in os.listdir("wordaxe/rl"): if f == "paragraph.py": continue merge_changes_into_RL_2_2(f) Wow, this is probably my longest posting ever! Henning http://sourceforge.net/projects/deco-cow/ From ralsina at netmanagers.com.ar Fri Sep 5 17:40:20 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 5 Sep 2008 18:40:20 -0300 Subject: [reportlab-users] [ANN] rst2pdf version 0.7 released Message-ID: <200809051840.21516.ralsina@netmanagers.com.ar> I just released version 0.7 of this Rst-to-PDF-via-reportlab tool. **IMPORTANT** rst2pdf needs a new name. There are three tools with the same name, so suggestions to ralsina at netmanagers.com.ar are appreciated. This is a major features release, and a major improvement over 0.6. You can get it via PyPI (package rst2pdf) or from Google Code: http://rst2pdf.googlecode.com Here are some of the features it provides: * User-defined page layout. Multiple frames per page, multiple layouts per document. * Cascading stylesheet mechanism, define only what you want changed * Supports TTF and Type1 font embedding using a custom stylesheet * "Floating" sidebars (or almost any element) * Any number of paragraph styles using the class directive * Any number of character styles using text roles * Styled table headers and cells * Custom page sizes and margins. * Syntax highlighter for many languages, using Pygments * Supports hyphenation (using wordaxe) * Full user's manual You can see a sample of some features here: http://tinyurl.com/5e4h3j Here's the changelog for the last two versions: New in 0.7 ---------- * Automatic Type1 and True Type font embedding. Just use the font or family name, and (with a little luck), it will be embedded for you. * width attribute in styles, to create narrow paragraphs/tables * Styles for table headers and table cells. * "Zebra tables". * Improvements in the handling of overflowing literal blocks (code, for instance) * Different modes to handle too-large literal blocks: overflow/ truncate/ shrink. * Real sidebars and "floating" elements. * Fixed link style (no ugly black underlining!) New in 0.6 ---------- * Stylesheet-defined page layout (For example, multicolumn) and layout switching * Cascading Stylesheets (change exactly what you need changed) * PDF table of contents * Current section names and numbers in headers/footers * Support for compressed PDF files * Link color is configurable * Fixed bugs in color handling * Multilingual hyphenation * Auto-guessing image size, support for sizes in % * Gutter margins * Big refactoring * More tolerant of minor problems * Limited _raw_ directive (you can insert pagebreaks and vertical space) * Implemented a "traditional" docutils writer * Offer a reasonable API for use as a library * Fixed copyright/licensing * code-block now supports including files (whole or in part) so you can highlight external code. Hope you enjoy it and/or find it useful. Best regards, -- ("\''/").__..-''"`-. . 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 gherman at darwin.in-berlin.de Sat Sep 6 04:04:15 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Sat, 6 Sep 2008 10:04:15 +0200 Subject: [reportlab-users] fixing bugs in 2.2 / Hyphenation support In-Reply-To: <13161370.1220650022283.JavaMail.ngmail@webmail18.arcor-online.net> References: <13161370.1220650022283.JavaMail.ngmail@webmail18.arcor-online.net> Message-ID: <874E45FA-9D1B-4DE5-BA7D-53DC881C89E4@darwin.in-berlin.de> henning.vonbargen at arcor.de: > [...] Wow, this is probably my longest posting ever! Congratulations (birthday included ;-) for this very comprehensive message! Having followed Henning's work over the years (no joke) on adding hyphenation support to RL I feel like adding a couple of comments to his excellent posting. For me the lack of proper hyphenation support was a show-stopper for several real-life projects. Maybe this is hard to understand for people who learned English as their first language and who do not know or use other languages like French and especially German with its long word compositions, e.g. the famous Donau-dampf- schiff-fahrts-kapit?ns-tochter. Anyway, I was always surprised to see RL pay so little attention to this issue, because even with the simplest two-colum layout your French/German text will, most likely, look plain ugly. So I helped Henning with his wordaxe providing mainly debugging examples and it turned out to be a life saver. So I'd really like to see his work being included into RL 2.2 to make it easier to use. Previously I had no hope for this to happen, so I started my own reimplementation of paragraphs with their own hyphenation method plus many other (still experimental) features like marginal text, versal characters, line numbers, highlighting, inline bitmap and vector graphics, etc. This is by no means "finished", but I rein- vite people to have a look at it: http://www.dinu-gherman.net/tmp/alterparagraphs-0.2.0.tar.gz http://www.dinu-gherman.net/tmp/alterparagraphs-README.html http://www.dinu-gherman.net/tmp/alterparagraphs-slides.pdf And even if RL 2.2 will include Henning's work I will continue to work on these alternative paragraphs, because their main purpose is to make it easier to add new features to them. If anybody wants to join, please let me know. Regards, Dinu From andy at reportlab.com Mon Sep 8 04:08:26 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 8 Sep 2008 09:08:26 +0100 Subject: [reportlab-users] fixing bugs in 2.2 / Hyphenation support In-Reply-To: <13161370.1220650022283.JavaMail.ngmail@webmail18.arcor-online.net> References: <13161370.1220650022283.JavaMail.ngmail@webmail18.arcor-online.net> Message-ID: <956003ae0809080108v4dd53a1exf766a9d48b542c5b@mail.gmail.com> 2008/9/5 : > Regarding the licence: > > Since I wrote all of the wordaxe code alone, > I think I am allowed to release it using another licence. > The modified BSD licence used by ReportLab seems ok for me, > so feel free to include it with ReportLab. Thanks very much! > However, I took the dictionaries used for the pyhnj hyphenation > from OpenOffice - they are licenced under the GNU LGPL license. > I don't know if this is problematic... That's fine by me (with ReportLab's simplified world view). LGPL allows people to do what they want with it (we just need to make sure we have the right notices in the readmes and license files). Matthias, I presume it's OK with you? GPL is the only problematic one; it's deliberately "viral" so the only way we could include GPL code would be by switching to it. > Maybe Matthias Klose can shed some light on these licence details? BTW we replaced the version of Homer's Odyssey with a public domain one. We still need to replace a couple of demo fonts. - Andy From larry.meyn at nasa.gov Mon Sep 8 12:23:49 2008 From: larry.meyn at nasa.gov (Larry Meyn) Date: Mon, 08 Sep 2008 09:23:49 -0700 Subject: [reportlab-users] Has the figure numbering bug in Platypus been fixed? Message-ID: Has the figure numbering bug in Platypus been fixed? In all the current reportlab user docs figures are numbered as if they are in the last chapter, regardless of what the chapter the figures are in. Larry Meyn -------------- next part -------------- An HTML attachment was scrubbed... URL: From ralsina at netmanagers.com.ar Tue Sep 9 19:53:31 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Tue, 9 Sep 2008 20:53:31 -0300 Subject: [reportlab-users] Is this a bug? Message-ID: <200809092053.31828.ralsina@netmanagers.com.ar> This is using reportlabs 2.1 I had a bug report from a user, and after a little work, I have distilled it to this: # -*- coding: utf-8 -*- from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer from reportlab.lib.styles import getSampleStyleSheet from reportlab.lib.units import inch styles = getSampleStyleSheet() def go(): doc = SimpleDocTemplate("phello.pdf") Story = [Spacer(1,2*inch)] style = styles["Normal"] p = Paragraph(''' Citizen ''', style) Story.append(p) doc.build(Story) go() When I run it, I get the following error: xml parser error (; missing after entity/char reference) in paragraph beginning If the paragraph contains Citizen it works just fine. It just doesn't like ampersands there. It also works if I put Citizen and links to the right place, am I not getting something about quoting here? -- ("\''/").__..-''"`-. . 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 ralsina at netmanagers.com.ar Tue Sep 9 20:26:57 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Tue, 9 Sep 2008 21:26:57 -0300 Subject: [reportlab-users] Is this a bug? In-Reply-To: <200809092053.31828.ralsina@netmanagers.com.ar> References: <200809092053.31828.ralsina@netmanagers.com.ar> Message-ID: <200809092126.57519.ralsina@netmanagers.com.ar> Ignore it, it's fixed in SVN trunk. -- ("\''/").__..-''"`-. . 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 Wed Sep 10 10:00:50 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 10 Sep 2008 15:00:50 +0100 Subject: [reportlab-users] 2.2 release updates Message-ID: <956003ae0809100700t4deae2a4gf2596f08e5bc8bf2@mail.gmail.com> Hi everybody, First of all, I am wondering if anyone has tried out the setup script from subversion and/or had any issues? -- Regrettably the package rearrangement had a substantial impact on our own packaging scripts for our commercial distro-builders and for the many corporate solutions we build and maintain, and getting those things changed over has eaten up all our spare time this week. So, we don't have time to screen and accept any more major changes this week. In particular (a) Henning's paragraphs and hyphenation will have to wait, and we might look at ways to make this an optional plug-in (b) the optional egg-style setup script Dirk contributed still doesn't build the C extensions. (c) there will be a terse changelist out of subversion, but not much high-level documentation. We are however trying to replace the last remaining "politically incorrect font" today. Once 2.2 is out, we'll be putting up a new wiki to help gather docs and snippets; and no doubt we will learn some things about setup scripts. We can then produce a followup release reasonably quickly whenever we need to. Thanks for you understanding Andy Robinson CEO/Chief Architect, ReportLab From ralsina at netmanagers.com.ar Wed Sep 10 10:03:56 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Wed, 10 Sep 2008 11:03:56 -0300 Subject: [reportlab-users] 2.2 release updates In-Reply-To: <956003ae0809100700t4deae2a4gf2596f08e5bc8bf2@mail.gmail.com> References: <956003ae0809100700t4deae2a4gf2596f08e5bc8bf2@mail.gmail.com> Message-ID: <200809101103.58398.ralsina@netmanagers.com.ar> On Wednesday 10 September 2008 11:00:50 Andy Robinson wrote: > Hi everybody, > > First of all, I am wondering if anyone has tried out the setup script > from subversion and/or had any issues? Tried it, no problems. Nice to see so many bugs fixed, too! -- ("\''/").__..-''"`-. . 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 Wed Sep 10 10:11:27 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 10 Sep 2008 15:11:27 +0100 Subject: [reportlab-users] Not moving to Google Code just yet... Message-ID: <956003ae0809100711n1e89ecfof2e2ea0ea57831b2@mail.gmail.com> 2008/9/3 Dirk Holtwick : > Hi, > > I would like to suggest an approach to make contributing to ReportLab > easier: Why don't you put ReportLab Toolkit to Google Code > or something similar. Hi folks, We have discussed this at length and decided not to do this just now. First of all, we found out last week how much work it creates for us internally when we change things around. It's higher than you think, and even if we would ideally like to do those things for the good of the community, we just run out of time and can't finish. Secondly, we do have things planned in the next 3 months which should go further and make it unnecessary. 1. we're moving to new offices in the next 2-3 weeks, with the freedom to make our own connectivity arrangements and a proper data centre; this should resolve the recent issues with accessing the SVN repo in our office. 2. we are moving our web site across to a Django-based system we're writing, which should make it easy to use create many more collaboration tools for the user group; including (I hope) single registration for mailing list, wiki write access, tracker, a "snippets" site and so on. Any ReportLab wiki or cookbook really needs to be rich enough to hold screenshots and PDF attachments, which Google Code (AFAICT) won't support. 3. we already have an internal tracker (multi-project and multi-customer) and after (2) we should be able to make a custom view or two so that open source issues are openly visible, yet still appear within our own internal issue database, without compromising customer privacy. The timings on 2 and 3 are hopefully November/December, but there will be an interim wiki shortly. - Andy From andy at reportlab.com Wed Sep 10 10:43:36 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 10 Sep 2008 15:43:36 +0100 Subject: [reportlab-users] 2.2 release updates In-Reply-To: <200809101103.58398.ralsina@netmanagers.com.ar> References: <956003ae0809100700t4deae2a4gf2596f08e5bc8bf2@mail.gmail.com> <200809101103.58398.ralsina@netmanagers.com.ar> Message-ID: <956003ae0809100743i147db1bfn9bf89957230661b2@mail.gmail.com> 2008/9/10 Roberto Alsina : > Tried it, no problems. Nice to see so many bugs fixed, too! Great. I can't wait to work with rst2pdf too - hopefully we'll end up compatible soon after the release... - Andy From ralsina at netmanagers.com.ar Wed Sep 10 10:44:10 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Wed, 10 Sep 2008 11:44:10 -0300 Subject: [reportlab-users] 2.2 release updates In-Reply-To: <956003ae0809100743i147db1bfn9bf89957230661b2@mail.gmail.com> References: <956003ae0809100700t4deae2a4gf2596f08e5bc8bf2@mail.gmail.com> <200809101103.58398.ralsina@netmanagers.com.ar> <956003ae0809100743i147db1bfn9bf89957230661b2@mail.gmail.com> Message-ID: <200809101144.10528.ralsina@netmanagers.com.ar> On Wednesday 10 September 2008 11:43:36 Andy Robinson wrote: > 2008/9/10 Roberto Alsina : > > Tried it, no problems. Nice to see so many bugs fixed, too! > > Great. I can't wait to work with rst2pdf too - hopefully we'll > end up compatible soon after the release... My trunk is compatible with your trunk and wordaxe's trunk since this morning :-D -- ("\''/").__..-''"`-. . 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 ralsina at netmanagers.com.ar Wed Sep 10 22:49:34 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Wed, 10 Sep 2008 23:49:34 -0300 Subject: [reportlab-users] Want to use SVG files with reportlab? Read this! Message-ID: <200809102349.34825.ralsina@netmanagers.com.ar> I have just done a hack to use those file formats (and several others) *as vectors* from reportlab. You need an external tool, called uniconvertor, and it has some issues, but it is working. I should polish it, but I'm just too excited and wanted to share it :-) Details and code, including a SVGImage flowable: http://lateral.netmanagers.com.ar/weblog/2008/09/10.html#BB753 Sample PDF with SVG in it: http://lateral.netmanagers.com.ar/static/svg.pdf If anyone can help me get rid of the page jump after the SVG, I think I can fix the rest of it :-) -- ("\''/").__..-''"`-. . 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 greno at verizon.net Thu Sep 11 10:42:03 2008 From: greno at verizon.net (Gerry Reno) Date: Thu, 11 Sep 2008 10:42:03 -0400 Subject: [reportlab-users] RML and non-standard fonts Message-ID: <48C92E3B.70307@verizon.net> I am new to the reportlab list so please excuse if this question has been answered somewhere - please just point me to the thread if so. I have been using reportlab within the context of OpenERP (aka TinyERP). It uses the reportlab engine but I think it uses its own RML parser. Anyway, OpenERP has a means of creating a OpenOffice .sxw file, adding some special directives and then turning that into an RML file. From there it gets converted into a PDF with its own trml2pdf parser. I think I have all that right. What I am needing to do is to create the .sxw with a non-standard font and have that font embedded into the PDF. I added my new font in the default Type1 fonts directory and restarted OpenOffice and it shows up in the list of fonts. I use this font in my .sxw file but when it generates the RML file the font is converted to Times-Roman. So what is necessary to get the new non-standard font into the RML and subsequently into the PDF? What pieces need to be modified? Thanks, Gerry From robin at reportlab.com Thu Sep 11 13:07:09 2008 From: robin at reportlab.com (Robin Becker) Date: Thu, 11 Sep 2008 18:07:09 +0100 Subject: [reportlab-users] ReportLab 2.2 has been released Message-ID: <48C9503D.4060301@chamonix.reportlab.co.uk> Version 2.2 of the ReportLab open-source tool kit is out! You find downloads and src instructions at http://www.reportlab.org/downloads.html. Contributions ============= Thanks to everybody who has contributed to the open-source toolkit in the run-up to the 2.2 release, whether by reporting bugs, sending patches, or contributing to the reportlab-users mailing list. Thanks especially to the following people, who contributed code that has gone into 2.2: including, but not limited to (apologies to any missed out) Matt Folwell, Jerome Alet, Harald Armin Massa, kevin at booksys.com, Sebastian Ware, Martin Tate, Wietse Jacobs, Christian Jacobs, Volker Haas, Dinu Gherman, Dirk Datzert & Yuan Hong. If we missed you, please let us know! New Features ============ PDF pdfmetrics: Added registerFontFamily function Basic support for pdf document viewer preferences (e.g.: fullscreen). Platypus Paragraph tag support for inline images. Paragraph autoleading support (helps with tags). Platypus doctemplate programming support. Support for tables with non-uniform row length. Graphics RGBA image support for suitable bitmap types. LTO labelling barcode. And many bugfixes... -- Robin Becker From ralsina at netmanagers.com.ar Thu Sep 11 17:36:23 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Thu, 11 Sep 2008 18:36:23 -0300 Subject: [reportlab-users] Scalable vector images in reportlab (cleaned up code) Message-ID: <200809111836.23936.ralsina@netmanagers.com.ar> I'm surprised noone seems to be interested in using SVG/EPS/whatever via reportlab, but anyway, since I wanted it I just finished comitting clean(ish) code to do it, and post it here since this subject pops up every year or so. The code is just two small modules (and you need to install uniconvertor). http://code.google.com/p/rst2pdf/source/browse/trunk/rst2pdf/svgimage.py http://code.google.com/p/rst2pdf/source/browse/trunk/rst2pdf/uniconvsaver.py No known bugs (not looked much for'em myself). New sample PDF with smooth, scalable, small (in bytes) graphic: http://lateral.netmanagers.com.ar/static/svg.pdf -- ("\''/").__..-''"`-. . 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 dirk.holtwick at gmail.com Fri Sep 12 01:49:01 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Fri, 12 Sep 2008 07:49:01 +0200 Subject: [reportlab-users] ReportLab 2.2 has been released In-Reply-To: <48C9503D.4060301@chamonix.reportlab.co.uk> References: <48C9503D.4060301@chamonix.reportlab.co.uk> Message-ID: <48CA02CD.8050503@gmail.com> Congratulations! It look a lot cleaner now. But I have some remarks that might be of interest for the 2.2.1 release regarding the structure of the distribution: - There is an "install" section in README.txt and INSTALL.txt. I think INSTALL.txt should be included into README.txt to avoid confusion - CHANGES.txt is more or less a SVN dump. But common users may get confused. I think the section "NEW FEATURES" of this email would be more expressive for someone who has to decide if switching to the new version is appropriate - You got many Readme's with different filenames like: "00readme.txt", "README" (in src\reportlab\graphics\barcode), and I found a second license file (in src\reportlab). There is also a MANIFEST.in (in src\reportlab) of which I'm not sure if it is needed in this place. Maybe a little cleanup and renaming/ moving would be nice to get a consistent naming. Also adding expressive Readmes to /demos and /tools would be great to give a little overview what the subprojects are good for - In the old distribution the doc files (as PDF) where already be generated - if I remember right? Please add them again, because it is not trivial to generate them. For many people this will be the first point where they go to decide if it is an interesting tool. - The version of setup_egg.py is still "2.2pre". - A Windows pre compiled version would be nice, because not all Python programmers own MS C++ Development Suite (like me :) [Eggs would solve this problem too ;)] And finally you should consider updating your PyPI entry, it is still version 2.0 ;) http://pypi.python.org/pypi/reportlab/2.0 Dirk Robin Becker schrieb: > Version 2.2 of the ReportLab open-source tool kit is out! You find > downloads and src instructions at http://www.reportlab.org/downloads.html. > > Contributions > ============= > Thanks to everybody who has contributed to the open-source toolkit in > the run-up to the 2.2 release, whether by reporting bugs, sending > patches, or contributing to the reportlab-users mailing list. Thanks > especially to the following people, who contributed code that has gone > into 2.2: including, but not limited to (apologies to any missed out) > Matt Folwell, Jerome Alet, Harald Armin Massa, kevin at booksys.com, > Sebastian Ware, Martin Tate, Wietse Jacobs, Christian Jacobs, Volker > Haas, Dinu Gherman, Dirk Datzert & Yuan Hong. > > If we missed you, please let us know! > > > New Features > ============ > PDF > pdfmetrics: Added registerFontFamily function > Basic support for pdf document viewer preferences (e.g.: fullscreen). > > Platypus > Paragraph tag support for inline images. > Paragraph autoleading support (helps with tags). > Platypus doctemplate programming support. > Support for tables with non-uniform row length. > > Graphics > RGBA image support for suitable bitmap types. > LTO labelling barcode. > > And many bugfixes... From dirk.holtwick at gmail.com Fri Sep 12 02:10:49 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Fri, 12 Sep 2008 08:10:49 +0200 Subject: [reportlab-users] Inline Images Message-ID: <48CA07E9.7040904@gmail.com> Hi, I like the new inline images feature of the Paragraph Flowable. Align "left" and "right" are not supported as far as I understand. Is there any common workaround to achieve such an effect? Here is a sample HTML to illustrate what I'm talking about: -----------------8<---------------[cut here]

You see the dummy on the right hand

-----------------8<---------------[cut here] Thanks Dirk From gherman at darwin.in-berlin.de Fri Sep 12 05:27:21 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 12 Sep 2008 11:27:21 +0200 Subject: [reportlab-users] Want to use SVG files with reportlab? Read this! In-Reply-To: <200809102349.34825.ralsina@netmanagers.com.ar> References: <200809102349.34825.ralsina@netmanagers.com.ar> Message-ID: <49568308-A69E-47DD-976E-67CBA802E78E@darwin.in-berlin.de> Roberto Alsina: > I have just done a hack to use those file formats (and several > others) *as > vectors* from reportlab. > > You need an external tool, called uniconvertor, and it has some > issues, but it > is working. > > I should polish it, but I'm just too excited and wanted to share > it :-) > > Details and code, including a SVGImage flowable: > http://lateral.netmanagers.com.ar/weblog/2008/09/10.html#BB753 > > Sample PDF with SVG in it: http://lateral.netmanagers.com.ar/static/svg.pdf > > If anyone can help me get rid of the page jump after the SVG, I > think I can > fix the rest of it :-) Hi Roberto, looks like I'm the only one looking at this. Briefly: it looks interesting, but with a strange package layout (top-level "app"?), without docs and a solid testsuite I have trouble to give it even a try. This reminds me of a package named "svglib" which you might want to google for. During the last weeks several people told me that I should update and put it under a more "conventional" license. So I've added this on my todo list, together with including the pretty solid W3C testsuite for the first time. So, stay tuned! ;-) Dinu PS: Looks like the Starship Python site hosting the page is down right now, so I'll post a link to it here, as soon as it works again... Sorry for that. From gherman at darwin.in-berlin.de Fri Sep 12 06:25:52 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 12 Sep 2008 12:25:52 +0200 Subject: [reportlab-users] ReportLab 2.2 has been released In-Reply-To: <48C9503D.4060301@chamonix.reportlab.co.uk> References: <48C9503D.4060301@chamonix.reportlab.co.uk> Message-ID: <12CB1F49-5E2A-42DE-B2E9-C5EDE6371441@darwin.in-berlin.de> Robin Becker: > Version 2.2 of the ReportLab open-source tool kit is out! You find > downloads and src instructions at http://www.reportlab.org/downloads.html > . Great - Congrats! Waiting-impatiently-for-the-bug-tracker'ly, ;-) Dinu From ralsina at netmanagers.com.ar Fri Sep 12 06:29:06 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 12 Sep 2008 07:29:06 -0300 Subject: [reportlab-users] Want to use SVG files with reportlab? Read this! In-Reply-To: <49568308-A69E-47DD-976E-67CBA802E78E@darwin.in-berlin.de> References: <200809102349.34825.ralsina@netmanagers.com.ar> <49568308-A69E-47DD-976E-67CBA802E78E@darwin.in-berlin.de> Message-ID: <200809120729.21765.ralsina@netmanagers.com.ar> On Friday 12 September 2008 06:27:21 Dinu Gherman wrote: > Roberto Alsina: > > I have just done a hack to use those file formats (and several > > others) *as > > vectors* from reportlab. > > > > You need an external tool, called uniconvertor, and it has some > > issues, but it > > is working. > > > > I should polish it, but I'm just too excited and wanted to share > > it :-) > > > > Details and code, including a SVGImage flowable: > > http://lateral.netmanagers.com.ar/weblog/2008/09/10.html#BB753 > > > > Sample PDF with SVG in it: > > http://lateral.netmanagers.com.ar/static/svg.pdf > > > > If anyone can help me get rid of the page jump after the SVG, I > > think I can > > fix the rest of it :-) > > Hi Roberto, > > looks like I'm the only one looking at this. Briefly: it looks > interesting, but with a strange package layout (top-level "app"?), > without docs and a solid testsuite I have trouble to give it even > a try. I don't understand what you are talking about. Docs for what, exactly? Uniconvertor? The flowable I wrote? > This reminds me of a package named "svglib" which you might want > to google for. During the last weeks several people told me that > I should update and put it under a more "conventional" license. > So I've added this on my todo list, together with including the > pretty solid W3C testsuite for the first time. I looked at it, but the license discouraged me. -- ("\''/").__..-''"`-. . 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 greno at verizon.net Fri Sep 12 08:53:57 2008 From: greno at verizon.net (Gerry Reno) Date: Fri, 12 Sep 2008 08:53:57 -0400 Subject: [reportlab-users] RML and non-standard fonts In-Reply-To: <48C92E3B.70307@verizon.net> References: <48C92E3B.70307@verizon.net> Message-ID: <48CA6665.10004@verizon.net> Hmm... no one knows? Maybe the OpenERP part is confusing so forget about that for the moment. I would rather that OpenERP support the regular ReportLab tools anyway. So let me rephrase the question: Is there a way with just the regular ReportLab tools to generate an RML file that uses a non-standard font and then convert this RML file into a PDF that has the non-standard font embedded in it? Thanks, Gerry From gherman at darwin.in-berlin.de Fri Sep 12 09:03:44 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 12 Sep 2008 15:03:44 +0200 Subject: [reportlab-users] Want to use SVG files with reportlab? Read this! In-Reply-To: <200809120729.21765.ralsina@netmanagers.com.ar> References: <200809102349.34825.ralsina@netmanagers.com.ar> <49568308-A69E-47DD-976E-67CBA802E78E@darwin.in-berlin.de> <200809120729.21765.ralsina@netmanagers.com.ar> Message-ID: <72F8EFFC-F273-4DA4-A2F7-047B5853B68E@darwin.in-berlin.de> Roberto Alsina: > On Friday 12 September 2008 06:27:21 Dinu Gherman wrote: > >> [...] Briefly: it looks >> interesting, but with a strange package layout (top-level "app"?), >> without docs and a solid testsuite I have trouble to give it even >> a try. > > I don't understand what you are talking about. > Docs for what, exactly? Uniconvertor? The flowable I wrote? Yes, I was referring to Uniconvertor. >> This reminds me of a package named "svglib" which you might want >> to google for. During the last weeks several people told me that >> I should update and put it under a more "conventional" license. >> So I've added this on my todo list, together with including the >> pretty solid W3C testsuite for the first time. > > I looked at it, but the license discouraged me. As I said... it's going to change. Dinu From andy at reportlab.com Fri Sep 12 09:19:38 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 12 Sep 2008 14:19:38 +0100 Subject: [reportlab-users] Scalable vector images in reportlab (cleaned up code) In-Reply-To: <200809111836.23936.ralsina@netmanagers.com.ar> References: <200809111836.23936.ralsina@netmanagers.com.ar> Message-ID: <956003ae0809120619r2f4b08f6h3c3775745e4ecd03@mail.gmail.com> 2008/9/11 Roberto Alsina : > I'm surprised noone seems to be interested in using SVG/EPS/whatever via > reportlab, but anyway, since I wanted it I just finished comitting clean(ish) > code to do it, and post it here since this subject pops up every year or so. > Roberto, this is very interesting. I am tied up at pyconuk but will try to look at this next week - Andy From andy at reportlab.com Fri Sep 12 09:29:24 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 12 Sep 2008 14:29:24 +0100 Subject: [reportlab-users] RML and non-standard fonts In-Reply-To: <48CA6665.10004@verizon.net> References: <48C92E3B.70307@verizon.net> <48CA6665.10004@verizon.net> Message-ID: <956003ae0809120629x3d290578rc99da12a8e5d2691@mail.gmail.com> 2008/9/12 Gerry Reno : > Hmm... no one knows? > Maybe the OpenERP part is confusing so forget about that for the moment. I > would rather that OpenERP support the regular ReportLab tools anyway. > > So let me rephrase the question: > Is there a way with just the regular ReportLab tools to generate an RML file > that uses a non-standard font and then convert this RML file into a PDF that > has the non-standard font embedded in it? RML (tm) is a product of ours and we have examples on how to do this for our licensed customers. "Tiny RML" uses different code (despite sharing our DTD) and you'd have to ask them. However our own User Guide has a section on how to embed fonts, and there are tests in the test suite, if you are working at the open source level. - Andy From ralsina at netmanagers.com.ar Fri Sep 12 09:35:57 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 12 Sep 2008 10:35:57 -0300 Subject: [reportlab-users] Want to use SVG files with reportlab? Read this! In-Reply-To: <72F8EFFC-F273-4DA4-A2F7-047B5853B68E@darwin.in-berlin.de> References: <200809102349.34825.ralsina@netmanagers.com.ar> <200809120729.21765.ralsina@netmanagers.com.ar> <72F8EFFC-F273-4DA4-A2F7-047B5853B68E@darwin.in-berlin.de> Message-ID: <200809121035.58140.ralsina@netmanagers.com.ar> On Friday 12 September 2008 10:03:44 Dinu Gherman wrote: > Roberto Alsina: > > On Friday 12 September 2008 06:27:21 Dinu Gherman wrote: > >> [...] Briefly: it looks > >> interesting, but with a strange package layout (top-level "app"?), > >> without docs and a solid testsuite I have trouble to give it even > >> a try. > > > > I don't understand what you are talking about. > > Docs for what, exactly? Uniconvertor? The flowable I wrote? > > Yes, I was referring to Uniconvertor. Well, uniconvertor is a rather simple app even if it does something difficult :-) uniconv in out converts in into out. Format of in and out guessed from the extensions. Maybe there is a test suite in sk1 (uniconv is mostly sk1 - the gui) -- ("\''/").__..-''"`-. . 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 Sep 12 10:00:28 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 12 Sep 2008 15:00:28 +0100 Subject: [reportlab-users] Want to use SVG files with reportlab? Read this! In-Reply-To: <200809121035.58140.ralsina@netmanagers.com.ar> References: <200809102349.34825.ralsina@netmanagers.com.ar> <200809120729.21765.ralsina@netmanagers.com.ar> <72F8EFFC-F273-4DA4-A2F7-047B5853B68E@darwin.in-berlin.de> <200809121035.58140.ralsina@netmanagers.com.ar> Message-ID: <956003ae0809120700u288f2356s67b6efd215b11222@mail.gmail.com> 2008/9/12 Roberto Alsina : > Well, uniconvertor is a rather simple app even if it does something difficult > :-) > > uniconv in out This is all very interesting - I'm about to take a look at uniconverter (on the train back from pycon-uk in a couple of hours...), but it's clearly been coded as part of an app (SK1 seems to be a GUI) rather than a library. We certainly need a better means to get vector art such as SVG into documents. - Andy From ralsina at netmanagers.com.ar Fri Sep 12 10:57:33 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 12 Sep 2008 11:57:33 -0300 Subject: [reportlab-users] Want to use SVG files with reportlab? Read this! In-Reply-To: <956003ae0809120700u288f2356s67b6efd215b11222@mail.gmail.com> References: <200809102349.34825.ralsina@netmanagers.com.ar> <200809121035.58140.ralsina@netmanagers.com.ar> <956003ae0809120700u288f2356s67b6efd215b11222@mail.gmail.com> Message-ID: <200809121157.50461.ralsina@netmanagers.com.ar> On Friday 12 September 2008 11:00:28 Andy Robinson wrote: > 2008/9/12 Roberto Alsina : > > Well, uniconvertor is a rather simple app even if it does something > > difficult > > > > :-) > > > > uniconv in out > > This is all very interesting - I'm about to take a look at > uniconverter (on the train back from pycon-uk in a couple of > hours...), but it's clearly been coded as part of an app (SK1 seems to > be a GUI) rather than a library. > > We certainly need a better means to get vector art such as SVG into > documents. Converting uniconvertor into a library to draw into PDFs is easy. There is basically a problem about not being able to import it directly, and that the interface is not documented anywhere. I posted in their forum to see if they are interested in doing it. -- ("\''/").__..-''"`-. . 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 greno at verizon.net Fri Sep 12 12:16:15 2008 From: greno at verizon.net (Gerry Reno) Date: Fri, 12 Sep 2008 12:16:15 -0400 Subject: [reportlab-users] RML and non-standard fonts In-Reply-To: <956003ae0809120629x3d290578rc99da12a8e5d2691@mail.gmail.com> References: <48C92E3B.70307@verizon.net> <48CA6665.10004@verizon.net> <956003ae0809120629x3d290578rc99da12a8e5d2691@mail.gmail.com> Message-ID: <48CA95CF.3060402@verizon.net> Andy Robinson wrote: > RML (tm) is a product of ours and we have examples on how to do this > for our licensed customers. "Tiny RML" uses different code (despite > sharing our DTD) and you'd have to ask them. > > However our own User Guide has a section on how to embed fonts, and > there are tests in the test suite, if you are working at the open > source level. > > - Andy > Thanks Andy. Let me ask this. I have the python-reportlab package installed and it is version 2.0.2. Does this version support the embedded fonts functionality? Thanks, Gerry From robin at reportlab.com Fri Sep 12 13:25:13 2008 From: robin at reportlab.com (Robin Becker) Date: Fri, 12 Sep 2008 18:25:13 +0100 Subject: [reportlab-users] RML and non-standard fonts In-Reply-To: <48CA95CF.3060402@verizon.net> References: <48C92E3B.70307@verizon.net> <48CA6665.10004@verizon.net> <956003ae0809120629x3d290578rc99da12a8e5d2691@mail.gmail.com> <48CA95CF.3060402@verizon.net> Message-ID: <48CAA5F9.9010204@chamonix.reportlab.co.uk> Gerry Reno wrote: > Andy Robinson wrote: >> RML (tm) is a product of ours and we have examples on how to do this >> for our licensed customers. "Tiny RML" uses different code (despite >> sharing our DTD) and you'd have to ask them. >> >> However our own User Guide has a section on how to embed fonts, and >> there are tests in the test suite, if you are working at the open >> source level. >> >> - Andy >> > Thanks Andy. Let me ask this. I have the python-reportlab package > installed and it is version 2.0.2. Does this version support the > embedded fonts functionality? > > Thanks, > Gerry ..... I think we have done embedded type 1 from the beginning. Marius Gedminas contributed TTF code years ago that handled subsetting etc etc; so yes I think 2.0.2 will support most emkbeddings. -- Robin Becker From ralsina at netmanagers.com.ar Fri Sep 12 13:24:08 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 12 Sep 2008 14:24:08 -0300 Subject: [reportlab-users] [ANN] rst2pdf version 0.8 released Message-ID: <200809121424.08863.ralsina@netmanagers.com.ar> This is a major features release, and a major improvement over 0.7. Perhaps the most important new feature is support for embedding SVG/PS/EPS and several other vector image formats *as vectors* in the PDF output. You can get it via PyPI (package rst2pdf) or from Google Code: http://rst2pdf.googlecode.com Here are some of the features it provides: * User-defined page layout. Multiple frames per page, multiple layouts per document. * Cascading stylesheet mechanism, define only what you want changed * Supports TTF font embedding using a custom stylesheet * Any number of paragraph styles using the class directive * Any number of character styles using text roles * Custom page sizes and margins using a custom stylesheet. * Syntax highlighter for many languages, using Pygments * Supports embedding almost any kind of raster or vector images * Supports hyphenation (using wordaxe) * Full user's manual (PDF version) Here's the changelog for this release: New in 0.8 ---------- * Support for vector graphics: SVG, EPS, PS, CDR and others (requires uniconvertor) * Support for stdin and stdout, so you can use rst2pdf in pipes. * Works with reportlab 2.2 * Simpler stylesheets (guess bulletFontName, leading, bulletFontSize from other parameters) * Some support for sphinx * Fixed the docutils Writer interface * Fix crash when an image is missing * Support for config file * Font sizes can be expressed in units or % of parent style's size * Larger font size in the default stylesheet -- ("\''/").__..-''"`-. . 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 greno at verizon.net Fri Sep 12 13:39:06 2008 From: greno at verizon.net (Gerry Reno) Date: Fri, 12 Sep 2008 13:39:06 -0400 Subject: [reportlab-users] [ANN] rst2pdf version 0.8 released In-Reply-To: <200809121424.08863.ralsina@netmanagers.com.ar> References: <200809121424.08863.ralsina@netmanagers.com.ar> Message-ID: <48CAA93A.1090109@verizon.net> Roberto, Thanks. I'm going to take a look at it. When I go to the googlecode page though and click on the user manual (PDF version) it tries to open it as a text document. Maybe some mime problem? Regards, Gerry From ralsina at netmanagers.com.ar Fri Sep 12 13:41:28 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 12 Sep 2008 14:41:28 -0300 Subject: [reportlab-users] [ANN] rst2pdf version 0.8 released In-Reply-To: <48CAA93A.1090109@verizon.net> References: <200809121424.08863.ralsina@netmanagers.com.ar> <48CAA93A.1090109@verizon.net> Message-ID: <200809121441.29070.ralsina@netmanagers.com.ar> On Friday 12 September 2008 14:39:06 Gerry Reno wrote: > Roberto, > Thanks. I'm going to take a look at it. > When I go to the googlecode page though and click on the user manual > (PDF version) it tries to open it as a text document. Maybe some mime > problem? Not much I can do, it's google's server :-( I'll change it to my host in a little while, in the meantime, save&open is the solution. -- ("\''/").__..-''"`-. . 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 miuler at gmail.com Fri Sep 12 14:36:41 2008 From: miuler at gmail.com (Hector Miuler Malpica Gallegos) Date: Fri, 12 Sep 2008 13:36:41 -0500 Subject: [reportlab-users] ReportLab + JavaScript Message-ID: <1221244601.2538.4.camel@localhost> Is it possible to embed javascript in a pdf? IncludeJS($script); } }//fin clase $pdf=new PDF_AutoPrint(); $pdf->Open(); $pdf->AliasNbPages(); $pdf->SetTitle('Reporte'); $pdf->AddPage(); $pdf->AutoPrint(true); $pdf->Output(); ?> ???? _\|/_ (O-O) --oOO-(_)-OOo--------------------------- Hector Miuler Malpica Gallegos Universidad Nacional del Callao - Peru Escuela de Ingenieria Electronica usuario registrado #308608 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part Url : From greno at verizon.net Fri Sep 12 21:47:55 2008 From: greno at verizon.net (Gerry Reno) Date: Fri, 12 Sep 2008 21:47:55 -0400 Subject: [reportlab-users] Problem using FAQ example for embedding font Message-ID: <48CB1BCB.4010501@verizon.net> I'm following the example for embedding fonts found here: http://www.reportlab.org/devfaq.html#2.6.1 My module adds this code: folder = os.path.join('addons','l10n_micr','fonts') afmFile = os.path.join(folder, 'GnuMICR.afm') pfbFile = os.path.join(folder, 'GnuMICR.pfb') print 'debug: testing for existence of MICR font files...' if os.path.exists(afmFile): print 'afmFile = '+str(afmFile) if os.path.exists(pfbFile): print 'pfbFile = '+str(pfbFile) justFace = pdfmetrics.EmbeddedType1Face(afmFile, pfbFile) faceName = 'GnuMICR' # pulled from AFM file pdfmetrics.registerTypeFace(justFace) justFont = pdfmetrics.Font('GnuMICR', faceName, 'WinAnsiEncoding') pdfmetrics.registerFont(justFont) When I install this code I get this error: testing for existence of MICR font files... afmFile = addons/l10n_micr/fonts/GnuMICR.afm pfbFile = addons/l10n_micr/fonts/GnuMICR.pfb Fri, 12 Sep 2008 21:37:57 ERROR:web-services:Exception in call: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/tinyerp-server/netsvc.py", line 317, in run r=m(*msg[2:]) File "/usr/lib/python2.5/site-packages/tinyerp-server/service/web_services.py", line 422, in execute return self._execute(db, uid, wiz_id, datas, action, context) File "/usr/lib/python2.5/site-packages/tinyerp-server/service/web_services.py", line 402, in _execute return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context) File "/usr/lib/python2.5/site-packages/tinyerp-server/wizard/__init__.py", line 160, in execute res = self.execute_cr(cr, uid, data, state, context) File "/usr/lib/python2.5/site-packages/tinyerp-server/wizard/__init__.py", line 75, in execute_cr action_res = action(self, cr, uid, data, context) File "/usr/lib/python2.5/site-packages/tinyerp-server/addons/base/module/wizard/wizard_update_module.py", line 57, in _update_module update, add = pooler.get_pool(cr.dbname).get('ir.module.module').update_list(cr, uid) File "/usr/lib/python2.5/site-packages/tinyerp-server/addons/base/module/module.py", line 388, in update_list imp.load_module(name, *imp.find_module(mod_name)) File "/usr/lib/python2.5/site-packages/tinyerp-server/addons/l10n_micr/__init__.py", line 59, in *justFace = pdfmetrics.EmbeddedType1Face(afmFile, pfbFile) <=================== failing here* File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 480, in __init__ self._loadMetrics(afmFileName) File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 541, in _loadMetrics registerEncoding(enc) File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 593, in registerEncoding raise FontError('Encoding "%s" already registered with a different name vector!' % enc.Name) AttributeError: Encoding instance has no attribute 'Name' What does it mean? When I checked the pdfmetrics.py it looks like it is intentionally setting the encoding to None. Does this make sense? Thanks, Gerry -------------- next part -------------- An HTML attachment was scrubbed... URL: From greno at verizon.net Fri Sep 12 21:53:03 2008 From: greno at verizon.net (Gerry Reno) Date: Fri, 12 Sep 2008 21:53:03 -0400 Subject: [reportlab-users] Problem using FAQ example for embedding font In-Reply-To: <48CB1BCB.4010501@verizon.net> References: <48CB1BCB.4010501@verizon.net> Message-ID: <48CB1CFF.9020102@verizon.net> I guess it would be helpful to know I'm using reportlab version 2.0.2 Regards, Gerry From greno at verizon.net Fri Sep 12 22:40:39 2008 From: greno at verizon.net (Gerry Reno) Date: Fri, 12 Sep 2008 22:40:39 -0400 Subject: [reportlab-users] Problem using FAQ example for embedding font In-Reply-To: <48CB1CFF.9020102@verizon.net> References: <48CB1BCB.4010501@verizon.net> <48CB1CFF.9020102@verizon.net> Message-ID: <48CB2827.7060808@verizon.net> Ok, I fixed the bad enc.Name reference. Should be enc.name. It then produces this error: FontError: Encoding "GnuMICREncoding" already registered with a different name vector! I looked in the font afm file and the EncodingScheme is FontSpecific. So is that a problem? Why does that make the module fail? Regards, Gerry From greno at verizon.net Fri Sep 12 23:06:23 2008 From: greno at verizon.net (Gerry Reno) Date: Fri, 12 Sep 2008 23:06:23 -0400 Subject: [reportlab-users] Problem using FAQ example for embedding font In-Reply-To: <48CB2827.7060808@verizon.net> References: <48CB1BCB.4010501@verizon.net> <48CB1CFF.9020102@verizon.net> <48CB2827.7060808@verizon.net> Message-ID: <48CB2E2F.7020102@verizon.net> Talking to myself here since it's late ... :-) I added some more debug and the encodings are different: debug: enc = debug: _encodings[enc.name] = So why is that happening? Regards, Gerry From cito at online.de Sat Sep 13 03:08:11 2008 From: cito at online.de (Christoph Zwerschke) Date: Sat, 13 Sep 2008 09:08:11 +0200 Subject: [reportlab-users] [ANN] rst2pdf version 0.8 released In-Reply-To: <200809121424.08863.ralsina@netmanagers.com.ar> References: <200809121424.08863.ralsina@netmanagers.com.ar> Message-ID: <48CB66DB.1060508@online.de> Roberto Alsina schrieb: > This is a major features release, and a major improvement over 0.7. > Perhaps the most important new feature is support for embedding > SVG/PS/EPS and several other vector image formats *as vectors* > in the PDF output. Great new release, you outdid yourself again! Concerning the manual, maybe add a link to an html version? -- Christoph From marco.bizzarri at gmail.com Sat Sep 13 04:23:23 2008 From: marco.bizzarri at gmail.com (Marco Bizzarri) Date: Sat, 13 Sep 2008 10:23:23 +0200 Subject: [reportlab-users] ReportLab 2.2 has been released In-Reply-To: <48C95047.8000209@chamonix.reportlab.co.uk> References: <48C95047.8000209@chamonix.reportlab.co.uk> Message-ID: <3f0d61c40809130123v56df367cke277c6e700a85b92@mail.gmail.com> On Thu, Sep 11, 2008 at 7:07 PM, Robin Becker wrote: > Version 2.2 of the ReportLab open-source toolkit is out! You find downloads > and src instructions at http://www.reportlab.org/downloads.html. I've a large application, running in Zope 2.8, python 2.3 and reportlab 1.21 >From the reportlab point of view, how hard should it be to port the application to reportlab 2.2? Where should I look to understand the amount of work to migrate? Regards Marco -- Marco Bizzarri http://notenotturne.blogspot.com/ http://iliveinpisa.blogspot.com/ From greno at verizon.net Sat Sep 13 09:53:07 2008 From: greno at verizon.net (Gerry Reno) Date: Sat, 13 Sep 2008 09:53:07 -0400 Subject: [reportlab-users] Problem using FAQ example for embedding font In-Reply-To: <48CB2E2F.7020102@verizon.net> References: <48CB1BCB.4010501@verizon.net> <48CB1CFF.9020102@verizon.net> <48CB2827.7060808@verizon.net> <48CB2E2F.7020102@verizon.net> Message-ID: <48CBC5C3.5030304@verizon.net> I changed this line: justFont = pdfmetrics.Font('GnuMICR', faceName, 'WinAnsiEncoding') to this which makes more sense: justFont = pdfmetrics.Font('GnuMICR', faceName, 'FontSpecific') but now I get this error: Traceback (most recent call last): File "./tinyerp-server.py", line 170, in addons.register_classes() File "/usr/lib/python2.5/site-packages/tinyerp-server/addons/__init__.py", line 250, in register_classes imp.load_module(m, *imp.find_module(m)) File "/usr/lib/python2.5/site-packages/tinyerp-server/addons/l10n_micr/__init__.py", line 64, in justFont = pdfmetrics.Font('GnuMICR', faceName, 'FontSpecific') File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 360, in __init__ self.encoding= getEncoding(encName) File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 652, in getEncoding return _encodings[encName] KeyError: 'FontSpecific' So what can I do to get pdfmetrics.py to process a non-standard single byte font with font specific encoding? Regards, Gerry From greno at verizon.net Sat Sep 13 10:00:59 2008 From: greno at verizon.net (Gerry Reno) Date: Sat, 13 Sep 2008 10:00:59 -0400 Subject: [reportlab-users] Problem using FAQ example for embedding font In-Reply-To: <48CBC5C3.5030304@verizon.net> References: <48CB1BCB.4010501@verizon.net> <48CB1CFF.9020102@verizon.net> <48CB2827.7060808@verizon.net> <48CB2E2F.7020102@verizon.net> <48CBC5C3.5030304@verizon.net> Message-ID: <48CBC79B.1040106@verizon.net> Ok, I try this as well: I changed this line: justFont = pdfmetrics.Font('GnuMICR', faceName, 'WinAnsiEncoding') to this which makes even more sense: justFont = pdfmetrics.Font('GnuMICR', faceName, 'GnuMICREncoding') but now I get this error: testing for existence of MICR font files... afmFile = addons/l10n_micr/fonts/GnuMICR.afm pfbFile = addons/l10n_micr/fonts/GnuMICR.pfb debug: enc = debug: _encodings[enc.name] = Sat, 13 Sep 2008 09:56:15 ERROR:web-services:Exception in call: Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/tinyerp-server/netsvc.py", line 317, in run r=m(*msg[2:]) File "/usr/lib/python2.5/site-packages/tinyerp-server/service/web_services.py", line 422, in execute return self._execute(db, uid, wiz_id, datas, action, context) File "/usr/lib/python2.5/site-packages/tinyerp-server/service/web_services.py", line 402, in _execute return wiz.execute(db, uid, self.wiz_datas[wiz_id], action, context) File "/usr/lib/python2.5/site-packages/tinyerp-server/wizard/__init__.py", line 160, in execute res = self.execute_cr(cr, uid, data, state, context) File "/usr/lib/python2.5/site-packages/tinyerp-server/wizard/__init__.py", line 75, in execute_cr action_res = action(self, cr, uid, data, context) File "/usr/lib/python2.5/site-packages/tinyerp-server/addons/base/module/wizard/wizard_update_module.py", line 57, in _update_module update, add = pooler.get_pool(cr.dbname).get('ir.module.module').update_list(cr, uid) File "/usr/lib/python2.5/site-packages/tinyerp-server/addons/base/module/module.py", line 388, in update_list imp.load_module(name, *imp.find_module(mod_name)) File "/usr/lib/python2.5/site-packages/tinyerp-server/addons/l10n_micr/__init__.py", line 59, in justFace = pdfmetrics.EmbeddedType1Face(afmFile, pfbFile) File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 480, in __init__ self._loadMetrics(afmFileName) File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 541, in _loadMetrics registerEncoding(enc) File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 599, in registerEncoding raise FontError('Encoding "%s" already registered with a different name vector!' % enc.name) FontError: Encoding "GnuMICREncoding" already registered with a different name vector! ???? Regards, Gerry From gherman at darwin.in-berlin.de Mon Sep 15 09:42:23 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 15 Sep 2008 15:42:23 +0200 Subject: [reportlab-users] ReportLab 2.2 has been released In-Reply-To: <48CA02CD.8050503@gmail.com> References: <48C9503D.4060301@chamonix.reportlab.co.uk> <48CA02CD.8050503@gmail.com> Message-ID: <5140AB01-43C1-4B32-AEBA-B6727FC6F68C@darwin.in-berlin.de> Dirk Holtwick: > - There is an "install" section in README.txt and INSTALL.txt. I > think INSTALL.txt should be included into README.txt to avoid > confusion +1 These files nowadays seem to be more and more formatted in ReST, which you can translate to HTML and PDF, BTW. > - CHANGES.txt is more or less a SVN dump. But common users may get > confused. I think the section "NEW FEATURES" of this email would be > more expressive for someone who has to decide if switching to the > new version is appropriate +1 This 460 KB file is likely pretty useless and confusing for most people installing RL and wastes disk space, too. > - You got many Readme's with different filenames like: > "00readme.txt", "README" (in src\reportlab\graphics\barcode), and I > found a second license file (in src\reportlab). There is also a > MANIFEST.in (in src\reportlab) of which I'm not sure if it is needed > in this place. Maybe a little cleanup and renaming/ moving would be > nice to get a consistent naming. Also adding expressive Readmes to / > demos and /tools would be great to give a little overview what the > subprojects are good for +1 > - In the old distribution the doc files (as PDF) where already be > generated - if I remember right? Please add them again, because it > is not trivial to generate them. For many people this will be the > first point where they go to decide if it is an interesting tool. +1 > - The version of setup_egg.py is still "2.2pre". > > - A Windows pre compiled version would be nice, because not all > Python programmers own MS C++ Development Suite (like me :) [Eggs > would solve this problem too ;)] > > And finally you should consider updating your PyPI entry, it is > still version 2.0 ;) http://pypi.python.org/pypi/reportlab/2.0 +1 I'm surprised setup.get_version() needs almost 30 LOCs... But in any case it would be helpful, indeed, if PyPI would list the real version number, because otherwise people cannot make their eggs dependant on 2.2. Maybe RL didn't run the following? python setup.py register Regards, Dinu From belred at gmail.com Mon Sep 15 13:55:56 2008 From: belred at gmail.com (Bryan) Date: Mon, 15 Sep 2008 10:55:56 -0700 Subject: [reportlab-users] headers and footers Message-ID: <38f48f590809151055s4ad44a18u3f1fe4c34c047661@mail.gmail.com> i'm having a really hard time finding information and an example of how to add headers and footers using reportlab. i've read the documentation and searched google for days now and i still have no clue what to do. i would prefer to use the platypus way of coding if i can. can someone please show me a working hello world example of headers and footers? this is what i have so far which isn't much. --- frame = Frame(x1=0*inch, y1=0*inch, width=7.6*inch, height=10.9*inch) mainPage = PageTemplate(frames=frame) section_style = ParagraphStyle('Bullet', fontName='Times-Bold', fontSize=12, leading=30, leftIndent=85, firstLineIndent=40, alignment=TA_LEFT, bulletFontName='Times-Bold', bulletFontSize=12, bulletIndent=85) paragraph_style = ParagraphStyle('Normal', fontName='Times-Roman', fontSize=12, leading=30, leftIndent=85, firstLineIndent=40, alignment=TA_JUSTIFY) story = [] section = 'I.INTRODUCTION' paragraph = 'Paragraph...' story.append(Paragraph(section, section_style)) story.append(Paragraph(paragraph, paragraph_style)) story.append(Paragraph(paragraph, paragraph_style)) buf = StringIO() BaseDocTemplate(buf, pagesize=portrait(letter), pageTemplates=mainPage, leftMargin=72, title='Title', author='Author', showBoundary=0).build(story) open('report.pdf', 'wb').write(buf.getvalue()) thanks, bryan From henning.vonbargen at arcor.de Mon Sep 15 16:58:44 2008 From: henning.vonbargen at arcor.de (henning.vonbargen at arcor.de) Date: Mon, 15 Sep 2008 22:58:44 +0200 (CEST) Subject: [reportlab-users] ANN: wordaxe-0.2.6 released In-Reply-To: References: Message-ID: <25190108.1221512324073.JavaMail.ngmail@webmail10.arcor-online.net> Well, now you ReportLab guys finally managed to bring out a new release and rst2pdf comes up with new releases almost daily... I'm happy to present the release 0.2.6 of the wordaxe hyphenation library: * This new release now supports pyhyphen, which is based on the C library from OpenOffice and works a lot better (at least on my computer) than pyhnj. * Now wordaxe is released under a dual license: You can choose Free BSD or Apache 2.0. * A few bugs have been fixed. * Tested with Python 2.5 and ReportLab 2.2. Should also work with Python 2.4 and RL 2.1. The web-site at http://deco-cow.sourceforge.net/ is not yet updated, but you can download the source from http://sourceforge.net/project/showfiles.php?group_id=105867 The next step will be a new paragraph class which will allow me to fix that nasty splitting bug. Henning From larry.meyn at nasa.gov Mon Sep 15 17:08:04 2008 From: larry.meyn at nasa.gov (Larry Meyn) Date: Mon, 15 Sep 2008 14:08:04 -0700 Subject: [reportlab-users] Figure numbering still broken. Does anyone else see this problem? Message-ID: I've mentioned a few times that figure numbering in captions was broken. No one has ever responded. Does any else see this problem? The class Figure in platypus.figures seems to be using the last chapter of the document. For example, in the ReportLab Userguide.pdf, all the figures are numbered A.x, regardless of what the actual chapter number is. I've fixed this in my copy of platypus.figures by adding "self._getCaptionPara()" to the end of the __init__ function in the class Figures. I don't know if this has drawbacks anywhere else, but it seems to fix the problem. Larry Meyn From andy at reportlab.com Mon Sep 15 17:32:30 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 15 Sep 2008 22:32:30 +0100 Subject: [reportlab-users] ANN: wordaxe-0.2.6 released In-Reply-To: <25190108.1221512324073.JavaMail.ngmail@webmail10.arcor-online.net> References: <25190108.1221512324073.JavaMail.ngmail@webmail10.arcor-online.net> Message-ID: <956003ae0809151432t6b992256j9ca08c3f9ca6119d@mail.gmail.com> 2008/9/15 : > Well, now you ReportLab guys finally managed to bring out a new release > and rst2pdf comes up with new releases almost daily... > > I'm happy to present the release 0.2.6 of the wordaxe hyphenation library: Great work, Henning. Everyone: our next step within RL will probably be a 2.2.1 to fix the various issues caused by 2.2 ;-) Specifically, our commercial package has a few examples and demos which no longer worked due to directory layout assumptions, and we may be able to tidy up the setup scripts and readmes a bit more. After that we'll try to have a good look at hyphenation, rst2pdf, svg import and all the other goodies and try to make sure they can be plugged in easily. - Andy From andy at reportlab.com Mon Sep 15 18:59:33 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 15 Sep 2008 23:59:33 +0100 Subject: [reportlab-users] Figure numbering still broken. Does anyone else see this problem? In-Reply-To: References: Message-ID: <956003ae0809151559m73be4355h3ca8b039c375564a@mail.gmail.com> 2008/9/15 Larry Meyn : > The class Figure in platypus.figures seems to be using the last chapter of > the document. For example, in the ReportLab Userguide.pdf, all the figures > are numbered A.x, regardless of what the actual chapter number is. > I've fixed this in my copy of platypus.figures by adding > "self._getCaptionPara()" to the end of the __init__ function in the class > Figures. I don't know if this has drawbacks anywhere else, but it seems to > fix the problem. I took a look now. It seems the paragraph text in the captions (with the sequencing operations) is somehow getting evaluated later (for all figures) than the instructions to bump the chapter number up. I can't see any harm in your fix so have just committed this - although I haven't fully understood why the problem is happening. -- Andy From ralsina at netmanagers.com.ar Mon Sep 15 20:24:13 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Mon, 15 Sep 2008 21:24:13 -0300 Subject: [reportlab-users] ANN: wordaxe-0.2.6 released In-Reply-To: <25190108.1221512324073.JavaMail.ngmail@webmail10.arcor-online.net> References: <25190108.1221512324073.JavaMail.ngmail@webmail10.arcor-online.net> Message-ID: <200809152124.20914.ralsina@netmanagers.com.ar> On Monday 15 September 2008 17:58:44 henning.vonbargen at arcor.de wrote: > Well, now you ReportLab guys finally managed to bring out a new release > and rst2pdf comes up with new releases almost daily... Weekly, mostly ;-) > I'm happy to present the release 0.2.6 of the wordaxe hyphenation library: > > * This new release now supports pyhyphen, which is based on the C library > from OpenOffice and works a lot better (at least on my computer) than > pyhnj. Great news! Finally spanish hyphenation! It even downloads the dictionaries from the web. That's going to be tricky to support. -- ("\''/").__..-''"`-. . 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 greno at verizon.net Mon Sep 15 21:37:02 2008 From: greno at verizon.net (Gerry Reno) Date: Mon, 15 Sep 2008 21:37:02 -0400 Subject: [reportlab-users] Problem using FAQ example for embedding font In-Reply-To: <48CBC79B.1040106@verizon.net> References: <48CB1BCB.4010501@verizon.net> <48CB1CFF.9020102@verizon.net> <48CB2827.7060808@verizon.net> <48CB2E2F.7020102@verizon.net> <48CBC5C3.5030304@verizon.net> <48CBC79B.1040106@verizon.net> Message-ID: <48CF0DBE.2000209@verizon.net> Gerry Reno wrote: > > File > "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", > line 599, in registerEncoding > raise FontError('Encoding "%s" already registered with a different > name vector!' % enc.name) > FontError: Encoding "GnuMICREncoding" already registered with a > different name vector! > Why this problem happens is because in a container (here TinyERP but could be any) the container itself is initializing the module containing the font registration code and then when the user does an update it causes the initialization to run again which is rather normal. Maybe another way of handling the issue would be that if the font is already registered it should just ignore the subsequent attempts or replace the existing registration with the new registration rather than throwing an exception. Certainly this does not have to be a fatal error. Regards, Gerry From andy at reportlab.com Tue Sep 16 03:31:07 2008 From: andy at reportlab.com (Andy Robinson) Date: Tue, 16 Sep 2008 08:31:07 +0100 Subject: [reportlab-users] Problem using FAQ example for embedding font In-Reply-To: <48CF0DBE.2000209@verizon.net> References: <48CB1BCB.4010501@verizon.net> <48CB1CFF.9020102@verizon.net> <48CB2827.7060808@verizon.net> <48CB2E2F.7020102@verizon.net> <48CBC5C3.5030304@verizon.net> <48CBC79B.1040106@verizon.net> <48CF0DBE.2000209@verizon.net> Message-ID: <956003ae0809160031q54648354y1f93a2cd40d35b44@mail.gmail.com> 2008/9/16 Gerry Reno : > Why this problem happens is because in a container (here TinyERP but could > be any) the container itself is initializing the module containing the font > registration code and then when the user does an update it causes the > initialization to run again which is rather normal. Maybe another way of > handling the issue would be that if the font is already registered it should > just ignore the subsequent attempts or replace the existing registration > with the new registration rather than throwing an exception. Certainly this > does not have to be a fatal error. It's a deliberate safeguard because otherwise people could (and in fact have) attempted to register several different versions of a common font name (e.g. "Helvetica") with different encodings or character sets. We can't just assume the font is the same and this forces the developer to deal with it by picking unique names for unique fonts. The problem is lessened now that we use Unicode everywhere, but I still think developers should be alerted if they are attempting to reuse the same name in a single registry. Also, in a long-running process, we might need to get into 'locking' the structures used by the widths cache while being updated to stop another document suddenly finding a half-initialised font - and I really don't want to start getting into threading issues, I think it's a bug in TinyERP, and since the author of that package is (a) using the name RML without our permission, (b) has never replied to any of our emails asking for modest changes in his web pages and giving due credit, and (c) has never contributed patches or feedback of any kind to our open source package, I'm not inclined to make changes on his behalf or to spend time supporting his users. Sorry, this is not aimed at you in any way. If they changed their code implementing the registerFont tags to use a try/except block, that would solve the problem too - that's what we do in "Genuine RML(tm)" ;-) From andy at reportlab.com Tue Sep 16 08:29:22 2008 From: andy at reportlab.com (Andy Robinson) Date: Tue, 16 Sep 2008 13:29:22 +0100 Subject: [reportlab-users] ANN: wordaxe-0.2.6 released In-Reply-To: <200809152124.20914.ralsina@netmanagers.com.ar> References: <25190108.1221512324073.JavaMail.ngmail@webmail10.arcor-online.net> <200809152124.20914.ralsina@netmanagers.com.ar> Message-ID: <956003ae0809160529i2d50f560v4add4a21f3edfa96@mail.gmail.com> 2008/9/16 Roberto Alsina : >> * This new release now supports pyhyphen, which is based on the C library >> from OpenOffice and works a lot better (at least on my computer) than >> pyhnj. > > Great news! Finally spanish hyphenation! If we're going to refactor or replace paragraph code, we need to either (a) make it easy to plug in or switch the 'wrapping algorithm', or (b) create a Grand Unified Paragraph which does the right things for all languages. My main worry, not having looked at the code yet, is how easily we can create a hybrid para which does all this stuff and also supports Japanese word breaking (which ReportLab can do with the cjkwrap options). We're rendering lots of Asian pages - go to www.hilton.co.jp and click "e-Pamphlet" if you can read katakana ;-) In brief, certain ranges of characters can be assumed to be Asian languages which don't have spaces between the words. Instead of hyphenating, you have characters which are good and bad to end a line on. Henning, have you done anything to do with that? Does the Openoffice extension offer any support for Asian languages? - Andy From dirk.holtwick at gmail.com Tue Sep 16 09:28:53 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Tue, 16 Sep 2008 15:28:53 +0200 Subject: [reportlab-users] ANN: wordaxe-0.2.6 released In-Reply-To: <956003ae0809160529i2d50f560v4add4a21f3edfa96@mail.gmail.com> References: <25190108.1221512324073.JavaMail.ngmail@webmail10.arcor-online.net> <200809152124.20914.ralsina@netmanagers.com.ar> <956003ae0809160529i2d50f560v4add4a21f3edfa96@mail.gmail.com> Message-ID: <48CFB495.8070405@gmail.com> Hi, I didn't have a closer look to the source codes but what I would like most (if it makes sense) is to have the possibility to add something like HTML "­" or Unicode U+00AD into the text informations: If this could be implemented in the paragraph rendering machine the hyphenation could be done outside of Reportlab. In my concrete case regarding Pisa I do not use the Paragraph parser. Instead Pisa directly creates the so called "Fragments". To these fragments I would like to be able to add something like u"beauti\u00adful". Andy, do you think this would be possible and make sense? Dirk Andy Robinson schrieb: > 2008/9/16 Roberto Alsina : >>> * This new release now supports pyhyphen, which is based on the C library >>> from OpenOffice and works a lot better (at least on my computer) than >>> pyhnj. >> Great news! Finally spanish hyphenation! > > If we're going to refactor or replace paragraph code, we need to either > (a) make it easy to plug in or switch the 'wrapping algorithm', or > (b) create a Grand Unified Paragraph which does the right things > for all languages. > > My main worry, not having looked at the code yet, is how easily we can > create a hybrid para which does all this stuff and also supports Japanese > word breaking (which ReportLab can do with the cjkwrap options). We're > rendering lots of Asian pages - go to www.hilton.co.jp and click "e-Pamphlet" > if you can read katakana ;-) > > In brief, certain ranges of characters can be assumed to be > Asian languages which don't have spaces between the words. Instead > of hyphenating, you have characters which are good and bad to end a > line on. > > Henning, have you done anything to do with that? Does the Openoffice > extension offer any support for Asian languages? > > - Andy > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From greno at verizon.net Tue Sep 16 09:29:41 2008 From: greno at verizon.net (Gerry Reno) Date: Tue, 16 Sep 2008 09:29:41 -0400 Subject: [reportlab-users] Problem using FAQ example for embedding font In-Reply-To: <956003ae0809160031q54648354y1f93a2cd40d35b44@mail.gmail.com> References: <48CB1BCB.4010501@verizon.net> <48CB1CFF.9020102@verizon.net> <48CB2827.7060808@verizon.net> <48CB2E2F.7020102@verizon.net> <48CBC5C3.5030304@verizon.net> <48CBC79B.1040106@verizon.net> <48CF0DBE.2000209@verizon.net> <956003ae0809160031q54648354y1f93a2cd40d35b44@mail.gmail.com> Message-ID: <48CFB4C5.6070004@verizon.net> Andy Robinson wrote: > 2008/9/16 Gerry Reno : > >> Why this problem happens is because in a container (here TinyERP but could >> be any) the container itself is initializing the module containing the font >> registration code and then when the user does an update it causes the >> initialization to run again which is rather normal. Maybe another way of >> handling the issue would be that if the font is already registered it should >> just ignore the subsequent attempts or replace the existing registration >> with the new registration rather than throwing an exception. Certainly this >> does not have to be a fatal error. >> > > It's a deliberate safeguard because otherwise people could (and in > fact have) attempted to register several different versions of a > common font name (e.g. "Helvetica") with different encodings or > character sets. We can't just assume the font is the same and this > forces the developer to deal with it by picking unique names for > unique fonts. > > The problem is lessened now that we use Unicode everywhere, but I > still think developers should be alerted if they are attempting to > reuse the same name in a single registry. Also, in a long-running > process, we might need to get into 'locking' the structures used by > the widths cache while being updated to stop another document suddenly > finding a half-initialised font - and I really don't want to start > getting into threading issues, > > I think it's a bug in TinyERP, and since the author of that package is > (a) using the name RML without our permission, (b) has never replied > to any of our emails asking for modest changes in his web pages and > giving due credit, and (c) has never contributed patches or feedback > of any kind to our open source package, I'm not inclined to make > changes on his behalf or to spend time supporting his users. Sorry, > this is not aimed at you in any way. > > If they changed their code implementing the registerFont tags to use a > try/except block, that would solve the problem too - that's what we do > in "Genuine RML(tm)" ;-) > I don't think that TinyERP had any malicious intent when they started developing their own RML parser. And RML actually sounds like HTML, XML, which most people associate with being a term that just describes generically a type of document language. I would have never guessed that RML (Report Markup Language) was anyone's trademark. Now, I do agree with you that the TinyERP author should have corresponded with you and come to some type of consensus and agreement as to how to make clear that RML was a ReportLab product and that maybe TRML would be their implementation. And bug fixes and enhancements to open source code should be being contributed between both parties. The fact that you've had zero response from Tiny is not good and I would hope that for the sake of both packages that some congenial conversation can take place. BTW, Tiny has done much to raise awareness of RML which does actually benefit ReportLab and I think that should also be recognized. Anyway, I'm not defending the lack of communication from Tiny but just want to set some perspective for both ReportLab and Tiny users who may read this. And given the background, thanks for taking the time to reply to my problem. Regards, Gerry From IStevens at globeandmail.com Tue Sep 16 15:41:10 2008 From: IStevens at globeandmail.com (Stevens, Ian) Date: Tue, 16 Sep 2008 15:41:10 -0400 Subject: [reportlab-users] Bar chart with configurable date axis Message-ID: I have a bar chart which colors bars for negative values red and bars for positive values green. Essentially following http://two.pairlist.net/pipermail/reportlab-users/2002-July/000133.html but with other values as None, not zero, as zero-length bars were being drawn and overlapping the one data bar. Each category now represents a date and I have populated categoryNames to reflect that. I want dates to appear for only January, which I've done. However, the ticks still appear for the other date categories. Is there any way to control tick display for unnamed categories or, better yet, is there a better way to create a bar chart with a configurable date axis? thanks, Ian. -------------- next part -------------- An HTML attachment was scrubbed... URL: From henning.vonbargen at arcor.de Tue Sep 16 17:18:33 2008 From: henning.vonbargen at arcor.de (henning.vonbargen at arcor.de) Date: Tue, 16 Sep 2008 23:18:33 +0200 (CEST) Subject: [reportlab-users] ANN: wordaxe-0.2.6 released Message-ID: <14039546.1221599913337.JavaMail.ngmail@webmail19.arcor-online.net> (This is a single reply to several posts) Roberto Alsina wrote: >It even downloads the dictionaries from the web. > That's going to be tricky to support. It's a feature of pyhyphen. You don't have to use it, of course. In order to change this behaviour, you could change the download URL in the file lib/site-package/hyphen/config.py: # default_dic_path = 'c:\python25\lib\site-packages\hyphen' # default_repository = 'http://ftp.services.openoffice.org/pub/OpenOffice.org/contrib/dictionaries/' default_repository = 'disabled://auto-download/of/dictionary-files/from/OOO' ------------- Andy Robinson wrote: > If we're going to refactor or replace paragraph code, we need to either > (a) make it easy to plug in or switch the 'wrapping algorithm', or > (b) create a Grand Unified Paragraph which does the right things > for all languages. It would be a small step for you but a great step for developer-kind if at least the Paragraph class was more object-oriented. The current implementation uses a bunch of private functions that are NOT part of the Paragraph class - which requires to code duplication in derived classes: In the current wordaxe/rl/paragraph.py, I had to copy quite a lot of reportlab/platypus/paragraph.py just because I needed a modified "join" function. It would really help a lot if these helper functions could be made (static) methods of the Paragraph class, which would allow to modify them in a derived class. Whether (a) or (b) ... both options seem difficult. But the slight refactoring I proposed above wouldn't hurt anyway. And perhaps it's not only the wrapping algorithm. Other languages are right-to-left (or even top-down, then left-to-right) So the concept of a "line" could be horizontal or vertical... The next thing to consider for refactoring is string/unicode. The current implementation mixes them more or less freely, which complicates things a bit. For Python 3 there will be no choice anyway (I think), 'cause unicode will be the default to represent text. Some time ago, there were concerns about memory consumption, but frankly I don't think it's an issue - the Python overhead (__dict__, ref counting and so on) outweighs it anyway in most cases. So, why not turn everything into unicode at the paraparser level and then encode to 8-bit only when actually writing the PDF? If not for RL 2.2.1, then you should schedule it for one of the next RL releases. > My main worry, not having looked at the code yet, is how easily we can > create a hybrid para which does all this stuff and also supports Japanese > word breaking (which ReportLab can do with the cjkwrap options). We're > rendering lots of Asian pages - go to www.hilton.co.jp and click "e-Pamphlet" > if you can read katakana ;-) Unfortunately, my katakana and hiragana knowledge is somewhat limited ;-) There could well be two or more variations (read: classes) of a "Paragraph" which differ in * parsing (while RL understands a subset of HTML, another class could parse Wiki markup or whatever) * line-breaking * reading direction * rendering * splitting Most of this could be handled by mixin classes. This would require well-documented interfaces/data structures, however. For example, a SimpleParagraph might just accept text without layout tags (resulting in fast processing and small PDFs), while another paragraph class uses classic parsing, CJK-wrapping and the full-blown-up renderer. Note: The RL current paragraph.py implementation already uses different "renderers" internally. Though probably all this is not going to be easy, it should be possible to go there step by step, where the first steps should be documentation and the OO-refactoring I mentioned above. > > In brief, certain ranges of characters can be assumed to be > Asian languages which don't have spaces between the words. Instead > of hyphenating, you have characters which are good and bad to end a > line on. > > Henning, have you done anything to do with that? No. But wordaxe.rl.paragraph uses the CJK code from reportlab.platypus.paragraph. > Does the Openoffice extension offer any support for Asian languages? I don't know. ----------------------------------- Dirk Holtwick wrote: > I didn't have a closer look to the source codes but what I would like > most (if it makes sense) is to have the possibility to add something > like HTML "­" or Unicode U+00AD into the text informations: > The Hyphenator classes in wordaxe should support pre-hyphenated words (containing SHY) out-of-the box. However, AFAIK the ReportLab parser doesn't support the "shy" entity. Should be easy for ReportLab to *optionally* support it in the parser, though. Optionally, because you don't want it unless the line-breaking algorithm support it. Note: the SHY character should be ignored by the width calculation code. > If this could be implemented in the paragraph rendering machine the > hyphenation could be done outside of Reportlab. This is not quite true, cause there is that funny "non-standard hyphenation". Adding SHY characters and hiding them where not needed is not sufficient for these cases. Fortunately, for the German language, these non-standard cases disappeared with the "Rechtschreibreform", but imagine the compound word "Schiffahrt" in the old days. The correct hyphenation was "Schiff-fahrt" (one of the 'f's appearing only if the word is wrapped). Such non-standard-cases still exist in other languages (i.e. english: "eighteen" becomes "eight-teen" when wrapped). > In my concrete case regarding Pisa I do not > use the Paragraph parser. Instead Pisa directly creates the so called > "Fragments". To these fragments I would like to be able to add something > like u"beauti\u00adful". > Andy, do you think this would be possible and make sense? Hmm, the frag structure is not well documented, so I don't quite like the idea. But you are in the same situation here as I am with wordaxe... BTW It seems one of the reasons wordaxe fails after splitting is because frags are converted to another internal structure and then back again during the splitting process, and by hyphenating a word this conversion produces wrong results. And I finally gave up trying to understand this conversion process... Maybe Andy can see what's going wrong at a glance? The effect is visible in the second frame of test_frames3.pdf in wordaxe's test suite. From greno at verizon.net Tue Sep 16 18:06:18 2008 From: greno at verizon.net (Gerry Reno) Date: Tue, 16 Sep 2008 18:06:18 -0400 Subject: [reportlab-users] Problem using FAQ example for embedding font In-Reply-To: <48CFB4C5.6070004@verizon.net> References: <48CB1BCB.4010501@verizon.net> <48CB1CFF.9020102@verizon.net> <48CB2827.7060808@verizon.net> <48CB2E2F.7020102@verizon.net> <48CBC5C3.5030304@verizon.net> <48CBC79B.1040106@verizon.net> <48CF0DBE.2000209@verizon.net> <956003ae0809160031q54648354y1f93a2cd40d35b44@mail.gmail.com> <48CFB4C5.6070004@verizon.net> Message-ID: <48D02DDA.9080002@verizon.net> Ok, I made a lot of progress but still not quite there with embedding a 'FontSpecific' font. I took everything out of the container and am running it standalone from command line. Here is the problem: ================================================================== # python /tmp/test.py _encodings = {} _encodings = {'ZapfDingbatsEncoding': } _encodings = {'SymbolEncoding': , 'ZapfDingbatsEncoding': } _encodings = {'SymbolEncoding': , 'ZapfDingbatsEncoding': , 'WinAnsiEncoding': } testing for existence of MICR font files... afmFile = /usr/share/fonts/default/Type1/GnuMICR.afm pfbFile = /usr/share/fonts/default/Type1/GnuMICR.pfb justFace = pdfmetrics.EmbeddedType1Face(afmFile, pfbFile) pdfmetrics.registerTypeFace(justFace) justFont = pdfmetrics.Font('GnuMICR', faceName, 'GnuMICREncoding') _encodings = {'GnuMICREncoding': , 'SymbolEncoding': , 'ZapfDingbatsEncoding': , 'WinAnsiEncoding': } pdfmetrics.registerFont(justFont) _encodings = {'GnuMICREncoding': , 'SymbolEncoding': , 'ZapfDingbatsEncoding': , 'WinAnsiEncoding': } _encodings = {'GnuMICREncoding': , 'SymbolEncoding': , 'ZapfDingbatsEncoding': , 'WinAnsiEncoding': } Traceback (most recent call last): File "/tmp/test.py", line 72, in form.draw_micr() File "/tmp/test.py", line 64, in draw_micr t.textOut("A1234567890A ABCD") File "/usr/lib/python2.5/site-packages/reportlab/pdfgen/textobject.py", line 353, in textOut self._x = self._x + self._canvas.stringWidth(text, self._fontname, self._fontsize) File "/usr/lib/python2.5/site-packages/reportlab/pdfgen/canvas.py", line 1283, in stringWidth return pdfmetrics.stringWidth(text, fontName, fontSize) File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 721, in _py_stringWidth return getFont(fontName).stringWidth(text, fontSize, encoding=encoding) File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 402, in _py_stringWidth return sum([sum(map(f.widths.__getitem__,map(ord,t))) for f, t in unicode2T1(text,[self]+self.substitutionFonts)])*0.001*size File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 49, in _py_unicode2T1 R.append((font,utext.encode(enc))) LookupError: unknown encoding: GnuMICREncoding ================================================================== Here is the code: ================================================================== # cat /tmp/test.py #!/usr/env/python import os import reportlab from reportlab.pdfbase import pdfmetrics from reportlab.pdfgen.canvas import Canvas from reportlab.lib.pagesizes import letter, A4 from reportlab.lib.units import cm, inch Courier = 'Courier' Helvetica = 'Helvetica' Helvetica_Bold = 'Helvetica-Bold' Helvetica_Bold_Oblique = 'Helvetica-BoldOblique' GnuMICR = 'GnuMICR' class Form: def __init__(self, **kw): self.pdfpath = kw.get('pdfpath', 'test.pdf') self.verbose = kw.get('verbose', 0) self.text_font = kw.get('typeface', Helvetica) self.text_size = kw.get('fontsize', 10) self.pagewidth, self.pageheight = letter # keep for later self.canvas = Canvas(self.pdfpath, pagesize=letter) def draw_micr(self): # folder = os.path.dirname(reportlab.__file__) + os.sep + 'fonts' folder = os.path.dirname('/usr/share/fonts/default/Type1/') # folder = os.path.join('addons','l10n_micr','fonts') afmFile = os.path.join(folder, 'GnuMICR.afm') pfbFile = os.path.join(folder, 'GnuMICR.pfb') print 'testing for existence of MICR font files...' if os.path.exists(afmFile): print 'afmFile = '+str(afmFile) if os.path.exists(pfbFile): print 'pfbFile = '+str(pfbFile) print "justFace = pdfmetrics.EmbeddedType1Face(afmFile, pfbFile)" justFace = pdfmetrics.EmbeddedType1Face(afmFile, pfbFile) faceName = 'GnuMICR' # pulled from AFM file print "pdfmetrics.registerTypeFace(justFace)" pdfmetrics.registerTypeFace(justFace) # justFont = pdfmetrics.Font('GnuMICR', faceName, 'WinAnsiEncoding') # justFont = pdfmetrics.Font('GnuMICR', faceName, 'FontSpecific') print "justFont = pdfmetrics.Font('GnuMICR', faceName, 'GnuMICREncoding')" justFont = pdfmetrics.Font('GnuMICR', faceName, 'GnuMICREncoding') print "pdfmetrics.registerFont(justFont)" try: pdfmetrics.registerFont(justFont) except AttributeError, e: print "Check variable spelling for enc.name", e except FontError, e: print "Warning: ", e # # Change this to UTF-8 if you plan tu use Reportlab's UTF-8 support # # reportlab use "code page 1252" encoding by default. cfr reportlab user guide p.46 ### encoding = 'utf-8' c = self.canvas t = c.beginText(72, 58) t.setFont("GnuMICR", 12) # t.setFont("Helvetica", 12) t.textOut("A1234567890A ABCD") c.drawText(t) c.save() if __name__ == '__main__': import test form = Form() form.draw_micr() ================================================================== I can see that it has the GnuMICREncoding registered but for some reason it still fails. Regards, Gerry From greno at verizon.net Tue Sep 16 21:39:48 2008 From: greno at verizon.net (Gerry Reno) Date: Tue, 16 Sep 2008 21:39:48 -0400 Subject: [reportlab-users] Problem using FAQ example for embedding font In-Reply-To: <48D02DDA.9080002@verizon.net> References: <48CB1BCB.4010501@verizon.net> <48CB1CFF.9020102@verizon.net> <48CB2827.7060808@verizon.net> <48CB2E2F.7020102@verizon.net> <48CBC5C3.5030304@verizon.net> <48CBC79B.1040106@verizon.net> <48CF0DBE.2000209@verizon.net> <956003ae0809160031q54648354y1f93a2cd40d35b44@mail.gmail.com> <48CFB4C5.6070004@verizon.net> <48D02DDA.9080002@verizon.net> Message-ID: <48D05FE4.6040506@verizon.net> The error was a codec issue. No 'gnumicr' in rl_codecs.py. So I selected another encoding that had the same mapping 'WinAnsiEncoding' and this solved the problem. Regards, Gerry From reportlab at richardshea.fastmail.fm Wed Sep 17 01:18:48 2008 From: reportlab at richardshea.fastmail.fm (reportlab at richardshea.fastmail.fm) Date: Wed, 17 Sep 2008 17:18:48 +1200 Subject: [reportlab-users] test_pdfgen_general.py fails on UnicodeEncodeError ? Message-ID: <1221628728.2639.1274398093@webmail.messagingengine.com> Hi - I've just installed Reportlab 2.1 and am have problems with the test_pdfgen_general.py - stacktrace at bottom of message. I have two versions of Python installed on the same machine and both have reportlab installed in them (I've only just today installed the Python 2.5 and associated packages). As can be seen in the stack trace somehow the test_pdfgen_general.py run under 2.5 is trying to make use of the reportlab installation installed under 2.4.1. Can anyone explain why ? If necessary I can de-install Reportlab from the 2.4.1 installation - how would I do that - just delete the E:\bin\ installed\ Python2.4.1\ lib\ site-packages\ reportlab directory ? Any help appreciated. E:\bin\installed\Python2.5\reportlab_2_1\reportlab\test>python test_pdfgen_general.py E ====================================================================== ERROR: Make a PDFgen document with most graphics features ---------------------------------------------------------------------- Traceback (most recent call last): File "test_pdfgen_general.py", line 833, in test0 run(outputfile('test_pdfgen_general.pdf')) File "test_pdfgen_general.py", line 799, in run c.save() File "E:\bin\installed\Python2.4.1\lib\site-packages\reportlab\pdfgen\canvas.py", line 843, in save self._doc.SaveToFile(self._filename, self) File "E:\bin\installed\Python2.4.1\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 218, in SaveToFile f.write(self.GetPDFData(canvas)) File "E:\bin\installed\Python2.4.1\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 233, in GetPDFData self.info.digest(self.signature) File "E:\bin\installed\Python2.4.1\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 1319, in digest md5object.update(str(x)) UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 1: ordinal not in range(128) ---------------------------------------------------------------------- Ran 1 test in 2.141s FAILED (errors=1) Regards Richard. From andy at reportlab.com Wed Sep 17 01:33:15 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 17 Sep 2008 06:33:15 +0100 Subject: [reportlab-users] Problem using FAQ example for embedding font In-Reply-To: <48CFB4C5.6070004@verizon.net> References: <48CB1BCB.4010501@verizon.net> <48CB1CFF.9020102@verizon.net> <48CB2827.7060808@verizon.net> <48CB2E2F.7020102@verizon.net> <48CBC5C3.5030304@verizon.net> <48CBC79B.1040106@verizon.net> <48CF0DBE.2000209@verizon.net> <956003ae0809160031q54648354y1f93a2cd40d35b44@mail.gmail.com> <48CFB4C5.6070004@verizon.net> Message-ID: <956003ae0809162233k1ae71cc7k7d8e6e8a2f96493f@mail.gmail.com> 2008/9/16 Gerry Reno : > RML actually sounds like HTML, XML, > which most people associate with being a term that just describes > generically a type of document language. I would have never guessed that RML > (Report Markup Language) was anyone's trademark. Google it and look at the little (tm) in the top search result ;-) - Andy From andy at reportlab.com Wed Sep 17 01:55:16 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 17 Sep 2008 06:55:16 +0100 Subject: [reportlab-users] ANN: wordaxe-0.2.6 released In-Reply-To: <14039546.1221599913337.JavaMail.ngmail@webmail19.arcor-online.net> References: <14039546.1221599913337.JavaMail.ngmail@webmail19.arcor-online.net> Message-ID: <956003ae0809162255g49e1c16frf0a0f37eea303e75@mail.gmail.com> 2008/9/16 : > It would be a small step for you but a great step for developer-kind > if at least the Paragraph class was more object-oriented. > The current implementation uses a bunch of private functions that are > NOT part of the Paragraph class - which requires to code duplication > in derived classes: You're right. We should at least be able to put all those functions into methods with a leading underscore in an hour or two, and I doubt it would affect performance. We'll tackle this as a high priority. > Other languages are right-to-left (or even top-down, then left-to-right) Yes, we haven't tackled those yet. > So, why not turn everything into unicode at the paraparser level > and then encode to 8-bit only when actually writing the PDF? > If not for RL 2.2.1, then you should schedule it for one of the next > RL releases. Agreed. We didn't due to lack of time. > There could well be two or more variations (read: classes) of a "Paragraph" > which differ in > * parsing (while RL understands a subset of HTML, > another class could parse Wiki markup or whatever) > * line-breaking > * reading direction > * rendering > * splitting > Most of this could be handled by mixin classes. > This would require well-documented interfaces/data structures, however. Yes. Another thing I want to tackle is use of epydoc / sphinx to define the "official interface" to our package, BTW. > For example, a SimpleParagraph might just accept text without layout > tags (resulting in fast processing and small PDFs), > while another paragraph class uses classic parsing, CJK-wrapping and > the full-blown-up renderer. > Though probably all this is not going to be easy, > it should be possible to go there step by step, where the first steps > should be documentation and the OO-refactoring I mentioned above. I agree 100%. Its a few weeks off internally for resource reasons, but if you want to submit a refactored paragraph.py any sooner which leaves our test suite still working, we'd be eternally grateful. Our energies are still going into sideeffects of the tree rearrangement, and then we have a new site to launch which will support the user group a lot better. With our usual 102% of developer time going into customer projects, that might mean a few weeks before we get onto paragraphs or anything else "not obviously crashing"! - Andy From gherman at darwin.in-berlin.de Wed Sep 17 08:35:49 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed, 17 Sep 2008 14:35:49 +0200 Subject: [reportlab-users] ANN: pdfsplit 0.4.2 Message-ID: <8FD11490-077A-4609-8510-90D5B74C692F@darwin.in-berlin.de> Hi, I'm announcing here the first of a series of little PDF handling tools I wrote to work with PDF files. This one is named "pdfsplit" and is itself not based on ReportLab (only the test PDF is created with RL), but might be useful for people on this list as well. Instead it is based on PyPDF, which allows to write pretty smart tests that actually check assertions on the text content of the generated PDF documents (see test suite). You should be able to easy_install "pdfsplit" and lookup details in the Python Package Index: http://pypi.python.org/pypi/pdfsplit I hope this will be useful for others as well. Comments are welcome! Regards, Dinu From gherman at darwin.in-berlin.de Wed Sep 17 13:05:56 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed, 17 Sep 2008 19:05:56 +0200 Subject: [reportlab-users] ReportLab 2.2 missing in PyPI In-Reply-To: <5140AB01-43C1-4B32-AEBA-B6727FC6F68C@darwin.in-berlin.de> References: <48C9503D.4060301@chamonix.reportlab.co.uk> <48CA02CD.8050503@gmail.com> <5140AB01-43C1-4B32-AEBA-B6727FC6F68C@darwin.in-berlin.de> Message-ID: <2B67E94E-4C1B-49C2-B56C-656D0D5D7710@darwin.in-berlin.de> I wrote: > But in any case it would be helpful, indeed, if PyPI would list > the real version number, because otherwise people cannot make > their eggs dependant on 2.2. Maybe RL didn't run the following? Sorry for nagging, again! I can see no evidence in PyPI of a regi- stration for RL 2.2. The last and only version says, it's 2.0. And there is no download link, there are no uploaded packages or eggs. This makes it difficult to establish dependencies. All that needs to be done to solve this seems to run the following in your distro folder: python setup.py register python setup.py sdist upload python setup.py bdist_egg upload (with "python" replaced by different Python versions, if you like). I'm deliberately ignoring any Windows issues here, but still would appreciate to see a working registration for all others. Regards, Dinu From dirk.holtwick at gmail.com Wed Sep 17 14:25:38 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Wed, 17 Sep 2008 20:25:38 +0200 Subject: [reportlab-users] ANN: wordaxe-0.2.6 released In-Reply-To: <14039546.1221599913337.JavaMail.ngmail@webmail19.arcor-online.net> References: <14039546.1221599913337.JavaMail.ngmail@webmail19.arcor-online.net> Message-ID: <48D14BA2.9090809@gmail.com> henning.vonbargen at arcor.de schrieb: > This is not quite true, cause there is that funny > "non-standard hyphenation". > Adding SHY characters and hiding them where not needed is not > sufficient for these cases. > Fortunately, for the German language, these non-standard cases > disappeared with the "Rechtschreibreform", but imagine the compound > word "Schiffahrt" in the old days. The correct hyphenation was > "Schiff-fahrt" (one of the 'f's appearing only if the word is wrapped). > Such non-standard-cases still exist in other languages > (i.e. english: "eighteen" becomes "eight-teen" when wrapped). I see. So it could still be a possible approach to pass text fragments as tuples like: [("Schifffahrt", ""), ("Schiff-", "fahrt")] to a future paragraph implementation and let it choose which one fits best. Thanks for explaining. Dirk From andy at reportlab.com Wed Sep 17 14:41:57 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 17 Sep 2008 19:41:57 +0100 Subject: [reportlab-users] ANN: wordaxe-0.2.6 released In-Reply-To: <48D14BA2.9090809@gmail.com> References: <14039546.1221599913337.JavaMail.ngmail@webmail19.arcor-online.net> <48D14BA2.9090809@gmail.com> Message-ID: <956003ae0809171141p1de6d5cdg22f2a67264a0547a@mail.gmail.com> 2008/9/17 Dirk Holtwick : > henning.vonbargen at arcor.de schrieb: >> Such non-standard-cases still exist in other languages >> (i.e. english: "eighteen" becomes "eight-teen" when wrapped). Wow. I thought I had a good education in English, but had never noticed this spelling change before. (A non-native sitting next to me agrees - at a hyphenation point, each fragment should be a proper self-contained syllable). - Andy From DJESSUP at usnews.com Wed Sep 17 16:36:23 2008 From: DJESSUP at usnews.com (Jessup, David) Date: Wed, 17 Sep 2008 16:36:23 -0400 Subject: [reportlab-users] Python ReportLab use of splitfirst/splitlast Message-ID: <97886A555FD8E14E8F7445D75C11D54DD2DF51@EXCHANGE.usn.root.ent> I'm trying to use Python with ReportLab 2.2 to create a PDF report. According to the user guide at http://www.reportlab.com/docs/userguide.pdf, > Special TableStyle Indeces [sic] > > In any style command the first row index may be set to one of the > special strings 'splitlast' or 'splitfirst' to indicate that the > style should be used only for the last row of a split table, or the > first row of a continuation. This allows splitting tables with nicer > effects around the split. I've tried to use splitfirst to create some special formatting for the first row on a page: main_table.setStyle(TableStyle([ ('TEXTCOLOR', (0, 'splitfirst'), (1, 0), colors.black), ])) and it breaks with the message: > Traceback (most recent call last): > File "./photo_payments_report.py", line 307, in > pdfize_data(data=payment_data, output_filename=output_filename) > File "./photo_payments_report.py", line 128, in pdfize_data > ('TEXTCOLOR', (0, 'splitfirst'), (1, 0), colors.black), > File "/usr/local/lib/python2.5/site-packages/reportlab/platypus/tables.py", line 931, in setStyle > self._addCommand(cmd) > File "/usr/local/lib/python2.5/site-packages/reportlab/platypus/tables.py", line 992, in _addCommand > for i in xrange(sr, er+1): > TypeError: an integer is required Is this functionality simply broken or am I doing something wrong? If the latter, what am I doing wrong? From dirk.holtwick at gmail.com Thu Sep 18 01:54:25 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Thu, 18 Sep 2008 07:54:25 +0200 Subject: [reportlab-users] Bug: KeepWithNext and multiBuild Message-ID: <48D1ED11.4000805@gmail.com> Hi, since there is no issue tracker or wiki I fill this bug I found here ;) The "keepWithNext" functionality of Flowables does not work if document is created with "multiBuild". For example if you use a TOC in your document this error will occur. BTW adding this scenario to the tests would be useful I suppose. Thanks Dirk From andy at reportlab.com Thu Sep 18 08:37:21 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 18 Sep 2008 13:37:21 +0100 Subject: [reportlab-users] Bug: KeepWithNext and multiBuild In-Reply-To: <48D1ED11.4000805@gmail.com> References: <48D1ED11.4000805@gmail.com> Message-ID: <956003ae0809180537g6951d5c1m4b9b2effc6631769@mail.gmail.com> 2008/9/18 Dirk Holtwick : > Hi, > > since there is no issue tracker or wiki I fill this bug I found here ;) That's still the Correct Official Procedure. You'll get the tracker soon though. > The "keepWithNext" functionality of Flowables does not work if document is > created with "multiBuild". For example if you use a TOC in your document > this error will occur. BTW adding this scenario to the tests would be useful > I suppose. We're looking at this, thanks. - Andy From arkadi at smartbit.be Thu Sep 18 10:42:51 2008 From: arkadi at smartbit.be (Arkadi Colson) Date: Thu, 18 Sep 2008 16:42:51 +0200 Subject: [reportlab-users] tables in frames on multiple pages with variable data Message-ID: <48D268EB.6030401@smartbit.be> Hi, Is it possible with reportlab to create a pdf with the following structure: I have a large xml file with a lot of sections. Each section contains a header, footer and content which are having all different data. So I have to parse the xml file and then my question comes: which method do I have to use to create the document? Canvas? -> Is it possible to say to use next page? or Doc.build? -> Can I use frames with this method? Best regards. Arkadi From schwarz.emanuel at gmail.com Thu Sep 18 19:57:03 2008 From: schwarz.emanuel at gmail.com (Emanuel Schwarz) Date: Fri, 19 Sep 2008 01:57:03 +0200 Subject: [reportlab-users] Table - how to let it use all available space? Message-ID: <48D2EACF.7020300@gmail.com> Hello, Is there a easy way to let a Table use the whole width of a Frame? I'd like to simply tell it which column to expand if theres space left. This would also be nice for heights... Thanks, Emanuel From alsadi at gmail.com Thu Sep 18 20:04:32 2008 From: alsadi at gmail.com (Muayyad AlSadi) Date: Fri, 19 Sep 2008 03:04:32 +0300 Subject: [reportlab-users] OpenType fonts and right to left scripts Message-ID: <385866f0809181704r72facb21wbbfb2dc330a5ef44@mail.gmail.com> Hi, this is my first post to this mailing list I want to ask about OpenType fonts support in reportlab http://en.wikipedia.org/wiki/OpenType http://partners.adobe.com/public/developer/opentype/index_layout.html http://www.microsoft.com/typography/otfntdev/arabicot/features.aspx and about the CTL support and BiDi (bidirectional support) in reportlab http://en.wikipedia.org/wiki/Complex_text_layout because I try it and failed to produce good Arabic text PDF I noticed that openoffice have dependency on libICU and it produces good arabic PDFs, it the support is not planned in near future where should I add a layer that calls icu or fribidi to fix it I'm looking forward to put our hands together to make it work. From gherman at darwin.in-berlin.de Fri Sep 19 04:55:17 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 19 Sep 2008 10:55:17 +0200 Subject: [reportlab-users] headers and footers In-Reply-To: <38f48f590809151055s4ad44a18u3f1fe4c34c047661@mail.gmail.com> References: <38f48f590809151055s4ad44a18u3f1fe4c34c047661@mail.gmail.com> Message-ID: <9B3060B5-6345-450A-A163-0828DBB59D53@darwin.in-berlin.de> Bryan: > i'm having a really hard time finding information and an example of > how to add headers and footers using reportlab. i've read the > documentation and searched google for days now and i still have no > clue what to do. i would prefer to use the platypus way of coding if > i can. can someone please show me a working hello world example of > headers and footers? > > this is what i have so far which isn't much. Hi Brian, could you elaborate on what kind of information you want to appear in the headers and footers, please? I assume, you want something like titles for paragraph with a certain (headline) style, right? This is a bit tricky, but I can surely dig out an example on my disk if this is what you want. If you only want some more "static" info to appear in these places you can use the approach shown in the demo file dodyssey.py in the standard RL distribution, although it follows the pretty typical less-clear-then-it-could-be ReportLab style. ;-) BTW, if you want people to run the code you post here, it should be executable without cauing them further work, e.g. for adding the imports etc. Regards, Dinu From andy at reportlab.com Fri Sep 19 04:59:48 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 19 Sep 2008 09:59:48 +0100 Subject: [reportlab-users] headers and footers In-Reply-To: <9B3060B5-6345-450A-A163-0828DBB59D53@darwin.in-berlin.de> References: <38f48f590809151055s4ad44a18u3f1fe4c34c047661@mail.gmail.com> <9B3060B5-6345-450A-A163-0828DBB59D53@darwin.in-berlin.de> Message-ID: <956003ae0809190159gf21cf76h735cd1310ee0f73c@mail.gmail.com> 2008/9/19 Dinu Gherman : > If you only want some more "static" info to appear in these places > you can use the approach shown in the demo file dodyssey.py in the > standard RL distribution, although it follows the pretty typical > less-clear-then-it-could-be ReportLab style. ;-) Yes, it's a real shame nobody ever contributes patches to improve the documentation or examples. We would accept these with great speed and thanks. It is supposed to be open source, after all. ;-) - Andy From gherman at darwin.in-berlin.de Fri Sep 19 05:24:14 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 19 Sep 2008 11:24:14 +0200 Subject: [reportlab-users] Svglib 0.6 to be released soon Message-ID: <7AA4D755-A50A-4BE5-9C2E-34C765DACE23@darwin.in-berlin.de> Hi, I've built a draft release 0.6 of svglib [1], a library for reading and converting SVG to RL Drawing objects, which will be released under GPL 3. So far it has changed from a Python module to a package and contains a huge amount of test cases taken from the W3C. Now I invite people using previous versions of svglib to send me comments, compaints, suggestions, just anything they can think of which they want me to know before I'm releasing it, probably by the end of next week, 2008-09-26. Thanks, Dinu [1] http://python.net/~gherman/svglib.html From gherman at darwin.in-berlin.de Fri Sep 19 05:45:16 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 19 Sep 2008 11:45:16 +0200 Subject: [reportlab-users] headers and footers In-Reply-To: <956003ae0809190159gf21cf76h735cd1310ee0f73c@mail.gmail.com> References: <38f48f590809151055s4ad44a18u3f1fe4c34c047661@mail.gmail.com> <9B3060B5-6345-450A-A163-0828DBB59D53@darwin.in-berlin.de> <956003ae0809190159gf21cf76h735cd1310ee0f73c@mail.gmail.com> Message-ID: Andy Robinson: > Yes, it's a real shame nobody ever contributes patches to improve the > documentation or examples. We would accept these with great speed > and thanks. It is supposed to be open source, after all. ;-) I'm sorry to see you taking my criticism of ReportLab coding style as a personal attack. It wasn't intended to be and it cannot possibly "work" like this, unless you identify com- pletely with the coding or the company or whatever it is. But I can reassure you, you are not your code, and not your company, and not your projects, even if they have the same name. ;-) Back to the formal discussion again: I'm sure you will find an increased level of participation in the community once the necessary infrastructure will be installed. Regards, Dinu -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Fri Sep 19 06:35:58 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 19 Sep 2008 11:35:58 +0100 Subject: [reportlab-users] ReportLab open source policy (was "headers and footers") Message-ID: <956003ae0809190335n259028det73787ff3fc3ecd9a@mail.gmail.com> 2008/9/19 Dinu Gherman : > I'm sorry to see you taking my criticism of ReportLab coding > style as a personal attack. Dinu, it's not a personal attack at all. Sorry if you understood it that way. I know our code base is full of untidy things and could be much, much better if people spent more time on it. People have to understand that at any time there are 2-3 developers within ReportLab theoretically able to work on the core code, but all of our 9 employees are working very, very hard to support large customer solutions which leave us very short of time. We generally have the working code and the features we need. Internally we don't NEED more teaching examples, docs, clearer docstrings etc. internally because we work in RML not Platypus. RML is well documented and has a DTD as a formal API. In fact if we somehow got 10x more open source users asking questions and making suggestions but no more contributors to balance it, it would probably be a bad thing for us as it would dramatically increase the support burden. If people want better teaching examples, updated docs and so on. we really need volunteers to spend time on those things and send them in. I have asked for this many times and we don't usually get those kinds of contributions. Realistically it may move at a snail's pace otherwise because it depends on one of us actually getting a gap in a schedule. There is a subversion repository and a mailing list. That should be all anybody needs to send in patches.; and we'll give commit rights to anyone who sends in a few good patches and earns our trust. I do not personally believe that wikis and trackers will change the dynamics that much, but I'll be delighted if I am proven wrong. For anyone new to this 7-year-old discussion: we would really, really love people to send in test scripts, teaching examples, cleanups of docstrings, changes to manuals etc. This is an easy and safe way to start contributing to any open source project. Just send stuff to the list. Best Regards, Andy Robinson From yroman-reportlab at altalang.com Fri Sep 19 06:57:05 2008 From: yroman-reportlab at altalang.com (Yoann Roman) Date: Fri, 19 Sep 2008 06:57:05 -0400 Subject: [reportlab-users] ReportLab open source policy (was "headers andfooters") In-Reply-To: <956003ae0809190335n259028det73787ff3fc3ecd9a@mail.gmail.com> References: <956003ae0809190335n259028det73787ff3fc3ecd9a@mail.gmail.com> Message-ID: <001601c91a46$7442d660$0502000a@ad.altalang.com> Andy Robinson wrote... > For anyone new to this 7-year-old discussion: we would really, really > love people to send in test scripts, teaching examples, cleanups > of docstrings, changes to manuals etc. This is an easy and safe way > to start contributing to any open source project. Just send stuff to > the list. What's your preferred submission method for patches? I submitted a patch in early September to fix drawImage's anchoring, but I never saw an acknowledgement that it was received or why it would/wouldn't work. I also see the trunk hasn't been updated yet. I completely understand ReportLab developers are busy with client projects, so this is more about finding out how to best assist you and is not a criticism in any way. Thanks for all you already do with RL! -- Yoann Roman From dirk.holtwick at gmail.com Fri Sep 19 07:16:21 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Fri, 19 Sep 2008 13:16:21 +0200 Subject: [reportlab-users] ReportLab open source policy (was "headers and footers") In-Reply-To: <956003ae0809190335n259028det73787ff3fc3ecd9a@mail.gmail.com> References: <956003ae0809190335n259028det73787ff3fc3ecd9a@mail.gmail.com> Message-ID: <48D38A05.2040003@gmail.com> Andy Robinson schrieb: > There is a subversion repository and a mailing list. That should be all > anybody needs to send in patches.; and we'll give commit rights to > anyone who sends in a few good patches and earns our trust. I do not > personally believe that wikis and trackers will change the dynamics > that much, > but I'll be delighted if I am proven wrong. Andy, the Reportlab project is great and useful. But what I see is that because of leak of time you might begin to see the project as a burden. I think you should give it a try and move Reportlab to one of the big project hoster like Google Code, Sourceforge, Launchpad, Berlios and so on. For Google Code I would be happy to support you with that. Maybe there will be not much more supporters for Reportlab but I am sure the quality will raise. Issue trackers, Wikis, SVN branches and so on are useful tools for most of us developers. I would recommend to let all developer in the project that like to contributeo. They can work in the TRUNK and stable, productive and more conservative lines go into the BRANCHES. There are also some big things for the future that Reportlab is facing and maybe has not the time for it. I am thinking about: - Porting to Python 3000 - Implementing SetupTools scripts - New paragraph implementations Since my pisa project depends on Reportlab I would be happy to contribute to it. Thanks again Andy for your effort in making Reportlab a great open source project. I know from my own projects that support is one of the biggest time eating things in such a project ;) Dirk From andy at reportlab.com Fri Sep 19 07:23:30 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 19 Sep 2008 12:23:30 +0100 Subject: [reportlab-users] ReportLab open source policy (was "headers andfooters") In-Reply-To: <001601c91a46$7442d660$0502000a@ad.altalang.com> References: <956003ae0809190335n259028det73787ff3fc3ecd9a@mail.gmail.com> <001601c91a46$7442d660$0502000a@ad.altalang.com> Message-ID: <956003ae0809190423g475a8b09y87f97db6ebf7c93e@mail.gmail.com> 2008/9/19 Yoann Roman : > What's your preferred submission method for patches? For now, email to this list. When our new site is up we will have a tracker and some more formal means to submit them. > I submitted a patch > in early September to fix drawImage's anchoring, but I never saw an > acknowledgement that it was received or why it would/wouldn't work. > I also see the trunk hasn't been updated yet. I remember that one - sorry it didn't make it in, Robin and I were just flat out. I agree with your analysis, BTW - the intent was to position an image within the bounding box. We'll take a look next week. We're probably going to do a 2.2.1 late next week (maybe even put it in PyPi!) as we have made a few more tidy-ups in our commercial package, which needs releasing in sync. > Thanks for all you already do with RL! You're welcome! - Andy From wilk at flibuste.net Fri Sep 19 07:50:39 2008 From: wilk at flibuste.net (William Dode) Date: Fri, 19 Sep 2008 11:50:39 +0000 (UTC) Subject: [reportlab-users] ReportLab open source policy (was "headers and footers") References: <956003ae0809190335n259028det73787ff3fc3ecd9a@mail.gmail.com> Message-ID: On 19-09-2008, Andy Robinson wrote: > For anyone new to this 7-year-old discussion: we would really, really > love people to send in test scripts, teaching examples, cleanups > of docstrings, changes to manuals etc. This is an easy and safe way > to start contributing to any open source project. Just send stuff to > the list. Hi, I also catched a bug and would like to know if it's confirmed and if my workaround will not break something else : http://thread.gmane.org/gmane.comp.python.reportlab.user/7106 More generaly, i hope to see reportlab become fault tolerant. I mean, like html, that a document is every time rendered whenever an error occur. With the example above, the crash append only on somes data, it's very annoying when it's append on the client desk ! But it's very exceptional ! thanks and continue to push us to make the works ! -- William Dod? - http://flibuste.net Informaticien Ind?pendant From andy at reportlab.com Fri Sep 19 08:10:08 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 19 Sep 2008 13:10:08 +0100 Subject: [reportlab-users] ReportLab open source policy (was "headers and footers") In-Reply-To: References: <956003ae0809190335n259028det73787ff3fc3ecd9a@mail.gmail.com> Message-ID: <956003ae0809190510k73139b78y16b81261b51f5007@mail.gmail.com> 2008/9/19 William Dode : > I also catched a bug and would like to know if it's confirmed and if my > workaround will not break something else : > http://thread.gmane.org/gmane.comp.python.reportlab.user/7106 It's logged in our internal system (so is Yoann's now) but I don't think it's fixed yet. Robin's away today. Suggestion: make the subject line of any new message begin with BUG: blah blah BUG?: etc PATCH: etc This makes it much easier for us to scan the messages once or twice a week and ensure everything is logged... - Andy From ralsina at netmanagers.com.ar Fri Sep 19 08:51:09 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 19 Sep 2008 09:51:09 -0300 Subject: [reportlab-users] [ANN] rst2pdf version 0.8.1 released Message-ID: <200809190951.10054.ralsina@netmanagers.com.ar> I just released version 0.8.1 of this Rst-to-PDF-via-reportlab tool. This is rst2pdf's first **not** major release. However, it fixes many bugs and adds a few features, so it's worth the upgrade. You can get it via PyPI (package rst2pdf) or from Google Code: http://rst2pdf.googlecode.com Here are some of the features it provides: * User-defined page layout. Multiple frames per page, multiple layouts per document. * Cascading stylesheet mechanism, define only what you want changed * Supports TTF and Type1 font embedding using a custom stylesheet * "Floating" sidebars (or almost any element) * Any number of paragraph styles using the class directive * Any number of character styles using text roles * Styled table headers and cells * Custom page sizes and margins. * Syntax highlighter for many languages, using Pygments * Supports hyphenation (using wordaxe) * Full user's manual You can see a sample of some features here: http://tinyurl.com/5e4h3j Here's the changelog for the last two versions: New in 0.8.1 ------------ * Support for more complex headers and footers (including image directives and tables) * Optional inline links * Wordaxe 0.2.6 support * Several bugs fixed (issues 48,68,41,60,58,64,67) * Support for system-wide config file * Better author metadata New in 0.8 ---------- * Support for vector graphics: SVG, EPS, PS, CDR and others (requires uniconvertor) * Support for stdin and stdout, so you can use rst2pdf in pipes. * Works with reportlab 2.1 and 2.2 * Simpler stylesheets (guess bulletFontName, leading, bulletFontSize from other parameters) * Some support for sphinx * Fixed the docutils Writer interface * Continue processing when an image is missing * Support for user config file * Font sizes can be expressed in units or % of parent style's size * Larger font size in the default stylesheet Hope you enjoy it and/or find it useful. Best regards, -- ("\''/").__..-''"`-. . 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 timr at probo.com Fri Sep 19 12:30:53 2008 From: timr at probo.com (Tim Roberts) Date: Fri, 19 Sep 2008 09:30:53 -0700 Subject: [reportlab-users] ReportLab open source policy (was "headers and footers") In-Reply-To: <48D38A05.2040003@gmail.com> References: <956003ae0809190335n259028det73787ff3fc3ecd9a@mail.gmail.com> <48D38A05.2040003@gmail.com> Message-ID: <48D3D3BD.9030306@probo.com> Dirk Holtwick wrote: > > I think you should give it a try and move Reportlab to one of the big > project hoster like Google Code, Sourceforge, Launchpad, Berlios and > so on. For Google Code I would be happy to support you with that. Why do you see that as a benefit? I'm just curious. To me, the location of the hosting is completely irrelevant. I just want a place to download stuff, a web site for information, and a mailing list for exchange. For ReportLab, the open source version is essentially a subset of the commercial products that keep them in business, so there is great business sense in maintaining one tree with tags/branches. If they moved the open source part to a project hoster, that's a fork. Now they have the burden of maintaining two separate code bases. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From alsadi at gmail.com Sun Sep 21 12:34:32 2008 From: alsadi at gmail.com (Muayyad AlSadi) Date: Sun, 21 Sep 2008 19:34:32 +0300 Subject: [reportlab-users] OpenType fonts and right to left scripts In-Reply-To: <385866f0809181704r72facb21wbbfb2dc330a5ef44@mail.gmail.com> References: <385866f0809181704r72facb21wbbfb2dc330a5ef44@mail.gmail.com> Message-ID: <385866f0809210934h246000data94d44ad4a91f4de@mail.gmail.com> what are the files/functions that we should edit, for example in /usr/lib/python2.5/site-packages/reportlab/pdfgen/textobject.py we have _formatText(self, text) font.splitString(text, canv._doc) font.formatForPdf(text) and maybe something in /usr/lib/python2.5/site-packages/reportlab/pdfbase/cidfonts.py ??? I have no clue about the infrastructure of ReportLab I need to know whete the fix should be placed From greno at verizon.net Sat Sep 20 09:42:33 2008 From: greno at verizon.net (Gerry Reno) Date: Sat, 20 Sep 2008 09:42:33 -0400 Subject: [reportlab-users] Problem using FAQ example for embedding font In-Reply-To: <956003ae0809162233k1ae71cc7k7d8e6e8a2f96493f@mail.gmail.com> References: <48CB1BCB.4010501@verizon.net> <48CB1CFF.9020102@verizon.net> <48CB2827.7060808@verizon.net> <48CB2E2F.7020102@verizon.net> <48CBC5C3.5030304@verizon.net> <48CBC79B.1040106@verizon.net> <48CF0DBE.2000209@verizon.net> <956003ae0809160031q54648354y1f93a2cd40d35b44@mail.gmail.com> <48CFB4C5.6070004@verizon.net> <956003ae0809162233k1ae71cc7k7d8e6e8a2f96493f@mail.gmail.com> Message-ID: <48D4FDC9.5010008@verizon.net> Putting my module back into the container I found that I needed to modify 'pdfmetrics.py' to add a try/except block around 'registerEnc' in 'LoadMetrics' otherwise only one installation would be able to use the font and the others would all fail with a FontError that the font encoding was registered under a different vector. I added this code: try: registerEncoding(enc) except FontError, e: print "Warning: ",e Regards, Gerry From arkadi at smartbit.be Mon Sep 22 05:46:29 2008 From: arkadi at smartbit.be (Arkadi Colson) Date: Mon, 22 Sep 2008 11:46:29 +0200 Subject: [reportlab-users] frame in pageTemplate Message-ID: <48D76975.5030806@smartbit.be> Hi all, Somebody any idea why I only get one frame on the document instead of 3? Here is my code: / def foot1(self, canvas, doc): canvas.drawString(inch, 0.75 * inch, "Page %d" % doc.page) def go(self, outputfile, module): styles=getSampleStyleSheet() Elements=[] Frames=[] doc = BaseDocTemplate(outputfile) doc.pagesize = landscape(A4) frameHead = Frame(10*mm, 170*mm, 277*mm, 30*mm, id='head', showBoundary=1) frameFoot = Frame(10*mm, 10*mm, 277*mm, 30*mm, id='foot', showBoundary=1) frameBody = Frame(10*mm, 20*mm, 277*mm, 170*mm, id='body', showBoundary=1) Frames.append(frameHead) Frames.append(frameBody) Frames.append(frameFoot) Elements.append(Paragraph("Frame one column", styles['Normal'])) Elements.append(PageBreak()) Elements.append(Paragraph("Frame two columns", styles['Normal'])) doc.addPageTemplates( PageTemplate(frames=Frames, onPage=self.foot1) ) # build page doc.build(Elements) / Thanks in advance, Arkadi From gherman at darwin.in-berlin.de Mon Sep 22 05:57:53 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 22 Sep 2008 11:57:53 +0200 Subject: [reportlab-users] frame in pageTemplate In-Reply-To: <48D76975.5030806@smartbit.be> References: <48D76975.5030806@smartbit.be> Message-ID: Arkadi Colson: > Somebody any idea why I only get one frame on the document instead > of 3? > Here is my code: I think the chance for people testing such code snippets is higher if they were minimal, but complete, executable scripts. (This is valid for everybody sending code on this list...) Regards, Dinu From robin at reportlab.com Mon Sep 22 06:54:36 2008 From: robin at reportlab.com (Robin Becker) Date: Mon, 22 Sep 2008 11:54:36 +0100 Subject: [reportlab-users] frame in pageTemplate In-Reply-To: <48D76975.5030806@smartbit.be> References: <48D76975.5030806@smartbit.be> Message-ID: <48D7796C.7010307@chamonix.reportlab.co.uk> Arkadi Colson wrote: > Hi all, > > > Somebody any idea why I only get one frame on the document instead of 3? > Here is my code: ......... > > Elements.append(Paragraph("Frame one column", > styles['Normal'])) > Elements.append(PageBreak()) > Elements.append(Paragraph("Frame two columns", > styles['Normal'])) ........ I think the problem is the confusion of FrameBreak with PageBreak. At the beginning of the world someone created the PageBreak when it actually meant frame break. The PageBreak originally just consumed all available space so it was actually like a FrameBreak. However, by mistake someone else (probably me) fixed this situation so that PageBreak() did what it says on the tin and it gets handled now by the doctemplate class before it gets a chance to be a consumer of all space in the current frame. To make matters worse the situation persists in the conditional page break (CondPageBreak) where it is really a conditional FrameBreak. -- Robin Becker From srichter at cosmos.phy.tufts.edu Mon Sep 22 10:04:46 2008 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Mon, 22 Sep 2008 07:04:46 -0700 Subject: [reportlab-users] Svglib 0.6 to be released soon In-Reply-To: <7AA4D755-A50A-4BE5-9C2E-34C765DACE23@darwin.in-berlin.de> References: <7AA4D755-A50A-4BE5-9C2E-34C765DACE23@darwin.in-berlin.de> Message-ID: <200809220704.46630.srichter@cosmos.phy.tufts.edu> On Friday 19 September 2008, Dinu Gherman wrote: > I've built a draft release 0.6 of svglib [1], a library for > reading and converting SVG to RL Drawing objects, which will > be released under GPL 3. So far it has changed from a Python > module to a package and contains a huge amount of test cases > taken from the W3C. Any chance this could be a non-viral license? I would love to include this feature in z3c.rml. Regards, Stephan -- Stephan Richter Web Software Design, Development and Training Google me. "Zope Stephan Richter" From arkadi at smartbit.be Tue Sep 23 02:49:11 2008 From: arkadi at smartbit.be (Arkadi Colson) Date: Tue, 23 Sep 2008 08:49:11 +0200 Subject: [reportlab-users] tables in frames on multiple pages with variable data In-Reply-To: <48D268EB.6030401@smartbit.be> References: <48D268EB.6030401@smartbit.be> Message-ID: <48D89167.5070301@smartbit.be> Hi all, Maybe I was not clear enough in my explanation. On a page I have 3 sections: header, body and footer 1. Header contains 5 words which have to be placed with X and Y parameters randomly on top of page. So I have to use canvas there I suppose. 2. The body will contains a table with data which can grow over one page. So I have to use build methode here I think. 3. Then finally the footer is in fact the same as the header so will use again canvas here? The extra thing on this is that it should be only on the second page if the body is to large to fit on page one. (I can detect this because I know th rowhights) Then (if possible) this have to be repeated for 10 times in the same document but I'm already happy with one time. I can merge the pdf files into one big file if needed. Does reportlab have something like doc.build (SimpleDocTemplate) but then not with firstpage and otherpage but for each page...? Anybody who can advice me on this please? Thanks a lot! Arkadi Arkadi Colson wrote: > Hi, > > > Is it possible with reportlab to create a pdf with the following > structure: I have a large xml file with a lot of sections. Each > section contains a header, footer and content which are having all > different data. So I have to parse the xml file and then my question > comes: which method do I have to use to create the document? > > Canvas? -> Is it possible to say to use next page? > or > Doc.build? -> Can I use frames with this method? > > > Best regards. > > Arkadi > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From dirk.holtwick at gmail.com Tue Sep 23 05:51:37 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Tue, 23 Sep 2008 11:51:37 +0200 Subject: [reportlab-users] ReportLab open source policy (was "headers and footers") In-Reply-To: <48D3D3BD.9030306@probo.com> References: <956003ae0809190335n259028det73787ff3fc3ecd9a@mail.gmail.com> <48D38A05.2040003@gmail.com> <48D3D3BD.9030306@probo.com> Message-ID: 2008/9/19 Tim Roberts > Dirk Holtwick wrote: > > > > I think you should give it a try and move Reportlab to one of the big > > project hoster like Google Code, Sourceforge, Launchpad, Berlios and > > so on. For Google Code I would be happy to support you with that. > > Why do you see that as a benefit? I'm just curious. To me, the > location of the hosting is completely irrelevant. I just want a place > to download stuff, a web site for information, and a mailing list for > exchange. I see the benefit in the direct participation of the community. There are already a certain number of projects outside of Reportlab that depend on the toolkit but their only way to communicate changes and bugs is to send it to the mailing list and wait for Reportlab to include the changes. That is a passive strategy and I can imagine a more active strategy to work well too. > For ReportLab, the open source version is essentially a subset of the > commercial products that keep them in business, so there is great > business sense in maintaining one tree with tags/branches. If they > moved the open source part to a project hoster, that's a fork. Now they > have the burden of maintaining two separate code bases. As far as I understood Reportlab toolkit is the basis of the Reportlab RML package. Reportlab seems to first install Reportlab toolkit on the clients machine and then RML. Therefore the toolkit could also be developed and shiped independently from the commercial packages Reportlab uses. But if the toolkit is also directly integrated into the RML package then you are right and it is difficult for them to maintain both. But I think then this double maintainace is a problem for them already now. But anyways it should be possible to separate both projects clearly from each other as long as the toolkit API does not change. Dirk -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at flossmanuals.net Tue Sep 23 09:07:43 2008 From: adam at flossmanuals.net (adam hyde) Date: Tue, 23 Sep 2008 15:07:43 +0200 Subject: [reportlab-users] question about keepWithNext and multibuild Message-ID: <1222175263.6622.11.camel@esetera> hi, I saw the bug mentioned last week or so (keepWithNext failing with multibuild). Someone from reportlab said they would look at it - did you manage to check it out? I'm not sure how to check if there bug has been fixed etc (so guessing this list is the best place to ask) adam -- Adam Hyde Founder FLOSS Manuals http://www.flossmanuals.net From robin at reportlab.com Tue Sep 23 09:59:04 2008 From: robin at reportlab.com (Robin Becker) Date: Tue, 23 Sep 2008 14:59:04 +0100 Subject: [reportlab-users] question about keepWithNext and multibuild In-Reply-To: <1222175263.6622.11.camel@esetera> References: <1222175263.6622.11.camel@esetera> Message-ID: <48D8F628.9050604@chamonix.reportlab.co.uk> adam hyde wrote: > hi, > > I saw the bug mentioned last week or so (keepWithNext failing with > multibuild). > > Someone from reportlab said they would look at it - did you manage to > check it out? I'm not sure how to check if there bug has been fixed etc > (so guessing this list is the best place to ask) ........ I had a look at this and think it will be pretty hard to fix this stuff up easily. The original intent of the doctemplate class was to be a simple single pass process. That meant that the requirement of non-mutable story contents was not strictly observed. For multi-pass there is an absolute requirement that the story contents not be seriously modified during each pass. Of course things like the actual contents of flowables may change so something that rendered as 'pass 0' might eventually end up as rendering as 'pass 2', but the keepWithNext stuff is implemented by injecting new things into the story and modifying the original styles. Currently the multi-pass builder which was introduced by Andy to allow easier calculation of references/tables of content etc etc makes little effort to clean up undesired changes made during each pass. Probably we need to keep a list of structural changes that are made and reverse these prior to succeeding passes. The alternative is to find better implementations of keepWithNext and similar which remain invariant after first usage. -- Robin Becker From adam at flossmanuals.net Tue Sep 23 10:20:58 2008 From: adam at flossmanuals.net (adam hyde) Date: Tue, 23 Sep 2008 16:20:58 +0200 Subject: [reportlab-users] question about keepWithNext and multibuild In-Reply-To: <48D8F628.9050604@chamonix.reportlab.co.uk> References: <1222175263.6622.11.camel@esetera> <48D8F628.9050604@chamonix.reportlab.co.uk> Message-ID: <1222179658.7247.4.camel@esetera> hi Robin, Thanks for the update. Its good to hear the situation, I'm not entirely sure I understand the technical issue but I will talk to a friend that is a python programmer to see if he can take a look at it. Is there any way that you can think of to generate a TOC without multibuild? I was wondering if it is possible to record the placement of headings, and build the TOC at the end of the process. I'm sorry if this is a naive suggestion, my understanding of python is not too deep. If you have any suggestion on how we could do it without multipass I would happily try some experiments and report back. adam On Tue, 2008-09-23 at 14:59 +0100, Robin Becker wrote: > adam hyde wrote: > > hi, > > > > I saw the bug mentioned last week or so (keepWithNext failing with > > multibuild). > > > > Someone from reportlab said they would look at it - did you manage to > > check it out? I'm not sure how to check if there bug has been fixed etc > > (so guessing this list is the best place to ask) > ........ > > I had a look at this and think it will be pretty hard to fix this stuff up > easily. The original intent of the doctemplate class was to be a simple single > pass process. That meant that the requirement of non-mutable story contents was > not strictly observed. > > For multi-pass there is an absolute requirement that the story contents not be > seriously modified during each pass. Of course things like the actual contents > of flowables may change so something that rendered as 'pass 0' might eventually > end up as rendering as 'pass 2', but the keepWithNext stuff is implemented by > injecting new things into the story and modifying the original styles. > > Currently the multi-pass builder which was introduced by Andy to allow easier > calculation of references/tables of content etc etc makes little effort to clean > up undesired changes made during each pass. Probably we need to keep a list of > structural changes that are made and reverse these prior to succeeding passes. > The alternative is to find better implementations of keepWithNext and similar > which remain invariant after first usage. -- Adam Hyde Founder FLOSS Manuals http://www.flossmanuals.net From robin at reportlab.com Tue Sep 23 11:02:26 2008 From: robin at reportlab.com (Robin Becker) Date: Tue, 23 Sep 2008 16:02:26 +0100 Subject: [reportlab-users] question about keepWithNext and multibuild In-Reply-To: <1222179658.7247.4.camel@esetera> References: <1222175263.6622.11.camel@esetera> <48D8F628.9050604@chamonix.reportlab.co.uk> <1222179658.7247.4.camel@esetera> Message-ID: <48D90502.1030407@chamonix.reportlab.co.uk> adam hyde wrote: > hi Robin, > > Thanks for the update. Its good to hear the situation, I'm not entirely > sure I understand the technical issue but I will talk to a friend that > is a python programmer to see if he can take a look at it. > > Is there any way that you can think of to generate a TOC without > multibuild? I was wondering if it is possible to record the placement of > headings, and build the TOC at the end of the process. I'm sorry if this > is a naive suggestion, my understanding of python is not too deep. If > you have any suggestion on how we could do it without multipass I would > happily try some experiments and report back. > > adam > ........ For simple documents where it's possible to work out how long the TOC is before passing through the document you can put a pdf form reference and then build up the contents of the form as the single pass proceeds. At the end of the story prior to the build you need to instantiate the form so the eventual PDF forward reference can succeed. -- Robin Becker From andy at reportlab.com Tue Sep 23 11:36:24 2008 From: andy at reportlab.com (Andy Robinson) Date: Tue, 23 Sep 2008 16:36:24 +0100 Subject: [reportlab-users] question about keepWithNext and multibuild In-Reply-To: <48D8F628.9050604@chamonix.reportlab.co.uk> References: <1222175263.6622.11.camel@esetera> <48D8F628.9050604@chamonix.reportlab.co.uk> Message-ID: <956003ae0809230836p7d9b2229s668ebf017733ae13@mail.gmail.com> 2008/9/23 Robin Becker : > Currently the multi-pass builder which was introduced by Andy to allow > easier calculation of references/tables of content etc etc makes little > effort to clean up undesired changes made during each pass. Probably we need > to keep a list of structural changes that are made and reverse these prior > to succeeding passes. The alternative is to find better implementations of > keepWithNext and similar which remain invariant after first usage. > -- I agree. At the present time we have about 8 years accumulated features, some of which were wrong with hindsight, and it's hard to fix much more without breaking backward compatibility. You know what I'd rather do? Deprecate multi-pass altogether, and provide better documentation on the 'deferred drawing' tricks which make it reasonably easy to create indices and tables. Adam, what are you actually trying to do? There may be better ways to do it without multiple passes that sidesetp this. - Andy From adam at flossmanuals.net Tue Sep 23 12:16:36 2008 From: adam at flossmanuals.net (adam hyde) Date: Tue, 23 Sep 2008 18:16:36 +0200 Subject: [reportlab-users] question about keepWithNext and multibuild In-Reply-To: <956003ae0809230836p7d9b2229s668ebf017733ae13@mail.gmail.com> References: <1222175263.6622.11.camel@esetera> <48D8F628.9050604@chamonix.reportlab.co.uk> <956003ae0809230836p7d9b2229s668ebf017733ae13@mail.gmail.com> Message-ID: <1222186596.10344.6.camel@esetera> hi, Thanks to Andy and Robin for the information. I am working with FLOSS Manuals - we write free documentation about free software. At this moment we are automating the production of printed manuals ( see http://en.flossmanuals.net/bin/view/Blog/BooksArrive ) Currently we build the TOC for the books using a routine in Pisa that relies on multipass but unfortunately this breaks the keepWithNext. keepWithNext is absolutely necessary for producing books otherwise the inevitable headings appear at the bottom of pages detached from content etc. Looks terrible. So we are really needing to build a TOC without multipass. We just pick up on h1 headings using Pisa as this is the only depth required in a book TOC for our purposes. If anyone has a nice snippet for producing a TOC without multipass we would very much appreciate it. adam On Tue, 2008-09-23 at 16:36 +0100, Andy Robinson wrote: > 2008/9/23 Robin Becker : > > Currently the multi-pass builder which was introduced by Andy to allow > > easier calculation of references/tables of content etc etc makes little > > effort to clean up undesired changes made during each pass. Probably we need > > to keep a list of structural changes that are made and reverse these prior > > to succeeding passes. The alternative is to find better implementations of > > keepWithNext and similar which remain invariant after first usage. > > -- > > I agree. At the present time we have about 8 years accumulated features, > some of which were wrong with hindsight, and it's hard to fix much more without > breaking backward compatibility. > > You know what I'd rather do? Deprecate multi-pass altogether, and provide > better documentation on the 'deferred drawing' tricks which make it > reasonably easy to create indices and tables. > > Adam, what are you actually trying to do? There may be better ways to do it > without multiple passes that sidesetp this. > > - Andy -- Adam Hyde Founder FLOSS Manuals http://www.flossmanuals.net From andy at reportlab.com Tue Sep 23 12:43:17 2008 From: andy at reportlab.com (Andy Robinson) Date: Tue, 23 Sep 2008 17:43:17 +0100 Subject: [reportlab-users] question about keepWithNext and multibuild In-Reply-To: <1222186596.10344.6.camel@esetera> References: <1222175263.6622.11.camel@esetera> <48D8F628.9050604@chamonix.reportlab.co.uk> <956003ae0809230836p7d9b2229s668ebf017733ae13@mail.gmail.com> <1222186596.10344.6.camel@esetera> Message-ID: <956003ae0809230943n1b1de7bct7afbdbf9806824fa@mail.gmail.com> 2008/9/23 adam hyde : > So we are really needing to build a TOC without multipass. We just pick > up on h1 headings using Pisa as this is the only depth required in a > book TOC for our purposes. If anyone has a nice snippet for producing a > TOC without multipass we would very much appreciate it. I've been meaning to create a teaching example for this and a higher-level table-of-contents widget for weeks, but have not found the time. (we have such examples in RML, relying on some syntactic sugar, but not in Platypus). However the 2.2.1 release and new web site ought to come first though - it might be another 2-3 weeks. Don't worry though - we, too, want to create our own manuals more sanely, ideally using ReST and Sphinx or something similar, so we will definitely be doing something to make single-pass indexes and tables easier. If anyone else has the time and energy to play with this first, the trick is to create a little flowable for a "table of contents page number" which consumes just enough space for a couple of digits and calls canvas.doForm(...); and then to put another zero-sized flowable at the end of the story to actually define what said form should look like. - Andy From robin at reportlab.com Tue Sep 23 13:03:38 2008 From: robin at reportlab.com (Robin Becker) Date: Tue, 23 Sep 2008 18:03:38 +0100 Subject: [reportlab-users] question about keepWithNext and multibuild In-Reply-To: <1222186596.10344.6.camel@esetera> References: <1222175263.6622.11.camel@esetera> <48D8F628.9050604@chamonix.reportlab.co.uk> <956003ae0809230836p7d9b2229s668ebf017733ae13@mail.gmail.com> <1222186596.10344.6.camel@esetera> Message-ID: <48D9216A.2050802@chamonix.reportlab.co.uk> adam hyde wrote: >........ > So we are really needing to build a TOC without multipass. We just pick > up on h1 headings using Pisa as this is the only depth required in a > book TOC for our purposes. If anyone has a nice snippet for producing a > TOC without multipass we would very much appreciate it. > > adam ......... At the moment the keepTogether style is handled thusly; in the main loop of the doctemplate build process at the start of the flowable handling the head of the list is examined for flowables with keepWithNext style. If any are found these are bundled together and replaced by a single KeepTogether flowable; to avoid doing this recursively we force the keepWithNext value for each flowable to be zero. KeepTogether has just enough intelligence to try and ensure its contents stay on a single page and when wrapped it always fails first time inorder to allow the split method a chance to force a frame throw. Even though we've messed about with the current passed story quite a bit the main problem is that we changed the keepWithNext attribute on each flowable we bundled together. The multiBuild method is careful to keep the original story list intact, but we have forgotten that flowables are mutable (in this case a structural property of the flowable was changed). It should be possible to just remember the flowables which have been modified by the handle_keepWithNext method and restore them at the end of the loop. After checking I see that we are already attempting to eliminate some side effects of the main loop. I have run all tests with this patch in place. It attempts to fix the keepWithNext values back to their original state. Can you give it a whirl? It is against current head, but the coding is not that hard so should apply to recent sources. C:\code\reportlab\platypus>svn diff doctemplate.py Index: doctemplate.py =================================================================== --- doctemplate.py (revision 3298) +++ doctemplate.py (working copy) @@ -600,8 +600,17 @@ if i: if i maxPasses: raise IndexError, "Index entries not resolved after %d passes" % maxPasses + #clean up so multi-build does not go wrong - the frame + #packer might have tacked an attribute onto some flowables + for elem in story: + if hasattr(elem, '_postponed'): + del elem._postponed + + #work through any edits + while mbe: + e = mbe.pop(0) + e[0](*e[1:]) + + del self._multiBuildEdits if verbose: print 'saved' #these are pure virtuals override in derived classes -- Robin Becker -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: mbe.patch Url: From gherman at darwin.in-berlin.de Tue Sep 23 13:15:57 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Tue, 23 Sep 2008 19:15:57 +0200 Subject: [reportlab-users] Svglib 0.6 to be released soon In-Reply-To: <200809220704.46630.srichter@cosmos.phy.tufts.edu> References: <7AA4D755-A50A-4BE5-9C2E-34C765DACE23@darwin.in-berlin.de> <200809220704.46630.srichter@cosmos.phy.tufts.edu> Message-ID: <34E6B84F-6860-492A-BB7D-40BD5753DBCE@darwin.in-berlin.de> Stephan Richter: > On Friday 19 September 2008, Dinu Gherman wrote: >> I've built a draft release 0.6 of svglib [1], a library for >> reading and converting SVG to RL Drawing objects, which will >> be released under GPL 3. So far it has changed from a Python >> module to a package and contains a huge amount of test cases >> taken from the W3C. > > Any chance this could be a non-viral license? I would love to > include this > feature in z3c.rml. I've had some bad experience with changing another project of mine from GPL to MIT, because I believed people telling me they would not be allowed to contribute to the project if it stayed under GPL, which is kind of perverting the idea of the GPL, and I'm not willing to repeat this. Anybody who wants to use (and modify) svglib will be able to do so, even after downloading it as an egg. For other, add- itional, licenses you'll need to convince me with good argu- ments. Regards, Dinu From srichter at cosmos.phy.tufts.edu Tue Sep 23 13:45:38 2008 From: srichter at cosmos.phy.tufts.edu (Stephan Richter) Date: Tue, 23 Sep 2008 10:45:38 -0700 Subject: [reportlab-users] Svglib 0.6 to be released soon In-Reply-To: <34E6B84F-6860-492A-BB7D-40BD5753DBCE@darwin.in-berlin.de> References: <7AA4D755-A50A-4BE5-9C2E-34C765DACE23@darwin.in-berlin.de> <200809220704.46630.srichter@cosmos.phy.tufts.edu> <34E6B84F-6860-492A-BB7D-40BD5753DBCE@darwin.in-berlin.de> Message-ID: <200809231045.38949.srichter@cosmos.phy.tufts.edu> On Tuesday 23 September 2008, Dinu Gherman wrote: > I've had some bad experience with changing another project > of mine from GPL to MIT, because I believed people telling > me they would not be allowed to contribute to the project if > it stayed under GPL, which is kind of perverting the idea of > the GPL, and I'm not willing to repeat this. I have heard about this in the past, but never investigated the details, since I had no immediate need. > Anybody who wants to use (and modify) svglib will be able to > do so, even after downloading it as an egg. For other, add- > itional, licenses you'll need to convince me with good argu- > ments. The main problem is that you cannot use it in commercial projects. Since this sort of technology is mostly useful to professional developers, that's a bummer. In the Zope world we have been really happy with the ZPL license and contributing back to the source code has never been an issue. Regards, Stephan -- Stephan Richter Web Software Design, Development and Training Google me. "Zope Stephan Richter" From adam at flossmanuals.net Tue Sep 23 13:47:03 2008 From: adam at flossmanuals.net (adam hyde) Date: Tue, 23 Sep 2008 19:47:03 +0200 Subject: [reportlab-users] question about keepWithNext and multibuild In-Reply-To: <48D9216A.2050802@chamonix.reportlab.co.uk> References: <1222175263.6622.11.camel@esetera> <48D8F628.9050604@chamonix.reportlab.co.uk> <956003ae0809230836p7d9b2229s668ebf017733ae13@mail.gmail.com> <1222186596.10344.6.camel@esetera> <48D9216A.2050802@chamonix.reportlab.co.uk> Message-ID: <1222192024.10344.22.camel@esetera> goodness...it appears to work :) I patched reportlab 2.1 and it looks good. I will run some more tests today and tomorrow and let confirm the situation, but from what I see now it is holding the keepWithNext while building the TOC. Fantastic! Many thanks for all your help! adam On Tue, 2008-09-23 at 18:03 +0100, Robin Becker wrote: > adam hyde wrote: > >........ > > So we are really needing to build a TOC without multipass. We just pick > > up on h1 headings using Pisa as this is the only depth required in a > > book TOC for our purposes. If anyone has a nice snippet for producing a > > TOC without multipass we would very much appreciate it. > > > > adam > ......... > > At the moment the keepTogether style is handled thusly; > > in the main loop of the doctemplate build process at the start of the flowable > handling the head of the list is examined for flowables with keepWithNext style. > If any are found these are bundled together and replaced by a single > KeepTogether flowable; to avoid doing this recursively we force the keepWithNext > value for each flowable to be zero. > > KeepTogether has just enough intelligence to try and ensure its contents stay on > a single page and when wrapped it always fails first time inorder to allow the > split method a chance to force a frame throw. > > Even though we've messed about with the current passed story quite a bit the > main problem is that we changed the keepWithNext attribute on each flowable we > bundled together. The multiBuild method is careful to keep the original story > list intact, but we have forgotten that flowables are mutable (in this case a > structural property of the flowable was changed). > > It should be possible to just remember the flowables which have been modified by > the handle_keepWithNext method and restore them at the end of the loop. After > checking I see that we are already attempting to eliminate some side effects of > the main loop. > > > I have run all tests with this patch in place. It attempts to fix the > keepWithNext values back to their original state. Can you give it a whirl? It is > against current head, but the coding is not that hard so should apply to recent > sources. > > C:\code\reportlab\platypus>svn diff doctemplate.py > Index: doctemplate.py > =================================================================== > --- doctemplate.py (revision 3298) > +++ doctemplate.py (working copy) > @@ -600,8 +600,17 @@ > if i: > if i K = KeepTogether(flowables[:i]) > - for f in K._content[:-1]: > - f.__dict__['keepWithNext'] = 0 > + mbe = getattr(self,'_multiBuildEdits',None) > + if mbe: > + for f in K._content[:-1]: > + if hasattr(f,'keepWithNext'): > + mbe((setattr,f,'keepWithNext',f.keepWithNext)) > + else: > + mbe((delattr,f,'keepWithNext')) #must get it from a style > + f.__dict__['keepWithNext'] = 0 > + else: > + for f in K._content[:-1]: > + f.__dict__['keepWithNext'] = 0 > del flowables[:i] > flowables.insert(0,K) > > @@ -818,6 +827,8 @@ > #better fix for filename is a 'file' problem > self._doSave = 0 > passes = 0 > + mbe = [] > + self._multiBuildEdits = mbe.append > while 1: > passes += 1 > if self._onProgress: > @@ -832,12 +843,6 @@ > self.build(tempStory, filename, canvasmaker) > #self.notify('debug',None) > > - #clean up so multi-build does not go wrong - the frame > - #packer might have tacked an attribute onto some flowables > - for elem in story: > - if hasattr(elem, '_postponed'): > - del elem._postponed > - > for fl in self._indexingFlowables: > fl.afterBuild() > > @@ -850,6 +855,18 @@ > if passes > maxPasses: > raise IndexError, "Index entries not resolved after %d passes" > % maxPasses > > + #clean up so multi-build does not go wrong - the frame > + #packer might have tacked an attribute onto some flowables > + for elem in story: > + if hasattr(elem, '_postponed'): > + del elem._postponed > + > + #work through any edits > + while mbe: > + e = mbe.pop(0) > + e[0](*e[1:]) > + > + del self._multiBuildEdits > if verbose: print 'saved' > > #these are pure virtuals override in derived classes > > plain text document attachment (mbe.patch) > Index: doctemplate.py > =================================================================== > --- doctemplate.py (revision 3298) > +++ doctemplate.py (working copy) > @@ -600,8 +600,17 @@ > if i: > if i K = KeepTogether(flowables[:i]) > - for f in K._content[:-1]: > - f.__dict__['keepWithNext'] = 0 > + mbe = getattr(self,'_multiBuildEdits',None) > + if mbe: > + for f in K._content[:-1]: > + if hasattr(f,'keepWithNext'): > + mbe((setattr,f,'keepWithNext',f.keepWithNext)) > + else: > + mbe((delattr,f,'keepWithNext')) #must get it from a style > + f.__dict__['keepWithNext'] = 0 > + else: > + for f in K._content[:-1]: > + f.__dict__['keepWithNext'] = 0 > del flowables[:i] > flowables.insert(0,K) > > @@ -818,6 +827,8 @@ > #better fix for filename is a 'file' problem > self._doSave = 0 > passes = 0 > + mbe = [] > + self._multiBuildEdits = mbe.append > while 1: > passes += 1 > if self._onProgress: > @@ -832,12 +843,6 @@ > self.build(tempStory, filename, canvasmaker) > #self.notify('debug',None) > > - #clean up so multi-build does not go wrong - the frame > - #packer might have tacked an attribute onto some flowables > - for elem in story: > - if hasattr(elem, '_postponed'): > - del elem._postponed > - > for fl in self._indexingFlowables: > fl.afterBuild() > > @@ -850,6 +855,18 @@ > if passes > maxPasses: > raise IndexError, "Index entries not resolved after %d passes" % maxPasses > > + #clean up so multi-build does not go wrong - the frame > + #packer might have tacked an attribute onto some flowables > + for elem in story: > + if hasattr(elem, '_postponed'): > + del elem._postponed > + > + #work through any edits > + while mbe: > + e = mbe.pop(0) > + e[0](*e[1:]) > + > + del self._multiBuildEdits > if verbose: print 'saved' > > #these are pure virtuals override in derived classes > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users -- Adam Hyde Founder FLOSS Manuals http://www.flossmanuals.net From ralsina at netmanagers.com.ar Tue Sep 23 13:49:57 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Tue, 23 Sep 2008 14:49:57 -0300 Subject: [reportlab-users] Svglib 0.6 to be released soon In-Reply-To: <200809231045.38949.srichter@cosmos.phy.tufts.edu> References: <7AA4D755-A50A-4BE5-9C2E-34C765DACE23@darwin.in-berlin.de> <34E6B84F-6860-492A-BB7D-40BD5753DBCE@darwin.in-berlin.de> <200809231045.38949.srichter@cosmos.phy.tufts.edu> Message-ID: <200809231450.05410.ralsina@netmanagers.com.ar> On Tuesday 23 September 2008 14:45:38 Stephan Richter wrote: > On Tuesday 23 September 2008, Dinu Gherman wrote: > > Anybody who wants to use (and modify) svglib will be able to > > do so, even after downloading it as an egg. For other, add- > > itional, licenses you'll need to convince me with good argu- > > ments. > > The main problem is that you cannot use it in commercial projects. Since > this sort of technology is mostly useful to professional developers, that's > a bummer. In the Zope world we have been really happy with the ZPL license > and contributing back to the source code has never been an issue. Said "professional developers" are free to contact Dinu and pay him for a license, are they not? Sorry if this is uncalled for, but I am kinda bummed about people asking for more liberal license in a library so they can use it in a *less* liberally licensed app. OTOH, there are ways around this GPLd library thing. Use IPC and keep it off- process, for instance. The GPL doesn't apply to the produced PDF fragment. -- ("\''/").__..-''"`-. . 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 tiagobecker at gmail.com Tue Sep 23 15:20:34 2008 From: tiagobecker at gmail.com (Tiago Becker) Date: Tue, 23 Sep 2008 16:20:34 -0300 Subject: [reportlab-users] Bogus Character Message-ID: <9bad843d0809231220t55a6e79cu95d010d6512ac76b@mail.gmail.com> Hello all, I've an error if a Paragraph contains some characters such as "&". Is there a way to fix that other than replacing the character? Thanks! Tiago Becker -------------- next part -------------- An HTML attachment was scrubbed... URL: From DJESSUP at usnews.com Tue Sep 23 15:44:47 2008 From: DJESSUP at usnews.com (Jessup, David) Date: Tue, 23 Sep 2008 15:44:47 -0400 Subject: [reportlab-users] Bogus Character In-Reply-To: <9bad843d0809231220t55a6e79cu95d010d6512ac76b@mail.gmail.com> References: <9bad843d0809231220t55a6e79cu95d010d6512ac76b@mail.gmail.com> Message-ID: <97886A555FD8E14E8F7445D75C11D54DD2DF5D@EXCHANGE.usn.root.ent> Use: from xml.sal import saxutils ... my_paragraph = Paragraph(saxutils.escape(my_text), style) The escape function will encode the special characters in your text (& -> &, etc.) so that Paragraph can understand it. ________________________________ From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Tiago Becker Sent: Tuesday, September 23, 2008 3:21 PM To: reportlab-users at reportlab.com Subject: [reportlab-users] Bogus Character Hello all, I've an error if a Paragraph contains some characters such as "&". Is there a way to fix that other than replacing the character? Thanks! Tiago Becker -------------- next part -------------- An HTML attachment was scrubbed... URL: From DJESSUP at usnews.com Tue Sep 23 15:55:12 2008 From: DJESSUP at usnews.com (Jessup, David) Date: Tue, 23 Sep 2008 15:55:12 -0400 Subject: [reportlab-users] Bogus Character In-Reply-To: <97886A555FD8E14E8F7445D75C11D54DD2DF5D@EXCHANGE.usn.root.ent> References: <9bad843d0809231220t55a6e79cu95d010d6512ac76b@mail.gmail.com> <97886A555FD8E14E8F7445D75C11D54DD2DF5D@EXCHANGE.usn.root.ent> Message-ID: <97886A555FD8E14E8F7445D75C11D54DD2DF5E@EXCHANGE.usn.root.ent> Ack! That should be: from xml.sax import saxutils ^ ________________________________ From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Jessup, David Sent: Tuesday, September 23, 2008 3:45 PM To: Support list for users of Reportlab software Subject: Re: [reportlab-users] Bogus Character Use: from xml.sal import saxutils ... my_paragraph = Paragraph(saxutils.escape(my_text), style) The escape function will encode the special characters in your text (& -> &, etc.) so that Paragraph can understand it. ________________________________ From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Tiago Becker Sent: Tuesday, September 23, 2008 3:21 PM To: reportlab-users at reportlab.com Subject: [reportlab-users] Bogus Character Hello all, I've an error if a Paragraph contains some characters such as "&". Is there a way to fix that other than replacing the character? Thanks! Tiago Becker From tiagobecker at gmail.com Tue Sep 23 16:44:10 2008 From: tiagobecker at gmail.com (Tiago Becker) Date: Tue, 23 Sep 2008 17:44:10 -0300 Subject: [reportlab-users] Bogus Character In-Reply-To: <97886A555FD8E14E8F7445D75C11D54DD2DF5E@EXCHANGE.usn.root.ent> References: <9bad843d0809231220t55a6e79cu95d010d6512ac76b@mail.gmail.com> <97886A555FD8E14E8F7445D75C11D54DD2DF5D@EXCHANGE.usn.root.ent> <97886A555FD8E14E8F7445D75C11D54DD2DF5E@EXCHANGE.usn.root.ent> Message-ID: <9bad843d0809231344y66d9fad5t4a8cec10902dd6c@mail.gmail.com> Worked like a charm! Thanks a lot!!! :D On Tue, Sep 23, 2008 at 4:55 PM, Jessup, David wrote: > Ack! > > That should be: from xml.sax import saxutils > ^ > > ________________________________ > > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Jessup, > David > Sent: Tuesday, September 23, 2008 3:45 PM > To: Support list for users of Reportlab software > Subject: Re: [reportlab-users] Bogus Character > > > Use: > > from xml.sal import saxutils > ... > my_paragraph = Paragraph(saxutils.escape(my_text), style) > > The escape function will encode the special characters in your text (& > -> &, etc.) so that Paragraph can understand it. > > ________________________________ > > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Tiago Becker > Sent: Tuesday, September 23, 2008 3:21 PM > To: reportlab-users at reportlab.com > Subject: [reportlab-users] Bogus Character > > > Hello all, > I've an error if a Paragraph contains some characters such as "&". > > Is there a way to fix that other than replacing the character? > > Thanks! > > Tiago Becker > > _______________________________________________ > 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 timr at probo.com Tue Sep 23 17:01:20 2008 From: timr at probo.com (Tim Roberts) Date: Tue, 23 Sep 2008 14:01:20 -0700 Subject: [reportlab-users] Bogus Character In-Reply-To: <9bad843d0809231344y66d9fad5t4a8cec10902dd6c@mail.gmail.com> References: <9bad843d0809231220t55a6e79cu95d010d6512ac76b@mail.gmail.com> <97886A555FD8E14E8F7445D75C11D54DD2DF5D@EXCHANGE.usn.root.ent> <97886A555FD8E14E8F7445D75C11D54DD2DF5E@EXCHANGE.usn.root.ent> <9bad843d0809231344y66d9fad5t4a8cec10902dd6c@mail.gmail.com> Message-ID: <48D95920.1070605@probo.com> Tiago Becker wrote: > Worked like a charm! > > Thanks a lot!!! :D > > On Tue, Sep 23, 2008 at 4:55 PM, Jessup, David > wrote: > > Ack! > > That should be: from xml.sax import saxutils > ^ > ... > > Hello all, > I've an error if a Paragraph contains some characters such as "&". > > Is there a way to fix that other than replacing the character? > OK, but just to make sure you understand, are you aware that the solution he posted *is* replacing the character? -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From gherman at darwin.in-berlin.de Wed Sep 24 06:40:35 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed, 24 Sep 2008 12:40:35 +0200 Subject: [reportlab-users] ANN: pdfnup 0.3.0 Message-ID: <20BB4A0E-EDB4-44E2-8A2C-1BA7A7BE3BC3@darwin.in-berlin.de> Hi, I'm announcing the next of a series of little PDF handling tools I wrote to work with PDF files. This one is named "pdfnup" and is (verly lightly) based on ReportLab (apart from the test PDFs, also created with RL), but might be useful for people on this list as well. Mostly it is based on PyPDF. You should be able to easy_install "pdfnup" and lookup details in the Python Package Index: http://pypi.python.org/pypi/pdfnup Sadly, I cannot establish a proper dependency to the RL toolkit in PyPI/setuptools, because the RL code isn't propperly regist- ered there. Nevertheless, I hope this will be useful for others as well. Comments are welcome! Regards, Dinu -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Wed Sep 24 06:53:05 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 24 Sep 2008 11:53:05 +0100 Subject: [reportlab-users] ANN: pdfnup 0.3.0 In-Reply-To: <20BB4A0E-EDB4-44E2-8A2C-1BA7A7BE3BC3@darwin.in-berlin.de> References: <20BB4A0E-EDB4-44E2-8A2C-1BA7A7BE3BC3@darwin.in-berlin.de> Message-ID: <956003ae0809240353q2f87ccas99dd1e8ccfe8e383@mail.gmail.com> 2008/9/24 Dinu Gherman : > Sadly, I cannot establish a proper dependency to the RL toolkit > in PyPI/setuptools, because the RL code isn't propperly regist- > ered there. We'll try to do the PyPI thing for 2.2.1, but that's likely to be next week due to some unanticipated deadlines in the next 2 days. - Andy From gherman at darwin.in-berlin.de Wed Sep 24 08:23:30 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed, 24 Sep 2008 14:23:30 +0200 Subject: [reportlab-users] ANN: pdfnup 0.3.0 In-Reply-To: <956003ae0809240353q2f87ccas99dd1e8ccfe8e383@mail.gmail.com> References: <20BB4A0E-EDB4-44E2-8A2C-1BA7A7BE3BC3@darwin.in-berlin.de> <956003ae0809240353q2f87ccas99dd1e8ccfe8e383@mail.gmail.com> Message-ID: Andy Robinson: > We'll try to do the PyPI thing for 2.2.1, but that's likely to be next > week due to some unanticipated deadlines in the next 2 days. I already explained how to do it for RL 2.2 as a two minute action. Regards, Dinu From andy at reportlab.com Wed Sep 24 08:35:49 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 24 Sep 2008 13:35:49 +0100 Subject: [reportlab-users] ANN: pdfnup 0.3.0 In-Reply-To: References: <20BB4A0E-EDB4-44E2-8A2C-1BA7A7BE3BC3@darwin.in-berlin.de> <956003ae0809240353q2f87ccas99dd1e8ccfe8e383@mail.gmail.com> Message-ID: <956003ae0809240535k171e9bc9v79334c67b427e7ad@mail.gmail.com> 2008/9/24 Dinu Gherman : > I already explained how to do it for RL 2.2 as a two minute action. I thought it required a fully working egg-style setuptools script? The setup_egg.py we have now doesn't build the C extensions yet, and if we did it now then it would also have the wrong version number. Retro-hacking tagged code is bad karma. If not, please feel free to go ahead and do it yourself, if you want it there now and think it will work with what we have. We're not going to do something irreversible ourselves until we have had a few hours to learn about PyPI and we're sure we're doing the right thing; then we could make it part of our packaging script. I am confident this could happen next week for 2.2.1 - Andy From tiagobecker at gmail.com Wed Sep 24 08:44:43 2008 From: tiagobecker at gmail.com (Tiago Becker) Date: Wed, 24 Sep 2008 09:44:43 -0300 Subject: [reportlab-users] Bogus Character In-Reply-To: <48D95920.1070605@probo.com> References: <9bad843d0809231220t55a6e79cu95d010d6512ac76b@mail.gmail.com> <97886A555FD8E14E8F7445D75C11D54DD2DF5D@EXCHANGE.usn.root.ent> <97886A555FD8E14E8F7445D75C11D54DD2DF5E@EXCHANGE.usn.root.ent> <9bad843d0809231344y66d9fad5t4a8cec10902dd6c@mail.gmail.com> <48D95920.1070605@probo.com> Message-ID: <9bad843d0809240544o31e90191mcd2e3dbd449c78dd@mail.gmail.com> Yes, i undestood that... But i was doing something like that, but using .replace, and only on that bogus character (&).. Is there any other way? Random thought: On PHP, i used a function that would solve that kinda of problem... Thanks a lot! On Tue, Sep 23, 2008 at 6:01 PM, Tim Roberts wrote: > Tiago Becker wrote: > > Worked like a charm! > > > > Thanks a lot!!! :D > > > > On Tue, Sep 23, 2008 at 4:55 PM, Jessup, David > > wrote: > > > > Ack! > > > > That should be: from xml.sax import saxutils > > ^ > > ... > > > > Hello all, > > I've an error if a Paragraph contains some characters such as "&". > > > > Is there a way to fix that other than replacing the character? > > > > OK, but just to make sure you understand, are you aware that the > solution he posted *is* replacing the character? > > -- > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed Sep 24 13:23:51 2008 From: timr at probo.com (Tim Roberts) Date: Wed, 24 Sep 2008 10:23:51 -0700 Subject: [reportlab-users] ANN: pdfnup 0.3.0 In-Reply-To: <20BB4A0E-EDB4-44E2-8A2C-1BA7A7BE3BC3@darwin.in-berlin.de> References: <20BB4A0E-EDB4-44E2-8A2C-1BA7A7BE3BC3@darwin.in-berlin.de> Message-ID: <48DA77A7.2090304@probo.com> Dinu Gherman wrote: > > I'm announcing the next of a series of little PDF handling tools > I wrote to work with PDF files. This one is named "pdfnup" and > is (verly lightly) based on ReportLab (apart from the test PDFs, > also created with RL), but might be useful for people on this > list as well. Mostly it is based on PyPDF. If you will permit me to be a bit critical, NOWHERE in this announcement do you give the slightest clue as to what "pdfnup" actually does. True, the description is on the web page, but I shouldn't have to hit the page to decide whether this is interesting for me. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Wed Sep 24 13:26:47 2008 From: timr at probo.com (Tim Roberts) Date: Wed, 24 Sep 2008 10:26:47 -0700 Subject: [reportlab-users] Bogus Character In-Reply-To: <9bad843d0809240544o31e90191mcd2e3dbd449c78dd@mail.gmail.com> References: <9bad843d0809231220t55a6e79cu95d010d6512ac76b@mail.gmail.com> <97886A555FD8E14E8F7445D75C11D54DD2DF5D@EXCHANGE.usn.root.ent> <97886A555FD8E14E8F7445D75C11D54DD2DF5E@EXCHANGE.usn.root.ent> <9bad843d0809231344y66d9fad5t4a8cec10902dd6c@mail.gmail.com> <48D95920.1070605@probo.com> <9bad843d0809240544o31e90191mcd2e3dbd449c78dd@mail.gmail.com> Message-ID: <48DA7857.5050704@probo.com> Tiago Becker wrote: > Yes, i undestood that... But i was doing something like that, but > using .replace, and only on that bogus character (&).. > > Is there any other way? No, but it shouldn't matter. The only other way to do it would be if ReportLab had a switch to disable the HTML handling in Paragraph. There is no such switch. > Random thought: On PHP, i used a function that would solve that kinda > of problem... Since ReportLab doesn't run with PHP, the parallel isn't exact. However, if you mean using one the entity or escape functions in PHP, those ALSO replace the suspect characters. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From gherman at darwin.in-berlin.de Wed Sep 24 17:10:35 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed, 24 Sep 2008 23:10:35 +0200 Subject: [reportlab-users] ANN: pdfnup 0.3.0 In-Reply-To: <48DA77A7.2090304@probo.com> References: <20BB4A0E-EDB4-44E2-8A2C-1BA7A7BE3BC3@darwin.in-berlin.de> <48DA77A7.2090304@probo.com> Message-ID: <85390C9A-F9E8-45FE-B612-44F20435D9BB@darwin.in-berlin.de> Tim Roberts: > If you will permit me to be a bit critical, NOWHERE in this > announcement > do you give the slightest clue as to what "pdfnup" actually does. > > True, the description is on the web page, but I shouldn't have to hit > the page to decide whether this is interesting for me. Hi Tim, I very much appreciate your criticism! You're absolutely right, of course, and I'm sorry for having wasted your time or that of anybody else. In fact, I've made the maybe overly optimistic assumption that on this list most people would be familiar with the term "n-up", since I thought most would know about tools like psnup. I'm adapting here a key phrase from its man page to pdfnup, hoping to save at least some of he time of others: "Pdfnup puts multiple logical pages onto each physical sheet of paper. The input PDF file should follow the Adobe Document Structuring Conventions." Thanks again, Dinu From gherman at darwin.in-berlin.de Wed Sep 24 17:14:43 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed, 24 Sep 2008 23:14:43 +0200 Subject: [reportlab-users] ANN: pdfnup 0.3.0 In-Reply-To: <956003ae0809240535k171e9bc9v79334c67b427e7ad@mail.gmail.com> References: <20BB4A0E-EDB4-44E2-8A2C-1BA7A7BE3BC3@darwin.in-berlin.de> <956003ae0809240353q2f87ccas99dd1e8ccfe8e383@mail.gmail.com> <956003ae0809240535k171e9bc9v79334c67b427e7ad@mail.gmail.com> Message-ID: <2467EF2F-4C4B-4B4B-B4C8-3FA74625E48D@darwin.in-berlin.de> Andy Robinson: > I thought it required a fully working egg-style setuptools script? > The setup_egg.py we have now doesn't build the C extensions yet, > and if we did it now then it would also have the wrong version number. > Retro-hacking tagged code is bad karma. You hadn't responded to my previous message, but I guess you're right, and in addition, I certainly don't want to register some- thing on behalf of others without their consent. So let's pray that RL 2.2.1 will solve all the remaining issues...! Regards, Dinu From ralsina at netmanagers.com.ar Wed Sep 24 17:26:37 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Wed, 24 Sep 2008 18:26:37 -0300 Subject: [reportlab-users] A teaser: TeX quality equations in reportlab Message-ID: <200809241826.37638.ralsina@netmanagers.com.ar> I am working on a platypus flowable that takes TeX syntax and produces (hopefully) TeX quality equations. It doesn't require TeX, and doesn't involve embedding images. It should be trivial to extract from rst2pdf and adopt for any other users, since it will be a single self-contained module. Hopefully, it will be ready this friday. Here's a peek: http://lateral.netmanagers.com.ar/weblog/2008/09/24.html#BB758 -- ("\''/").__..-''"`-. . 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 Wed Sep 24 18:17:09 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 24 Sep 2008 23:17:09 +0100 Subject: [reportlab-users] ANN: pdfnup 0.3.0 In-Reply-To: <85390C9A-F9E8-45FE-B612-44F20435D9BB@darwin.in-berlin.de> References: <20BB4A0E-EDB4-44E2-8A2C-1BA7A7BE3BC3@darwin.in-berlin.de> <48DA77A7.2090304@probo.com> <85390C9A-F9E8-45FE-B612-44F20435D9BB@darwin.in-berlin.de> Message-ID: <956003ae0809241517j5d165a44g60e72c93fcab374f@mail.gmail.com> 2008/9/24 Dinu Gherman : > anybody else. In fact, I've made the maybe overly optimistic > assumption that on this list most people would be familiar with > the term "n-up", since I thought most would know about tools > like psnup. I got it when I read the page, but my poor senile brain didn't supply the right pronunciation when I first saw it. > "Pdfnup puts multiple logical pages onto each physical sheet > of paper. The input PDF file should follow the Adobe Document > Structuring Conventions." I thought the Adobe "Document Structuring Conventions" apply to postscript, not PDF? Since a PS program is a general purpose program, people needed to follow conventions (like separating each page between magic comments) to make it easy to parse postscript. PDF doesn't need this since a badly structured PDF file just won't parse, and is inherently broken into pages. Did you just mean to say "The input PDF file should comply with [insert version of PDF spec here]"? - Andy From gherman at darwin.in-berlin.de Thu Sep 25 03:56:37 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Thu, 25 Sep 2008 09:56:37 +0200 Subject: [reportlab-users] ANN: pdfnup 0.3.0 In-Reply-To: <956003ae0809241517j5d165a44g60e72c93fcab374f@mail.gmail.com> References: <20BB4A0E-EDB4-44E2-8A2C-1BA7A7BE3BC3@darwin.in-berlin.de> <48DA77A7.2090304@probo.com> <85390C9A-F9E8-45FE-B612-44F20435D9BB@darwin.in-berlin.de> <956003ae0809241517j5d165a44g60e72c93fcab374f@mail.gmail.com> Message-ID: <817C5FEA-5A7D-4469-852E-74E4F57B342B@darwin.in-berlin.de> Andy Robinson: > I thought the Adobe "Document Structuring Conventions" apply > to postscript, not PDF? Since a PS program is a general purpose > program, people needed to follow conventions (like separating > each page between magic comments) to make it easy to > parse postscript. PDF doesn't need this since a badly > structured PDF file just won't parse, and is inherently broken > into pages. Did you just mean to say "The input PDF file should > comply with > [insert version of PDF spec here]"? I had just taken the quote from the psnup man page and adapted it to PDF. I thought about dropping the sentence you wonder about, but then it would have been too short for a citation, I thought, so I left it in. You're right, of course. And here is the full About section of pdfnup, just to reduce further misunderstanding: Pdfnup is a Python module and command-line tool for layouting multiple pages per sheet of a PDF document. Using it you can take a PDF document and create a new PDF document from it where each page contains a number of minimized pages from the original PDF file. Right now pdfnup should be used on documents with all pages the same size, and half square page numbers per sheet work best on paper sizes of the ISO A series. Basically, `pdfnup` wrapps `pyPdf `_, a package written by Mathieu Fenniak, which does not provide tools like this for using the core functionality easily from the command- line or from a Python module. In fact, I wrote it because none of my printer drivers has support for half square values of n (n > 2), like 8, which is very convenient with paper sizes in ISO A formats. I should also add that pdfnup is much inspired by a similar, but simpler and unpublished tool written by Henning von Bargen. I'll add this to the README in the next release. Regards, Dinu From gherman at darwin.in-berlin.de Thu Sep 25 04:26:06 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Thu, 25 Sep 2008 10:26:06 +0200 Subject: [reportlab-users] A teaser: TeX quality equations in reportlab In-Reply-To: <200809241826.37638.ralsina@netmanagers.com.ar> References: <200809241826.37638.ralsina@netmanagers.com.ar> Message-ID: <6A3367EC-5798-431F-88BB-378DDB5D1ABB@darwin.in-berlin.de> Roberto Alsina: > I am working on a platypus flowable that takes TeX syntax and produces > (hopefully) TeX quality equations. It doesn't require TeX, and > doesn't involve > embedding images. You can also google for "mathtran reportlab" to see something similar I wrote and posted to this list in July last year, al- though it was generating bitmaps, only. Actually, this is the posting: http://two.pairlist.net/pipermail/reportlab-users/2007-July/006154.html Regards, Dinu From robin at reportlab.com Thu Sep 25 04:49:24 2008 From: robin at reportlab.com (Robin Becker) Date: Thu, 25 Sep 2008 09:49:24 +0100 Subject: [reportlab-users] A teaser: TeX quality equations in reportlab In-Reply-To: <200809241826.37638.ralsina@netmanagers.com.ar> References: <200809241826.37638.ralsina@netmanagers.com.ar> Message-ID: <48DB5094.70804@chamonix.reportlab.co.uk> Roberto Alsina wrote: > I am working on a platypus flowable that takes TeX syntax and produces > (hopefully) TeX quality equations. It doesn't require TeX, and doesn't involve > embedding images. > > It should be trivial to extract from rst2pdf and adopt for any other users, > since it will be a single self-contained module. > > Hopefully, it will be ready this friday. > > Here's a peek: http://lateral.netmanagers.com.ar/weblog/2008/09/24.html#BB758 > very nice indeed. -- Robin Becker From vandeweyer.s at gmail.com Thu Sep 25 08:54:28 2008 From: vandeweyer.s at gmail.com (steven Van de Weyer) Date: Thu, 25 Sep 2008 14:54:28 +0200 Subject: [reportlab-users] wordwraps in tablecells Message-ID: <7a2fa4aa0809250554v43d5e3bbu323fc4faf10eba20@mail.gmail.com> Just started using reportlab to generate some reports. And am new to python (and PyQT) as well What happens: I set my table column width manually. I get data from SQLite to bind with the table cells. Expected to have the string wrapped and the rowheight adjusted, but seems my data is shown across multiple columns on the same line. I checked the mailing list for solutions, but didn't quiet find what I was looking for. Even for this kind of a noob question. This is how I initialise my table t = Table(resvancache,(50,150,150,150,50),None,TableStyle([('INNERGRID', (0,0), (-1,-1), 0.25, colors.black), ('BOX', (0,0), (-1,-1), 0.25, colors.black), ('VALIGN',(0,0),(-1,-1),'MIDDLE'), ('ALIGN',(0,0),(-1,-1),'RIGHT'), ('TEXTCOLOR',(-1,0),(-1,-1),colors.red)]),1) Is there something I have overlooked? Thanks in advance. Steve - Belgium. -------------- next part -------------- An HTML attachment was scrubbed... URL: From niki.spahiev at gmail.com Thu Sep 25 09:25:16 2008 From: niki.spahiev at gmail.com (Niki Spahiev) Date: Thu, 25 Sep 2008 16:25:16 +0300 Subject: [reportlab-users] unicode filenames in Reportlab 2.2 Message-ID: Hello! Reportlab 2.2 can't handle Unicode filenames because it uses utf8str. pdfdoc.py:217 filename = utf8str(filename) f = open(filename, "wb") IMHO this is a bug. regards, Niki Spahiev From wietse.j at gmail.com Thu Sep 25 09:26:56 2008 From: wietse.j at gmail.com (Wietse Jacobs) Date: Thu, 25 Sep 2008 15:26:56 +0200 Subject: [reportlab-users] wordwraps in tablecells In-Reply-To: <7a2fa4aa0809250554v43d5e3bbu323fc4faf10eba20@mail.gmail.com> References: <7a2fa4aa0809250554v43d5e3bbu323fc4faf10eba20@mail.gmail.com> Message-ID: <7d9c65800809250626u45bb6961mcf500dc9d6be042d@mail.gmail.com> 2008/9/25 steven Van de Weyer : > Just started using reportlab to generate some reports. And am new to python > (and PyQT) as well > > What happens: I set my table column width manually. I get data from SQLite > to bind with the table cells. Expected to have the string wrapped and the > rowheight adjusted, but seems my data is shown across multiple columns on > the same line. > > I checked the mailing list for solutions, but didn't quiet find what I was > looking for. Even for this kind of a noob question. > > This is how I initialise my table > > t = Table(resvancache,(50,150,150,150,50),None,TableStyle([('INNERGRID', > (0,0), (-1,-1), 0.25, colors.black), > ('BOX', (0,0), (-1,-1), 0.25, colors.black), > ('VALIGN',(0,0),(-1,-1),'MIDDLE'), > ('ALIGN',(0,0),(-1,-1),'RIGHT'), > ('TEXTCOLOR',(-1,0),(-1,-1),colors.red)]),1) > > Is there something I have overlooked? Thanks in advance. Instead of passing the raw data you can wrap the cell data in a `Paragraph`, something like: table_data = [[Paragraph(col, my_style) for col in row] for row in sql_data] -- --Wietse - also in Belgium ;-) From neophyte7d8 at aim.com Thu Sep 25 11:34:42 2008 From: neophyte7d8 at aim.com (neophyte7d8 at aim.com) Date: Thu, 25 Sep 2008 11:34:42 -0400 Subject: [reportlab-users] unicode filenames in Reportlab 2.2 In-Reply-To: References: Message-ID: <8CAED3B5D23C454-BB8-BF3@webmail-nd02.sysops.aol.com> How about a work-around? f = unicode(filename) or f = unicode(filename, 'utf-8') -----Original Message----- From: Niki Spahiev To: reportlab-users at reportlab.com Sent: Thu, 25 Sep 2008 9:25 pm Subject: [reportlab-users] unicode filenames in Reportlab 2.2 Hello!? ? Reportlab 2.2 can't handle Unicode filenames because it uses utf8str.? ? pdfdoc.py:217? ? ? filename = utf8str(filename)? ? f = open(filename, "wb")? ? IMHO this is a bug.? ? regards,? ? Niki Spahiev? ? _______________________________________________? 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 DJESSUP at usnews.com Thu Sep 25 12:04:07 2008 From: DJESSUP at usnews.com (Jessup, David) Date: Thu, 25 Sep 2008 12:04:07 -0400 Subject: [reportlab-users] Python ReportLab use of splitfirst/splitlast In-Reply-To: <97886A555FD8E14E8F7445D75C11D54DD2DF51@EXCHANGE.usn.root.ent> References: <97886A555FD8E14E8F7445D75C11D54DD2DF51@EXCHANGE.usn.root.ent> Message-ID: <97886A555FD8E14E8F7445D75C11D54DD2DF61@EXCHANGE.usn.root.ent> Just to follow up on my previous e-mail: First, the documentation flat out lies where it reads "In any style command the first row index may be set to one of the special strings 'splitlast' or 'splitfirst' to indicate that the style should be used only for the last row of a split table, or the first row of a continuation." In the current release, the "splitlast" and "splitfirst" row indices break with the aforementioned TypeErrors on the TEXTCOLOR and BACKGROUND commnds. My suspicion, based on reading the source code, is that only the tablestyle line commands (GRID, BOX, LINEABOVE, and LINEBELOW) are currently compatible with the 'splitfirst' and 'splitlast' row indices. I suspect that all cell commands break with the aforementioned TypeErrors. However, I was able to do what I wanted by subclassing the Table class and overriding the onSplit method. Here is my code: class XTable(Table): def onSplit(self, T, byRow=1): T.setStyle(TableStyle([ ('TEXTCOLOR', (0, 1), (1, 1), colors.black)])) What this does is apply the text color black to the first and second cell of the second row of each page. (The first row is a header, repeated by the repeatRows parameter of the Table.) More precisely, it is doing this to the first and second cell of each frame, but since I am using the SimpleDocTemplate, frames and pages are identical. -----Original Message----- From: reportlab-users-bounces at reportlab.com [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of Jessup, David Sent: Wednesday, September 17, 2008 4:36 PM To: reportlab-users at reportlab.com Subject: [reportlab-users] Python ReportLab use of splitfirst/splitlast I'm trying to use Python with ReportLab 2.2 to create a PDF report. According to the user guide at http://www.reportlab.com/docs/userguide.pdf, > Special TableStyle Indeces [sic] > > In any style command the first row index may be set to one of the > special strings 'splitlast' or 'splitfirst' to indicate that the > style should be used only for the last row of a split table, or the > first row of a continuation. This allows splitting tables with nicer > effects around the split. I've tried to use splitfirst to create some special formatting for the first row on a page: main_table.setStyle(TableStyle([ ('TEXTCOLOR', (0, 'splitfirst'), (1, 0), colors.black), ])) and it breaks with the message: > Traceback (most recent call last): > File "./photo_payments_report.py", line 307, in > pdfize_data(data=payment_data, output_filename=output_filename) > File "./photo_payments_report.py", line 128, in pdfize_data > ('TEXTCOLOR', (0, 'splitfirst'), (1, 0), colors.black), > File "/usr/local/lib/python2.5/site-packages/reportlab/platypus/tables.py", line 931, in setStyle > self._addCommand(cmd) > File "/usr/local/lib/python2.5/site-packages/reportlab/platypus/tables.py", line 992, in _addCommand > for i in xrange(sr, er+1): > TypeError: an integer is required Is this functionality simply broken or am I doing something wrong? If the latter, what am I doing wrong? _______________________________________________ reportlab-users mailing list reportlab-users at reportlab.com http://two.pairlist.net/mailman/listinfo/reportlab-users From dkuhlman at rexx.com Thu Sep 25 14:54:06 2008 From: dkuhlman at rexx.com (Dave Kuhlman) Date: Thu, 25 Sep 2008 11:54:06 -0700 Subject: [reportlab-users] reStructuredText to pythonpoint Message-ID: <20080925185406.GA55107@cutter.rexx.com> I use Docutils quite heavily. I'd like to be able to create and edit slides in reST (reStructureText, the input to Docutils). So, I've created an XSLT stylesheet and a python script to do this. There is also a batch file, which does the following: 1. Runs rst2xml.py (from Docutils) to generate XML. 2. Runs rst2pythonpoint.py to transform Docutils XML to pythonpoint XML (uses the XSLT support in lxml). 3. Runs pythonpoint.py to generate PDF. Currently, it works, but is limited. If this is of interest to you or if you have suggestions, please let me know. I can send what I've done so far. Also, here are several comments on pythonpoint: 1. With Reportlab 2.2, in order to run pythonpoint.py, I created a link in the pythonpoint directory to the tools directory:: $ cd tools/pythonpoint $ ln -s ../../tools pythonpoint needs to be able to import things from the tools directory. I do not believe that this is the correct way to solve this, but it did work. Maybe there is something I'm missing about doing some set-up. 2. pythonpoint supports bullet lists, but not enumerated/numbered lists. Are there plans to support enumerated lists? I notice in your documentation on pythonpoint, that there are notes about changing and deprecating the current bullet list support. Did that happen? The above two points are true of both ReportLab 2.2 and the version in the Subversion repository. - Dave -- Dave Kuhlman http://www.rexx.com/~dkuhlman From ralsina at netmanagers.com.ar Thu Sep 25 16:22:52 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Thu, 25 Sep 2008 17:22:52 -0300 Subject: [reportlab-users] Fonts with missing glyphs Message-ID: <200809251722.52728.ralsina@netmanagers.com.ar> From a rst2pdf user's request: Sometimes a glyph is not available in a specific font. For example, unicode box drawing characters are not in Courier. Is there a way reportlab could give a warning if it's being asked to draw a glyph in a font that doesn't have it? That way there will be a warning at rendering time instead of having to view the pdf result. -- ("\''/").__..-''"`-. . 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 alsadi at gmail.com Thu Sep 25 16:41:22 2008 From: alsadi at gmail.com (Muayyad AlSadi) Date: Thu, 25 Sep 2008 23:41:22 +0300 Subject: [reportlab-users] is there any way (eg. XSLT) to convert XSL-FO to pdf using reportlab Message-ID: <385866f0809251341i5e112a8bt5868de019ab8524b@mail.gmail.com> because xsl-fo is in xml I think it can be easy transformed to some format accepted by reportlab have anyone made that, please tell me even if it's just an incomplete hack From andy at reportlab.com Thu Sep 25 16:51:06 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 25 Sep 2008 21:51:06 +0100 Subject: [reportlab-users] wordwraps in tablecells In-Reply-To: <7a2fa4aa0809250554v43d5e3bbu323fc4faf10eba20@mail.gmail.com> References: <7a2fa4aa0809250554v43d5e3bbu323fc4faf10eba20@mail.gmail.com> Message-ID: <956003ae0809251351o750ab1c1u16eaa9e3a76ffdc1@mail.gmail.com> 2008/9/25 steven Van de Weyer : > Just started using reportlab to generate some reports. And am new to python > (and PyQT) as well > > What happens: I set my table column width manually. I get data from SQLite > to bind with the table cells. Expected to have the string wrapped and the > rowheight adjusted, but seems my data is shown across multiple columns on > the same line. Text inside table cells is drawn 'unwrapped'. It's for performance - this makes our library MUCH faster if we are trying to create, say, a 15-column financial table with a lot of short values. As Wietse says, if you want text in table cells to flow, put a Paragraph in the table cell - and thus use the paragraph's style to format it, instead of table formatting commands. - Andy From andy at reportlab.com Thu Sep 25 17:08:02 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 25 Sep 2008 22:08:02 +0100 Subject: [reportlab-users] reStructuredText to pythonpoint In-Reply-To: <20080925185406.GA55107@cutter.rexx.com> References: <20080925185406.GA55107@cutter.rexx.com> Message-ID: <956003ae0809251408l3ee71f25k9342592bec2a5eee@mail.gmail.com> 2008/9/25 Dave Kuhlman : > pythonpoint needs to be able to import things from the tools > directory. > > I do not believe that this is the correct way to solve this, but > it did work. Maybe there is something I'm missing about doing > some set-up. When we rearrange the structure (by popular demand), many things outside the library broke, and this is one of them. (The other few dozen were mostly demos and test suites in our commercial package so invisible to you guys...). The plan is to move all library code in 'tools' into reportlab.lib somewhere so it's always importable. We're hoping to work through this and do a 2.2.1 shortly and I'll let people know when this is in SVN. Or you can do it first and send a patch ;-) > 2. pythonpoint supports bullet lists, but not enumerated/numbered > lists. Are there plans to support enumerated lists? I notice > in your documentation on pythonpoint, that there are notes about > changing and deprecating the current bullet list support. Did > that happen? Pythonpoint is basically a demo I wrote - it predates even calling the package 'ReportLab' - and I have no plans to extend it further myself. There is simply too much other stuff to do on the rare occasions some ReportLab staff have time to work on the open source libraries. So it won't develop unless someone has the energy to send in patches. If your long term goal is making documents from ReST, this is something I hope we will be able to help with. But I think Roberto's rst2pdf, and better support from us in Platypus for things like tables of contents, will provide a great route for anyone to create PDF manuals - or slide shows. There seems to be very little point in going from parsed ReST through XSLT to Pythonpoint markup and then a parser back into Python, when we could go straight to PDF in one process. - Andy From andy at reportlab.com Thu Sep 25 17:16:25 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 25 Sep 2008 22:16:25 +0100 Subject: [reportlab-users] Fonts with missing glyphs In-Reply-To: <200809251722.52728.ralsina@netmanagers.com.ar> References: <200809251722.52728.ralsina@netmanagers.com.ar> Message-ID: <956003ae0809251416k55f3b5b9gc150e22d93ae9178@mail.gmail.com> 2008/9/25 Roberto Alsina : > >From a rst2pdf user's request: > > Sometimes a glyph is not available in a specific font. For example, unicode > box drawing characters are not in Courier. Is there a way reportlab could give > a warning if it's being asked to draw a glyph in a font that doesn't have it? We thought about this, and even looked at situations where we invisibly 'switch font' on the fly. I see 2 problems (1) string-drawing is key to perforrmance. Checking every drawString call might be slower, unless we increased our dependency on C. (It would be cheaper to check when the document is saved, or keep a set of characters seen in each font, so at least we could warn people). (2) worse, we don't actually know what's in YOUR copy of Courier. That's a feature of the version of Adobe Reader, or its competitors, which you use to view the PDF. I've seen files with, say, Serbo-Croat accents which are readable in a Bosnian version of Adobe Reader, but show as black blobs in a US English one. Same file, same (alleged) font. Now we have moved to unicode input, we have to assume all characters are valid input. (It would have been easier prior to 2.0 when we often knew the character set of the font). - Andy From ralsina at netmanagers.com.ar Thu Sep 25 21:55:52 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Thu, 25 Sep 2008 22:55:52 -0300 Subject: [reportlab-users] Fonts with missing glyphs In-Reply-To: <956003ae0809251416k55f3b5b9gc150e22d93ae9178@mail.gmail.com> References: <200809251722.52728.ralsina@netmanagers.com.ar> <956003ae0809251416k55f3b5b9gc150e22d93ae9178@mail.gmail.com> Message-ID: <200809252255.54962.ralsina@netmanagers.com.ar> On Thursday 25 September 2008 18:16:25 Andy Robinson wrote: > 2008/9/25 Roberto Alsina : > > >From a rst2pdf user's request: > > > > Sometimes a glyph is not available in a specific font. For example, > > unicode box drawing characters are not in Courier. Is there a way > > reportlab could give a warning if it's being asked to draw a glyph in a > > font that doesn't have it? > > We thought about this, and even looked at situations where we > invisibly 'switch font' on the fly. I see 2 problems > > (1) string-drawing is key to perforrmance. Checking every drawString > call might be slower, unless we increased our dependency > on C. (It would be cheaper to check when the document is saved, or > keep a set of characters seen in each font, so at least we could warn > people). > > (2) worse, we don't actually know what's in YOUR copy of Courier. > That's a feature of the version of Adobe Reader, or its competitors, > which you use to view the PDF. I've seen files with, say, Serbo-Croat > accents which are readable in a Bosnian version of Adobe Reader, but > show as black blobs in a US English one. Same file, same (alleged) > font. Now we have moved to unicode input, we have to assume all > characters are valid input. (It would have been easier prior to 2.0 > when we often knew the character set of the font). Ok, then, marked as "not a real bug". -- ("\''/").__..-''"`-. . 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 mjf at pearson.co.uk Fri Sep 26 09:19:01 2008 From: mjf at pearson.co.uk (Matt Folwell) Date: Fri, 26 Sep 2008 14:19:01 +0100 Subject: [reportlab-users] PATCH: Using font ascent to position string content in tables Message-ID: <48DCE145.9040804@pearson.co.uk> In ReportLab 2.2, platypus paragraphs have started to read the ascent from the font to work out where to put the text' baseline. I think tables should do the same for cells that contain a string, so you can switch between the two without the text moving, all other things being equal. Here's a patch to do that, and a script to generate an example PDF containing a table with strings in one column and paragraphs in the other. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: table_font_ascent.patch Url: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: table_font_ascent_example.py Url: From gherman at darwin.in-berlin.de Fri Sep 26 10:18:58 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 26 Sep 2008 16:18:58 +0200 Subject: [reportlab-users] ANN: svglib 0.6.0 Message-ID: Hi, after a long development pause I'm glad to announce svglib 0.6.0 which has mostly been only repackaged and extended with a huge test suite (partly downloaded from the W3C). Other than that only some small buglets were fixed and the API has changed to reflect the package reorganisation. From the README: `Svglib` is an experimental library for reading `SVG `_ files and converting them (to a reasonable degree) to other formats using the Open Source `ReportLab Toolkit `_. As a package it reads existing SVG files and returns them converted to Report- Lab Drawing objects that can be used in a variety of ReportLab- related contexts, e.g. as Platypus Flowable objects or in RML2PDF. As a command-line tool it converts SVG files into PDF ones. Tests include a vast amount of tests from the `W3C SVG test suite `_. You should be able to easy_install "svglib" and lookup details in the Python Package Index: http://pypi.python.org/pypi/svglib I have added some tests trying to compare svglib with unicon- vertor, which gives very mixed results, since uniconv fails to work properly on any of the W3C sample files. Regards, Dinu -------------- next part -------------- An HTML attachment was scrubbed... URL: From dkuhlman at rexx.com Fri Sep 26 13:59:09 2008 From: dkuhlman at rexx.com (Dave Kuhlman) Date: Fri, 26 Sep 2008 17:59:09 +0000 (UTC) Subject: [reportlab-users] reStructuredText to pythonpoint References: <20080925185406.GA55107@cutter.rexx.com> <956003ae0809251408l3ee71f25k9342592bec2a5eee@mail.gmail.com> Message-ID: Andy Robinson reportlab.com> writes: > > If your long term goal is making documents from ReST, this is > something I hope we will be able to help with. But I think Roberto's > rst2pdf, and better support from us in Platypus for things like tables > of contents, will provide a great route for anyone to create PDF > manuals - or slide shows. There seems to be very little point in > going from parsed ReST through XSLT to Pythonpoint markup and then a > parser back into Python, when we could go straight to PDF in one > process. > > - Andy I agree with your thinking that rst2pdf is a more direct route from reST to PDF. And, I think rst2pdf is a very good idea. I intend to look at it and use it. Hopefully, it can be used to create slides in PDF. I've been using OpenOffice ooimpress and then exporting to PDF, which is very awkward. I do like the idea of transformations on XML with a backend that generates PDF. And, I wanted to get a little more experience with XSLT. So, this was a good exercise for me anyway. And, thanks for a great library, by the way. - Dave From ralsina at netmanagers.com.ar Fri Sep 26 14:52:41 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 26 Sep 2008 15:52:41 -0300 Subject: [reportlab-users] reStructuredText to pythonpoint In-Reply-To: References: <20080925185406.GA55107@cutter.rexx.com> <956003ae0809251408l3ee71f25k9342592bec2a5eee@mail.gmail.com> Message-ID: <200809261552.42573.ralsina@netmanagers.com.ar> On Friday 26 September 2008 14:59:09 Dave Kuhlman wrote: > Andy Robinson reportlab.com> writes: > > If your long term goal is making documents from ReST, this is > > something I hope we will be able to help with. But I think Roberto's > > rst2pdf, and better support from us in Platypus for things like tables > > of contents, will provide a great route for anyone to create PDF > > manuals - or slide shows. There seems to be very little point in > > going from parsed ReST through XSLT to Pythonpoint markup and then a > > parser back into Python, when we could go straight to PDF in one > > process. > > > > - Andy > > I agree with your thinking that rst2pdf is a more direct route from reST to > PDF. And, I think rst2pdf is a very good idea. I intend to look at it and > use it. Hopefully, it can be used to create slides in PDF. I've been using > OpenOffice ooimpress and then exporting to PDF, which is very awkward. If you need rst2pdf to do something special, other than "use landscape pages and large fonts" ;-) let me know. For example, page transitions, background drawings, that kind of thing. -- ("\''/").__..-''"`-. . 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 mhearne at usgs.gov Fri Sep 26 15:57:43 2008 From: mhearne at usgs.gov (Michael Hearne) Date: Fri, 26 Sep 2008 13:57:43 -0600 Subject: [reportlab-users] use of RGB colors in RML tables Message-ID: <48DD3EB7.5090102@usgs.gov> Is it possible to specify a background color for a table in RML that uses RGB values? If so, can someone provide an example? All the examples in the User's Guide use named colors like "cornsilk", etc. Thanks, Mike -- ------------------------------------------------------ Michael Hearne mhearne at usgs.gov (303) 273-8620 USGS National Earthquake Information Center 1711 Illinois St. Golden CO 80401 Senior Software Engineer Synergetics, Inc. ------------------------------------------------------ From ralsina at netmanagers.com.ar Fri Sep 26 16:38:24 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 26 Sep 2008 17:38:24 -0300 Subject: [reportlab-users] [ANN] rst2pdf version 0.9 released Message-ID: <200809261738.24894.ralsina@netmanagers.com.ar> I have the pleasure of announcing version 0.9 of this Rst-to-PDF-via-reportlab tool. This release fixes two major bugs, and adds one major feature (math support). You can get it via PyPI (package rst2pdf) or from Google Code: http://rst2pdf.googlecode.com Here are some of the features it provides: * LaTeX style math support (requires matplotlib) * User-defined page layout. Multiple frames per page, multiple layouts per document. * Cascading stylesheet mechanism, define only what you want changed * Supports TTF and Type1 font embedding using a custom stylesheet * "Floating" sidebars (or almost any element) * Any number of paragraph styles using the class directive * Any number of character styles using text roles * Styled table headers and cells * Custom page sizes and margins. * Syntax highlighter for many languages, using Pygments * Supports hyphenation (using wordaxe) * Full user's manual You can see a sample of some features here: http://tinyurl.com/5e4h3j Here's the changelog for the last two versions: New in 0.9 ---------- * Math support via matplotlib (no TeX required) * Huge bug in header/footer page numbers/section names fixed * Several bugs in nested lists fixed (not 100% correct yet, but better) * Lists that don't start at 1 work now * Nicer definition lists New in 0.8.1 ------------ * Support for more complex headers and footers (including image directives and tables) * Optional inline links * Wordaxe 0.2.6 support * Several bugs fixed (issues 48,68,41,60,58,64,67) * Support for system-wide config file * Better author metadata Best regards, -- ("\''/").__..-''"`-. . 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 ralsina at netmanagers.com.ar Fri Sep 26 16:44:35 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 26 Sep 2008 17:44:35 -0300 Subject: [reportlab-users] The math flowable Message-ID: <200809261744.35684.ralsina@netmanagers.com.ar> Since I just released rst2pdf 0.9, that means the math flowable I was doing works :-) It's a single small file, requires matplotlib installed: http://code.google.com/p/rst2pdf/source/browse/trunk/rst2pdf/math_flowable.py Given a piece of latex-like math it gives you a flowable that draws it, embedding all necessary TTF fonts in the process. It also has a genImage method, so you can use it to create a PNG that you can then use inline in a paragraph if you have to. This is slightly buggy. Less than 100 lines of code so how buggy can it be? ;-) License is MIT, so it's quite liberal, I'd like to know if you use it, though. -- ("\''/").__..-''"`-. . 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 henning.vonbargen at arcor.de Sun Sep 28 04:31:01 2008 From: henning.vonbargen at arcor.de (Henning von Bargen) Date: Sun, 28 Sep 2008 10:31:01 +0200 Subject: [reportlab-users] [ANN] rst2pdf version 0.9 released References: Message-ID: Roberto, this is cool! Henning From gherman at darwin.in-berlin.de Sun Sep 28 10:00:43 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Sun, 28 Sep 2008 16:00:43 +0200 Subject: [reportlab-users] ANN: pdfnup 0.3.0 In-Reply-To: <956003ae0809240353q2f87ccas99dd1e8ccfe8e383@mail.gmail.com> References: <20BB4A0E-EDB4-44E2-8A2C-1BA7A7BE3BC3@darwin.in-berlin.de> <956003ae0809240353q2f87ccas99dd1e8ccfe8e383@mail.gmail.com> Message-ID: <1710D48D-0275-44E7-A27E-2DDE954B2A3E@darwin.in-berlin.de> Andy Robinson: > Dinu Gherman : >> Sadly, I cannot establish a proper dependency to the RL toolkit >> in PyPI/setuptools, because the RL code isn't propperly regist- >> ered there. > > We'll try to do the PyPI thing for 2.2.1, but that's likely to be next > week due to some unanticipated deadlines in the next 2 days. As it turns out in this case it was quite easy to remove the dependency on ReportLab, which results in a just released version 0.3.1: http://pypi.python.org/pypi/pdfnup/0.3.1 Other than that nothing has changed. But I think not having to install ReportLab for a rather simple tool like this is a big advantage for most typical users. Regards, Dinu -------------- next part -------------- An HTML attachment was scrubbed... URL: From reportlabemail at gmail.com Sun Sep 28 15:34:01 2008 From: reportlabemail at gmail.com (Zach Rezucha) Date: Sun, 28 Sep 2008 15:34:01 -0400 Subject: [reportlab-users] platypus textbox Message-ID: Hello all,I am very new to python and of course reportlab, so you have to talk to me like i'm a retard. I need to do a paragraph, but i need to draw it from the top left. It draws from the bottom left. I know the canvas origin is on the bottom left, and that is fine, it is just the paragraph. Anyone know? Thanx -zach -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Mon Sep 29 05:07:28 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 29 Sep 2008 10:07:28 +0100 Subject: [reportlab-users] platypus textbox In-Reply-To: References: Message-ID: <956003ae0809290207t27b93af3n85336525bd8fba2c@mail.gmail.com> 2008/9/28 Zach Rezucha : > Hello all, > I am very new to python and of course reportlab, so you have to talk to me > like i'm a retard. I need to do a paragraph, but i need to draw it from the > top left. It draws from the bottom left. I know the canvas origin is on the > bottom left, and that is fine, it is just the paragraph. Anyone know? Thanx > -zach If you're making a full flowing document using Platypus, then the paragraphs will flow down from the top. If you just want to draw a single paragraph and nothing else, you should call w, h = myPara.wrap(availWidth, availHeight) which will tell you how much width and height it wants to use up. Practically, give it a large enough height (e.g. 1000 points) and the width you want. The return value tells you the height of the paragraph. Then, draw at x, y+h instead of x,y - Andy From andy at reportlab.com Mon Sep 29 05:20:22 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 29 Sep 2008 10:20:22 +0100 Subject: [reportlab-users] use of RGB colors in RML tables In-Reply-To: <48DD3EB7.5090102@usgs.gov> References: <48DD3EB7.5090102@usgs.gov> Message-ID: <956003ae0809290220m331a06c2w50670de9f0f834b1@mail.gmail.com> 2008/9/26 Michael Hearne : > Is it possible to specify a background color for a table in RML that uses > RGB values? If so, can someone provide an example? > All the examples in the User's Guide use named colors like "cornsilk", etc. > Thanks, Hi Michael, It should accept any of the following values in an attribute: HTML-like hex codes e.g. '#ddee00' Pythonic hex code e.g. '0xddee00' 3-tuple with range of 0 to 1 e.g. "(1.0,0.5,1.0)" 4-tuple for CMYK versions of the above - Andy From andy at reportlab.com Mon Sep 29 05:22:52 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 29 Sep 2008 10:22:52 +0100 Subject: [reportlab-users] reStructuredText to pythonpoint In-Reply-To: <200809261552.42573.ralsina@netmanagers.com.ar> References: <20080925185406.GA55107@cutter.rexx.com> <956003ae0809251408l3ee71f25k9342592bec2a5eee@mail.gmail.com> <200809261552.42573.ralsina@netmanagers.com.ar> Message-ID: <956003ae0809290222u76a63c1bje448af77d20eb0a4@mail.gmail.com> 2008/9/26 Roberto Alsina : > For example, page transitions, background drawings, that kind of thing. It would certainly make sense to expose the page transitions. I don't know if you have ever seen these, but Pythonpoint demonstrates them. - Andy From ralsina at netmanagers.com.ar Mon Sep 29 07:04:58 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Mon, 29 Sep 2008 08:04:58 -0300 Subject: [reportlab-users] reStructuredText to pythonpoint In-Reply-To: <956003ae0809290222u76a63c1bje448af77d20eb0a4@mail.gmail.com> References: <20080925185406.GA55107@cutter.rexx.com> <200809261552.42573.ralsina@netmanagers.com.ar> <956003ae0809290222u76a63c1bje448af77d20eb0a4@mail.gmail.com> Message-ID: <200809290805.09063.ralsina@netmanagers.com.ar> On Monday 29 September 2008 06:22:52 Andy Robinson wrote: > 2008/9/26 Roberto Alsina : > > For example, page transitions, background drawings, that kind of thing. > > It would certainly make sense to expose the page transitions. > I don't know if you have ever seen these, but Pythonpoint demonstrates > them. I'll take a look this week. -- ("\''/").__..-''"`-. . 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