From cfoster at oda.state.or.us Wed Nov 5 12:45:11 2008 From: cfoster at oda.state.or.us (Chris Foster) Date: Wed, 5 Nov 2008 09:45:11 -0800 Subject: [reportlab-users] even number of pages Message-ID: I have variable length, Platypus reports that will be printed double- sided. Is there an easy way to be sure I always have an even number of pages per report? From timr at probo.com Wed Nov 5 13:19:07 2008 From: timr at probo.com (Tim Roberts) Date: Wed, 05 Nov 2008 10:19:07 -0800 Subject: [reportlab-users] even number of pages In-Reply-To: References: Message-ID: <4911E39B.9010302@probo.com> Chris Foster wrote: > I have variable length, Platypus reports that will be printed > double-sided. Is there an easy way to be sure I always have an even > number of pages per report? Are you going to be pumping out several reports in a row as a single PDF file? If not, your printer driver will handle this for you. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From cfoster at oda.state.or.us Wed Nov 5 13:24:49 2008 From: cfoster at oda.state.or.us (Chris Foster) Date: Wed, 5 Nov 2008 10:24:49 -0800 Subject: [reportlab-users] even number of pages (nevermind) Message-ID: <379CE716-35E1-40C8-A39D-E47949EA656D@oda.state.or.us> Sorry, just a brief moment of panic (two days until production). I forgot I'm also merging variable length letters with pyPDF in post processing and the problem is easily handled there. Obviously, it is not a ReportLab issue at all. From andy at reportlab.com Thu Nov 6 02:28:08 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 6 Nov 2008 07:28:08 +0000 Subject: [reportlab-users] even number of pages (nevermind) In-Reply-To: <379CE716-35E1-40C8-A39D-E47949EA656D@oda.state.or.us> References: <379CE716-35E1-40C8-A39D-E47949EA656D@oda.state.or.us> Message-ID: <956003ae0811052328q72535cb2lb8b719768efd837e@mail.gmail.com> 2008/11/5 Chris Foster : > Sorry, just a brief moment of panic (two days until production). > > I forgot I'm also merging variable length letters with pyPDF in post > processing and the problem is easily handled there. Obviously, it is not a > ReportLab issue at all. Funnily enough we have added some (as yet undocumented) flowables to help this kind of thing - in our case making sure certain things happen in the right places on 4-page spreads. These new flowables can include content or not depending on the current page, frame or position. If curious, look at the bottom of reportlab/platypus/flowables.py on trunk. But PyPDF is definitely the easiest way if you just need to conditionally add a blank page. - Andy From zhangbinjr at gmail.com Fri Nov 7 02:13:12 2008 From: zhangbinjr at gmail.com (zhang bin) Date: Fri, 7 Nov 2008 15:13:12 +0800 Subject: [reportlab-users] how to make text-image searchable Message-ID: <932c22540811062313l342e33c5h1c150ee6ec4cad4e@mail.gmail.com> hello,guys, Have you ever noticed that some old pdf files's character glyphs are not as clear as the standard font.Besides,you can search some characters by the adobe reader. But some can not. I thought this type of pdf is just an image from the scanner drawing on the pdf canvas.The producer can not ensure the high accuracy of the text OCR.So they just provide extract text information.In this way ,the pdf file's text is right when reading,but reduce the search text accuracy. My question is how can they relate the image's information with the text information,which makes adobe reader can search the text. can reportlab do this job? I have tried reportlab simply paint the text image to pdf which can not search the characters.And I have a "stupid" solution, paint the text image to the canvas,the show the character in a transparent way in the exact position as the text image.But any better ways? Thanks a lot. -- best regards, zhangbin -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Fri Nov 7 02:33:44 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 7 Nov 2008 07:33:44 +0000 Subject: [reportlab-users] how to make text-image searchable In-Reply-To: <932c22540811062313l342e33c5h1c150ee6ec4cad4e@mail.gmail.com> References: <932c22540811062313l342e33c5h1c150ee6ec4cad4e@mail.gmail.com> Message-ID: <956003ae0811062333v4abd3c92uad1c34d6f59bee9d@mail.gmail.com> 2008/11/7 zhang bin : > hello,guys, > My question is how can they relate the image's information with the > text information,which makes adobe reader can search the text. can reportlab > do this job? No, it can't. I think there was a recent extension to PDF to allow 'tagged text' - basically a separate hidden text stream withing the file somewhere - which is also used to reflow text if you are reading on a PDA or some other device with a small screen. But we have not implemented this and not even studied it.... Sorry, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From darren at ontrenet.com Fri Nov 7 09:39:13 2008 From: darren at ontrenet.com (Darren Govoni) Date: Fri, 07 Nov 2008 09:39:13 -0500 Subject: [reportlab-users] Embed comments in PDF? Message-ID: <1226068754.6947.4.camel@nuraku> Hi, Is it possible to read in an existing PDF, write comments into yet (so they appear as comments to Adobe Reader) and write it back out with reportlab? Maybe the "comments" are just some metadata, but I couldn't see in the API how this might be done. thanks. Darren PS. I also tried to contact the PyPDF author, but no response after 3 tries. From andy at reportlab.com Fri Nov 7 09:45:01 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 7 Nov 2008 14:45:01 +0000 Subject: [reportlab-users] Embed comments in PDF? In-Reply-To: <1226068754.6947.4.camel@nuraku> References: <1226068754.6947.4.camel@nuraku> Message-ID: <956003ae0811070645m4a1fe6dat9354256b7581b938@mail.gmail.com> 2008/11/7 Darren Govoni : > Hi, > Is it possible to read in an existing PDF, write comments into yet (so > they appear as comments to Adobe Reader) and write it back out with > reportlab? Maybe the "comments" are just some metadata, but I couldn't > see in the API how this might be done. No it isn't. Our commercial package doesn't do this either. Sorry! > PS. I also tried to contact the PyPDF author, but no response after 3 > tries. In the open source world people do tend to move onto new projects, sadly. Except for us - we mostly remain stationary on the same old project ;-) -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From darren at ontrenet.com Fri Nov 7 09:53:05 2008 From: darren at ontrenet.com (Darren Govoni) Date: Fri, 07 Nov 2008 09:53:05 -0500 Subject: [reportlab-users] Embed comments in PDF? In-Reply-To: <956003ae0811070645m4a1fe6dat9354256b7581b938@mail.gmail.com> References: <1226068754.6947.4.camel@nuraku> <956003ae0811070645m4a1fe6dat9354256b7581b938@mail.gmail.com> Message-ID: <1226069585.6947.8.camel@nuraku> Hi Andy, Well darn. Hehe. Since I'm a one-track-mind I will maybe have to write my own mod to do this and give it back to the community. Now to hunt down the PDF file format spec. Oh joy! Darren On Fri, 2008-11-07 at 14:45 +0000, Andy Robinson wrote: > 2008/11/7 Darren Govoni : > > Hi, > > Is it possible to read in an existing PDF, write comments into yet (so > > they appear as comments to Adobe Reader) and write it back out with > > reportlab? Maybe the "comments" are just some metadata, but I couldn't > > see in the API how this might be done. > > No it isn't. Our commercial package doesn't do this either. Sorry! > > > PS. I also tried to contact the PyPDF author, but no response after 3 > > tries. > > In the open source world people do tend to move onto new projects, > sadly. Except for us - we mostly remain stationary on the same old > project ;-) > > From yroman-reportlab at altalang.com Fri Nov 7 09:57:58 2008 From: yroman-reportlab at altalang.com (Yoann Roman) Date: Fri, 7 Nov 2008 09:57:58 -0500 Subject: [reportlab-users] Embed comments in PDF? In-Reply-To: <1226069585.6947.8.camel@nuraku> References: <1226068754.6947.4.camel@nuraku><956003ae0811070645m4a1fe6dat9354256b7581b938@mail.gmail.com> <1226069585.6947.8.camel@nuraku> Message-ID: <002501c940e9$38d26540$0502000a@ad.altalang.com> > Hi Andy, > Well darn. Hehe. Since I'm a one-track-mind I will maybe have to > write my own mod to do this and give it back to the community. > > Now to hunt down the PDF file format spec. Oh joy! I believe ReportLab is based on 1.3: http://www.adobe.com/devnet/pdf/pdfs/PDFReference13.pdf Not sure if Acrobat comments were part of that version or not, though. -- Yoann Roman From darren at ontrenet.com Fri Nov 7 10:23:31 2008 From: darren at ontrenet.com (Darren Govoni) Date: Fri, 07 Nov 2008 10:23:31 -0500 Subject: [reportlab-users] Embed comments in PDF? In-Reply-To: <002501c940e9$38d26540$0502000a@ad.altalang.com> References: <1226068754.6947.4.camel@nuraku> <956003ae0811070645m4a1fe6dat9354256b7581b938@mail.gmail.com> <1226069585.6947.8.camel@nuraku> <002501c940e9$38d26540$0502000a@ad.altalang.com> Message-ID: <1226071411.6947.9.camel@nuraku> It has metadata API to PDF, so perhaps comments are structured as metadata fields (I'm a PDF format noob). He released a version in September. I will have to dig into it deeper to find out I think. On Fri, 2008-11-07 at 09:57 -0500, Yoann Roman wrote: > > Hi Andy, > > Well darn. Hehe. Since I'm a one-track-mind I will maybe have to > > write my own mod to do this and give it back to the community. > > > > Now to hunt down the PDF file format spec. Oh joy! > > I believe ReportLab is based on 1.3: > http://www.adobe.com/devnet/pdf/pdfs/PDFReference13.pdf > > Not sure if Acrobat comments were part of that version or not, though. > From andy at reportlab.com Fri Nov 7 10:53:39 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 7 Nov 2008 15:53:39 +0000 Subject: [reportlab-users] Embed comments in PDF? In-Reply-To: <1226069585.6947.8.camel@nuraku> References: <1226068754.6947.4.camel@nuraku> <956003ae0811070645m4a1fe6dat9354256b7581b938@mail.gmail.com> <1226069585.6947.8.camel@nuraku> Message-ID: <956003ae0811070753s1858cb9ch63e01d596cc25aa6@mail.gmail.com> 2008/11/7 Darren Govoni : > Hi Andy, > Well darn. Hehe. Since I'm a one-track-mind I will maybe have to > write my own mod to do this and give it back to the community. > Now to hunt down the PDF file format spec. Oh joy! Hunting it down isn't the problem - bottom link here, ignore the exhortations to pay ISO for a copy.... http://www.adobe.com/devnet/pdf/pdf_reference.html You begin to taste the 'joy' when you've spent a night or two reading it, but the true sensual pleasure only really kicks in when you try to implement some feature and need a few dozen tries... Py2PDf is probably a better starting point since it is inherently read/write - our own library is designed to be read-only. It's also worth looking at Bruno Lowagie's iText library in Java in case he's solved it... But we'd be very happy to accept any patches if you get something going. -- Andy From henry at itaapy.com Fri Nov 7 13:29:27 2008 From: henry at itaapy.com (Obein Henry) Date: Fri, 07 Nov 2008 19:29:27 +0100 Subject: [reportlab-users] Indenter inside a table cell Message-ID: <49148907.7020907@itaapy.com> Hello, I try to add an Indenter flowable inside a table cell but the table object does not handle the FrameActionFlowable object. I mix Indenter and Paragraph flowable to simulate a list of items like ul/ol tag in HTML. It works inside a frame but not inside a table. Is there another way (maybe easier) to do this ? Regards, Henry From gabor at nekomancer.net Mon Nov 10 05:39:33 2008 From: gabor at nekomancer.net (=?ISO-8859-1?Q?G=E1bor_Farkas?=) Date: Mon, 10 Nov 2008 11:39:33 +0100 Subject: [reportlab-users] ttf "fallback".. is it supported somehow? Message-ID: <2c173a350811100239k4ebed996v84cc99bc92638fde@mail.gmail.com> hi, is it somehow possible, to specify multiple ttf files for a paragraph, and reportlab would use by default the first ttf, and if some glyph is not found in it, then it would try to find those glyphs in the second font etc? or some other way? my problem is that i do not have one single TTF font which covers all the characters i need to enter into the PDF file. but i have a collection of TTF files which could together cover it. basically i'd like to do in a PDF what web-browsers do when displaying a html-page. thanks, gabor From robin at reportlab.com Mon Nov 10 06:03:39 2008 From: robin at reportlab.com (Robin Becker) Date: Mon, 10 Nov 2008 11:03:39 +0000 Subject: [reportlab-users] ttf "fallback".. is it supported somehow? In-Reply-To: <2c173a350811100239k4ebed996v84cc99bc92638fde@mail.gmail.com> References: <2c173a350811100239k4ebed996v84cc99bc92638fde@mail.gmail.com> Message-ID: <4918150B.3000408@chamonix.reportlab.co.uk> G?bor Farkas wrote: > hi, > > is it somehow possible, to specify multiple ttf files for a paragraph, > and reportlab would use by default the first ttf, and if some glyph is > not found in it, > then it would try to find those glyphs in the second font etc? or some > other way? > > my problem is that i do not have one single TTF font which covers all > the characters i need to > enter into the PDF file. but i have a collection of TTF files which > could together cover it. > > basically i'd like to do in a PDF what web-browsers do when > displaying a html-page. > > thanks, > gabor art present we only have fallbacks for the T1 fonts. The truetype fonts have a very different layout model which involves subsetting etc etc. I suppose we could add an extra layer above that and create a multi-ttf font type which would do as you suggest, but not right now. -- Robin Becker From gherman at darwin.in-berlin.de Mon Nov 10 06:20:40 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 10 Nov 2008 12:20:40 +0100 Subject: [reportlab-users] ANN: svglib 0.6.1 Message-ID: <008E05C8-0AD0-49C0-B3BF-6B6F4B024D04@darwin.in-berlin.de> Hi, I'm glad to release svglib 0.6.1, a library for reading SVG and converting it to ReportLab Graphics objects: http://pypi.python.org/pypi/svglib This release fixes a few buglets and uses a new set of 199 SVG flags accessed online from Wikipedia.org [1]. These make great examples because many of them are very simple, while a few others are quite complex. When you run the testsuite these SVG samples will be down- loaded and converted to PDF. As you will see there are some buglets for a few of these flags. If this should be the case for the country you live in you're invited to help debug the code to fix the respective flag! Also, I've added conversion tests using a tool named uni- converter (if present) which has generated recently some enthusiasm on this list. It's interesting to compare it to svglib by running the respective tests (after uncommen- ting them). I had to uncomment these because they take very long and generally produce more errors and inferior results, compared to svglib, but YMMV. Regards, Dinu [1] http://en.wikipedia.org/wiki/Gallery_of_sovereign_state_flags From chris.kratz at vistashare.com Wed Nov 12 09:09:06 2008 From: chris.kratz at vistashare.com (Chris Kratz) Date: Wed, 12 Nov 2008 09:09:06 -0500 Subject: [reportlab-users] Dual pass numbered canvas causes images to disappear Message-ID: <3642025c0811120609y49b77afeg9ed3e142364f9a4e@mail.gmail.com> Hello all, When generating a pdf, if I use the normal canvas, my image shows up just fine in the generated pdf. doc.build(story, onFirstPage=self.firstPage, onLaterPages=self.laterPages) But, I need the ability to print page x of y in the footers. So, I used a slightly modified version of the NumberedCanvas class found here: http://code.activestate.com/recipes/546511/ So, when I call doc.build with the NumberedCanvas, I get the Page x of y in the footer, but images just seem to not show. No errors or any other indications of problems, just no images. The document size seems to indicate the image is included in the pdf, even if it isn't displaying. doc.build(story, onFirstPage=self.firstPage, onLaterPages=self.laterPages, canvasmaker=NumberedCanvas) class NumberedCanvas(canvas.Canvas): def __init__(self, *args, **kwargs): canvas.Canvas.__init__(self, *args, **kwargs) self._codes = [] def showPage(self): self._codes.append({'code': self._code, 'stack': self._codeStack}) self._startPage() def save(self): """add page info to each page (page x of y)""" # reset page counter self._pageNumber = 0 for code in self._codes: # recall saved page self._code = code['code'] self._codeStack = code['stack'] # handle any headers like page numbers that need to updated after complete rendering self.setFont("Times-Roman",9) for x,y,hdrStr,func in self.liveHdrs: func(x,y,LIVE_HDR_KEYS[hdrStr] % { 'pageNumber' : self._pageNumber+1, 'pageTotal' : len(self._codes)}) canvas.Canvas.showPage(self) canvas.Canvas.save(self) * the call to func is a handle to either drawString, drawCentredString or drawRightString depending on where the user asked for the footer to be placed. Anyone have any ideas why NumberedCanvas might stop images from showing? Is there anything I can do to debug this further or a better way to do "Page x of y"? Thanks -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From gabor at nekomancer.net Wed Nov 12 09:48:27 2008 From: gabor at nekomancer.net (=?ISO-8859-1?Q?G=E1bor_Farkas?=) Date: Wed, 12 Nov 2008 15:48:27 +0100 Subject: [reportlab-users] aalways using wordWrapping="CJK", any disadvantages? Message-ID: <2c173a350811120648o37c78428p1432a2cf8b2c5b87@mail.gmail.com> hi, i'm working on a pdf document, that sometimes might contain japanese or chinese text, so i'd like it to wrap such text correctly. i know that saying wordWrapping="CJK".. but i cannot see any disadvantages when using it for non-cjk-text, so i was thinking about simply turning it on for every possible language. are there are problems with such approach? in other words, are there any situations, when it's not a good idea to have wordWrappign="CJK" ? thanks, gabor From gabor at nekomancer.net Wed Nov 12 09:58:45 2008 From: gabor at nekomancer.net (=?ISO-8859-1?Q?G=E1bor_Farkas?=) Date: Wed, 12 Nov 2008 15:58:45 +0100 Subject: [reportlab-users] aalways using wordWrapping="CJK", any disadvantages? In-Reply-To: <2c173a350811120648o37c78428p1432a2cf8b2c5b87@mail.gmail.com> References: <2c173a350811120648o37c78428p1432a2cf8b2c5b87@mail.gmail.com> Message-ID: <2c173a350811120658o6ee4d16ep9e976cee1a29681a@mail.gmail.com> On Wed, Nov 12, 2008 at 3:48 PM, G?bor Farkas wrote: > > in other words, are there any situations, when it's not a good idea to > have wordWrappign="CJK" ? ok, please ignore this question, i've found the problematic situation already :-) thanks, gabor From timr at probo.com Wed Nov 12 17:09:31 2008 From: timr at probo.com (Tim Roberts) Date: Wed, 12 Nov 2008 14:09:31 -0800 Subject: [reportlab-users] Dual pass numbered canvas causes images to disappear In-Reply-To: <3642025c0811120609y49b77afeg9ed3e142364f9a4e@mail.gmail.com> References: <3642025c0811120609y49b77afeg9ed3e142364f9a4e@mail.gmail.com> Message-ID: <491B541B.80700@probo.com> Chris Kratz wrote: > > When generating a pdf, if I use the normal canvas, my image shows up > just fine in the generated pdf. > > doc.build(story, onFirstPage=self.firstPage, onLaterPages=self.laterPages) > > But, I need the ability to print page x of y in the footers. So, I > used a slightly modified version of the NumberedCanvas class found > here: http://code.activestate.com/recipes/546511/ > > So, when I call doc.build with the NumberedCanvas, I get the Page x of > y in the footer, but images just seem to not show. No errors or any > other indications of problems, just no images. The document size > seems to indicate the image is included in the pdf, even if it isn't > displaying. > ... > Anyone have any ideas why NumberedCanvas might stop images from showing? Yes. It's because that recipe relies on the undocumented internal structure of ReportLab, and the structure has changed since it was written. The standard Canvas showPage procedure sets a flag in the queued up page that says whether the page contains images or not. When the page does not contain images, pdfbase\pdfdoc.py skips the image-handling Postscript code, which is somewhat lengthy. In your code, if the LAST page does not contain images, then NONE of the pages will get the image-handling Postscript. For now, I believe you can short-circuit this by adding self._currentPageHasImages = 1 before calling "canvas.Canvas.showPage(self)". > Is there anything I can do to debug this further or a better way to do > "Page x of y"? The recommended way is to use doc.multibuild to do a two-pass build: one to compute the total number of pages, then another to insert that in the footer. There's also a way to insert a "placeholder" that can be filled in later at the end of the build, but I don't remember what that's called. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From dirk.holtwick at gmail.com Thu Nov 13 08:50:49 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Thu, 13 Nov 2008 14:50:49 +0100 Subject: [reportlab-users] Visual Diff Tool Message-ID: <491C30B9.70006@gmail.com> Hi, while working on xhtml2pdf I have the general problem that writing test cases is quite difficult. The normal way is to create some test PDF and then have a look at them if they are looking fine. But that is a source of human errors. Therefore I am looking for a automatic solution. My idea is to automatically do a visual compare of a reference PDF that was already rendered fine once and the recent PDF. Technically I am found out that it would work fine if I use ImageMagic to first create images from PDF and if they differ I can show them in TortoiseIDiff. I started writing such a visual diff tool, but maybe there already exists something similar and I can use this instead of wasting my time on writing the reinvention of the wheel ;) So my question: has anyone seen a tool like this around? If so, please let me know where to find it. Otherwise I would write the visual diff tool and maybe Reportlab also likes to use visual test cases for their toolkit? Cheers Dirk From andy at reportlab.com Thu Nov 13 09:10:33 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 13 Nov 2008 14:10:33 +0000 Subject: [reportlab-users] Visual Diff Tool In-Reply-To: <491C30B9.70006@gmail.com> References: <491C30B9.70006@gmail.com> Message-ID: <956003ae0811130610i7f1c5bdbte1231075a902cb71@mail.gmail.com> 2008/11/13 Dirk Holtwick : > Hi, > > I started writing such a visual diff tool, but maybe there already exists > something similar and I can use this instead of wasting my time on writing > the reinvention of the wheel ;) We had good results internally with a utility called "pdftoppm", which I think is part of the Xpdf distro. http://www.foolabs.com/xpdf/download.html To be honest we are not using it for test cases. I know we should be ;-) We have used it in various "tracing tools" to take measurements off other peoples' PDFs, and to get thumbnails for page previews in a CMS. > So my question: has anyone seen a tool like this around? If so, please let > me know where to find it. Otherwise I would write the visual diff tool and > maybe Reportlab also likes to use visual test cases for their toolkit? Definitely! - Andy From andy at reportlab.com Thu Nov 13 09:21:34 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 13 Nov 2008 14:21:34 +0000 Subject: [reportlab-users] Subversion checkin rights available Message-ID: <956003ae0811130621p7b453548tbf3ab1737b2a87e0@mail.gmail.com> Hi everyone, We've set up an area in our SVN repo with suitable permissions, and a copy of the present trunk for experimental purposes. Anyone who would like checkin rights should email Robin Becker (robin at you-know-where) and myself (andy at you-know-where) with.... (a) their preferred username (BTW we have no internal employees named Dirk, Dinu or Jerome so these are available to the obvious people...) (b) the hash for your password generated by the htpasswd utility (see below) (c) if you are not a regular poster to this list, a brief statement of what you'd like to work on. You can generate the hash we need without needing a password file by doing the following and sending us the last line as follows. andy at kenya:~/Desktop$ htpasswd -n andy New password: Re-type new password: andy:10kgkGlaXfgx. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From dirk.holtwick at gmail.com Thu Nov 13 10:07:36 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Thu, 13 Nov 2008 16:07:36 +0100 Subject: [reportlab-users] Visual Diff Tool In-Reply-To: <956003ae0811130610i7f1c5bdbte1231075a902cb71@mail.gmail.com> References: <491C30B9.70006@gmail.com> <956003ae0811130610i7f1c5bdbte1231075a902cb71@mail.gmail.com> Message-ID: <491C42B8.4050206@gmail.com> > We had good results internally with a utility called "pdftoppm", which > I think is part of the Xpdf distro. > http://www.foolabs.com/xpdf/download.html > > To be honest we are not using it for test cases. I know we should be ;-) > We have used it in various "tracing tools" to take measurements off other > peoples' PDFs, and to get thumbnails for page previews in a CMS. I tested it and it works fine. But I still tend to use ImageMagic because: - It has an easies handling of fonts - It creates PNG, JPG, TIF etc. files which can be compared using TortoiseIDiff (PPM is not supported) >> So my question: has anyone seen a tool like this around? If so, please let >> me know where to find it. Otherwise I would write the visual diff tool and >> maybe Reportlab also likes to use visual test cases for their toolkit? > > Definitely! Fine. I'll keep you updated. Dirk From gherman at darwin.in-berlin.de Thu Nov 13 11:03:35 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Thu, 13 Nov 2008 17:03:35 +0100 Subject: [reportlab-users] Visual Diff Tool In-Reply-To: <491C30B9.70006@gmail.com> References: <491C30B9.70006@gmail.com> Message-ID: Dirk Holtwick: > So my question: has anyone seen a tool like this around? If so, > please let me know where to find it. Otherwise I would write the > visual diff tool and maybe Reportlab also likes to use visual test > cases for their toolkit? I think, people just write this kind of stuff themselves, if they really need it, as I did a while ago [1]. If I re- member correctly, Stefan Richter also did that for z3c.rml, maybe you want to look into that code... Regards, Dinu [1] http://two.pairlist.net/pipermail/reportlab-users/2003-September/002094.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Thu Nov 13 11:43:54 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 13 Nov 2008 16:43:54 +0000 Subject: [reportlab-users] Visual Diff Tool In-Reply-To: <491C42B8.4050206@gmail.com> References: <491C30B9.70006@gmail.com> <956003ae0811130610i7f1c5bdbte1231075a902cb71@mail.gmail.com> <491C42B8.4050206@gmail.com> Message-ID: <956003ae0811130843y3227db00i7f174c2b77663b7@mail.gmail.com> 2008/11/13 Dirk Holtwick : >> We had good results internally with a utility called "pdftoppm", which > I tested it and it works fine. But I still tend to use ImageMagic because: > > - It has an easies handling of fonts > - It creates PNG, JPG, TIF etc. files which can be compared using > TortoiseIDiff (PPM is not supported) pdftoppm is an unfortunate name - it produces most formats and we always asked it to give us .png output. I need to check out ImageMagick and see how well it supports PDFs with embedded form objects, asian fonts, different font models and so on. For our own test suite it really needs to support all the common stuff in PDF. - Andy From andy at reportlab.com Thu Nov 13 11:57:01 2008 From: andy at reportlab.com (Andy Robinson) Date: Thu, 13 Nov 2008 16:57:01 +0000 Subject: [reportlab-users] Visual Diff Tool In-Reply-To: <956003ae0811130843y3227db00i7f174c2b77663b7@mail.gmail.com> References: <491C30B9.70006@gmail.com> <956003ae0811130610i7f1c5bdbte1231075a902cb71@mail.gmail.com> <491C42B8.4050206@gmail.com> <956003ae0811130843y3227db00i7f174c2b77663b7@mail.gmail.com> Message-ID: <956003ae0811130857s9b737few1a95335a588f2246@mail.gmail.com> 2008/11/13 Andy Robinson : > I need to check out ImageMagick and see how well it supports PDFs with > embedded form objects, asian fonts, different font models and so on. It seems to work great on several of our test files but will not handle the output of, for example, tests/test_multibyte_jpn.py / .pdf. I now recall this is why we went with Xpdf; Ghostscript and Quartz used to be bad at Asian text (although it's probably fixed now and as people move over to TrueType it will be less of an issue) I'm still impressed by its 'normal' output though - certainly good enough for diffing, and I could imagine writing tests which use this to assert that certain parts of the page end up coloured. Best of all the binaries are available on all platforms. Thanks for the tip! - Andy From robin at reportlab.com Thu Nov 13 12:01:51 2008 From: robin at reportlab.com (Robin Becker) Date: Thu, 13 Nov 2008 17:01:51 +0000 Subject: [reportlab-users] Visual Diff Tool In-Reply-To: <491C30B9.70006@gmail.com> References: <491C30B9.70006@gmail.com> Message-ID: <491C5D7F.1040702@chamonix.reportlab.co.uk> Dirk Holtwick wrote: > Hi, > > while working on xhtml2pdf I have the > general problem that writing test cases is quite difficult. The normal > way is to create some test PDF and then have a look at them if they are > looking fine. But that is a source of human errors. Therefore I am > looking for a automatic solution. > > My idea is to automatically do a visual compare of a reference PDF that > was already rendered fine once and the recent PDF. Technically I am > found out that it would work fine if I use ImageMagic to first create > images from PDF and if they differ I can show them in TortoiseIDiff. > > I started writing such a visual diff tool, but maybe there already > exists something similar and I can use this instead of wasting my time > on writing the reinvention of the wheel ;) > > So my question: has anyone seen a tool like this around? If so, please > let me know where to find it. Otherwise I would write the visual diff > tool and maybe Reportlab also likes to use visual test cases for their > toolkit? > ...... We have been using ghostscript in one of our server based tools. I tried the pdftoppm route, but couldn't get a working version from source on freebsd. Ghostscript works pretty well, we use commands like gs -q -dSAFER -dNOPAUSE -dBATCH \ -sOutputFile=rl_hello-page%04d.jpg \ -sDEVICE=jpeg -r144x144 -f rl_hello.pdf -- Robin Becker From dirk.holtwick at gmail.com Thu Nov 13 12:34:39 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Thu, 13 Nov 2008 18:34:39 +0100 Subject: [reportlab-users] Visual Diff Tool In-Reply-To: <956003ae0811130857s9b737few1a95335a588f2246@mail.gmail.com> References: <491C30B9.70006@gmail.com> <956003ae0811130610i7f1c5bdbte1231075a902cb71@mail.gmail.com> <491C42B8.4050206@gmail.com> <956003ae0811130843y3227db00i7f174c2b77663b7@mail.gmail.com> <956003ae0811130857s9b737few1a95335a588f2246@mail.gmail.com> Message-ID: <491C652F.60902@gmail.com> Andy Robinson schrieb: > Thanks for the tip! You are welcome. I implemented a dirty first version of the visual differ that seems to work on my Windows machine. If you like to have a look it's here: http://code.google.com/p/xhtml2pdf/source/browse/branches/3.0/tests/test_samples.py Dirk From gherman at darwin.in-berlin.de Fri Nov 14 04:16:38 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 14 Nov 2008 10:16:38 +0100 Subject: [reportlab-users] Tracker In-Reply-To: <956003ae0810141622j12c8af74n86c2b2c4b6b38ea0@mail.gmail.com> References: <956003ae0810141622j12c8af74n86c2b2c4b6b38ea0@mail.gmail.com> Message-ID: <0556A503-B113-4417-A9B6-C45E0422C9D8@darwin.in-berlin.de> Andy Robinson: > There is a basic public tracker up now: > > https://admin.reportlab.com/mantis/project/core/tracker/ > > For now it's just a brief list of known issues. (It's part of a > bigger > 2-year-old app which we need to upgrade to Django 1.0+ before we > can hack on it easily...). > > If anyone has reported issues or sent patches we've missed, please > repost them and we'll ensure they are logged and dealt with. I cannot see the two buglets I reported on this list on october 26 and 30. Shall I repost them? Also, it would be tremendeously useful to be able to sort the bug tracking page above by date. Regards, Dinu From andy at reportlab.com Fri Nov 14 05:10:50 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 14 Nov 2008 10:10:50 +0000 Subject: [reportlab-users] Tracker In-Reply-To: <0556A503-B113-4417-A9B6-C45E0422C9D8@darwin.in-berlin.de> References: <956003ae0810141622j12c8af74n86c2b2c4b6b38ea0@mail.gmail.com> <0556A503-B113-4417-A9B6-C45E0422C9D8@darwin.in-berlin.de> Message-ID: <956003ae0811140210y4790bd4fu31bb2e7a829e610c@mail.gmail.com> 2008/11/14 Dinu Gherman : > I cannot see the two buglets I reported on this list on > october 26 and 30. Shall I repost them? > Aha, I wasn't around then. I will berate our support-person-on-duty and ensure they are aware open source bugs should be at least logged ;-) - Andy From ralsina at netmanagers.com.ar Fri Nov 14 08:18:37 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Fri, 14 Nov 2008 11:18:37 -0200 Subject: [reportlab-users] Doubts about split() Message-ID: <200811141118.43700.ralsina@netmanagers.com.ar> I am not sure I understand split() for platypus flowables. The docs say if a flowable can split: Clever flowables should split themselves and return a list of flowables. It is up to the client code to ensure that repeated attempts to split are avoided. This is because split can return [self] right? So I must check if the flowable has already been "splitted" and in that case what should I return? If the space is sufficient the split method should return [self]. Otherwise the flowable should rearrange itself and return a list [f0,...] of flowables which will be considered in order. Suppose I have a box B containing paragraphs P1 P2 P3. The suppose P1 would fit in the available space. I should return [Box(P1),Box(P2,P3)] , right? Sorry about the pseudo code, I mean two boxes, one containing P1, the other P2 and P3 ;-) What should I return when there is no way to fit anything in the available space and everything should be moved to the next page? -- ("\''/").__..-''"`-. . 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 Nov 14 08:23:59 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Fri, 14 Nov 2008 14:23:59 +0100 Subject: [reportlab-users] Leading in Paragraph Message-ID: <491D7BEF.9060302@gmail.com> Hi, I try to optimize the paragraph stuff for my needs and one issue is the handling of leading. If I understand right Reportlab in Paragraph draws a line and then starts the next line with a regular distance of "leading". In HTML documents this seems to be handle a little bit different for paragraphs with paddings or borders. There a line is rendered like: Draw text on (Y-Position + Leading / 2). This is nice because in a bordered paragraph the distances from top and bottom are equal. My question. Is there a way in Paragraph to get the same results? Dirk From andy at reportlab.com Fri Nov 14 08:33:28 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 14 Nov 2008 13:33:28 +0000 Subject: [reportlab-users] Doubts about split() In-Reply-To: <200811141118.43700.ralsina@netmanagers.com.ar> References: <200811141118.43700.ralsina@netmanagers.com.ar> Message-ID: <956003ae0811140533r1e79d367p6aea27508986eabf@mail.gmail.com> 2008/11/14 Roberto Alsina : > I am not sure I understand split() for platypus flowables. > > I should return [Box(P1),Box(P2,P3)] , right? That should work. I don't think we ever tried a list of more than 2 items; it probably also works if you just return this, as I would hope anything not fitting is added to the list for the next page. [Box(P1), Box(P1), Box(P1)] > What should I return when there is no way to fit anything in the available > space and everything should be moved to the next page? Return []. This is the default implementation for a Flowable anyway. I just slightly expanded the docstring in Flowable.split to mention this. - Andy From gherman at darwin.in-berlin.de Fri Nov 14 08:38:13 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 14 Nov 2008 14:38:13 +0100 Subject: [reportlab-users] Doubts about split() In-Reply-To: <200811141118.43700.ralsina@netmanagers.com.ar> References: <200811141118.43700.ralsina@netmanagers.com.ar> Message-ID: <8FA0C229-9F7E-4323-A566-6168FD4BB42C@darwin.in-berlin.de> Roberto Alsina: > I am not sure I understand split() for platypus flowables. Welcome to the club! ;-) > The docs say if a flowable can split: [...] The docs are not very helpful with this topic and I've had a hard time myself splitting flowables on my head! I suggest you look into my alterparagraphs code which might solve some questions: http://pypi.python.org/pypi/alterparagraphs Regards, Dinu From jonas at reportlab.com Fri Nov 14 10:20:02 2008 From: jonas at reportlab.com (jonas wustrack) Date: Fri, 14 Nov 2008 15:20:02 +0000 Subject: [reportlab-users] Tracker In-Reply-To: <0556A503-B113-4417-A9B6-C45E0422C9D8@darwin.in-berlin.de> References: <956003ae0810141622j12c8af74n86c2b2c4b6b38ea0@mail.gmail.com> <0556A503-B113-4417-A9B6-C45E0422C9D8@darwin.in-berlin.de> Message-ID: On Fri, Nov 14, 2008 at 9:16 AM, Dinu Gherman wrote: > Andy Robinson: > >> There is a basic public tracker up now: >> >> https://admin.reportlab.com/mantis/project/core/tracker/ >> >> For now it's just a brief list of known issues. (It's part of a bigger >> 2-year-old app which we need to upgrade to Django 1.0+ before we >> can hack on it easily...). >> >> If anyone has reported issues or sent patches we've missed, please >> repost them and we'll ensure they are logged and dealt with. > > I cannot see the two buglets I reported on this list on > october 26 and 30. Shall I repost them? > > Also, it would be tremendeously useful to be able to sort > the bug tracking page above by date. You can, now ;-) Regards, -- Jonas From webinconcept at gmail.com Fri Nov 14 11:09:38 2008 From: webinconcept at gmail.com (Webin Concept) Date: Fri, 14 Nov 2008 17:09:38 +0100 Subject: [reportlab-users] which version of adobe acrobat reader (minimal requirements) Message-ID: <9b4634000811140809o6ab74923vf1457b8de272c4ea@mail.gmail.com> Can you tell me wich version of Acrobat reader is required to read the pdf output of reportlab? I'm asking for the *minimum* requirements here: 5? 6? Kind regards, J -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Fri Nov 14 12:01:39 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 14 Nov 2008 17:01:39 +0000 Subject: [reportlab-users] which version of adobe acrobat reader (minimal requirements) In-Reply-To: <9b4634000811140809o6ab74923vf1457b8de272c4ea@mail.gmail.com> References: <9b4634000811140809o6ab74923vf1457b8de272c4ea@mail.gmail.com> Message-ID: <956003ae0811140901y59774a63la0a1ed7381102045@mail.gmail.com> 2008/11/14 Webin Concept : > Can you tell me wich version of Acrobat reader is required to read the > pdf output of reportlab? > > I'm asking for the *minimum* requirements here: 5? 6? 4.0 should be safe. With 3.0 there were some occasional problems which we decided not to bother to support. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From mlacunza at gmail.com Fri Nov 14 12:24:10 2008 From: mlacunza at gmail.com (Mario Lacunza) Date: Fri, 14 Nov 2008 12:24:10 -0500 Subject: [reportlab-users] Visual Designer Message-ID: <771741b20811140924r4e50172cy2101f5d59a1c6231@mail.gmail.com> Hello, There are plans to create a Visual Report Designer for Reportlab? Something like Crystal Report or other similar tool? Thanks! -- Saludos / Best regards Mario Lacunza Software Architect - Webmaster Email: mlacunza [AT] gmail [DOT] com http://www.lacunza.info Lima - Peru -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Fri Nov 14 12:28:19 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 14 Nov 2008 17:28:19 +0000 Subject: [reportlab-users] Visual Designer In-Reply-To: <771741b20811140924r4e50172cy2101f5d59a1c6231@mail.gmail.com> References: <771741b20811140924r4e50172cy2101f5d59a1c6231@mail.gmail.com> Message-ID: <956003ae0811140928i46b2233cma11ae606f45798c6@mail.gmail.com> 2008/11/14 Mario Lacunza : > Hello, > > There are plans to create a Visual Report Designer for Reportlab? Something > like Crystal Report or other similar tool? > No, sorry (at least not within ReportLab the company). Building such a tool well would probably take years of effort. We do have a few ideas to save people some time in coding, but I'll keep quiet on them for now as we have lots of more short term issues to fix first... Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From mlacunza at gmail.com Fri Nov 14 12:42:25 2008 From: mlacunza at gmail.com (Mario Lacunza) Date: Fri, 14 Nov 2008 12:42:25 -0500 Subject: [reportlab-users] Visual Designer In-Reply-To: <956003ae0811140928i46b2233cma11ae606f45798c6@mail.gmail.com> References: <771741b20811140924r4e50172cy2101f5d59a1c6231@mail.gmail.com> <956003ae0811140928i46b2233cma11ae606f45798c6@mail.gmail.com> Message-ID: <771741b20811140942k6252ad5flf13b3b86cc0071d6@mail.gmail.com> 2008/11/14 Andy Robinson > 2008/11/14 Mario Lacunza : > > Hello, > > > > There are plans to create a Visual Report Designer for Reportlab? > Something > > like Crystal Report or other similar tool? > > > > No, sorry (at least not within ReportLab the company). Building such a > tool > well would probably take years of effort. > > We do have a few ideas to save people some time in coding, but > I'll keep quiet on them for now as we have lots of more short term > issues to fix first... > > Yes, I understand... but maybe an Opensource separate project? I think: others programmers need a graphic tool for design reports like me, if anyboby in this list have interest in this idea please contact me to create it with GPL, I think could be a great contribution. -- Saludos / Best regards Mario Lacunza Software Architect - Webmaster Email: mlacunza [AT] gmail [DOT] com http://www.lacunza.info Lima - Peru -------------- next part -------------- An HTML attachment was scrubbed... URL: From webinconcept at gmail.com Fri Nov 14 13:27:34 2008 From: webinconcept at gmail.com (Webin Concept) Date: Fri, 14 Nov 2008 19:27:34 +0100 Subject: [reportlab-users] which version of adobe acrobat reader (minimal requirements) In-Reply-To: <956003ae0811140901y59774a63la0a1ed7381102045@mail.gmail.com> References: <9b4634000811140809o6ab74923vf1457b8de272c4ea@mail.gmail.com> <956003ae0811140901y59774a63la0a1ed7381102045@mail.gmail.com> Message-ID: <9b4634000811141027p9e758e3q3532113e1c38b7bf@mail.gmail.com> Thank you Andy! On Fri, Nov 14, 2008 at 6:01 PM, Andy Robinson wrote: > 2008/11/14 Webin Concept : > > Can you tell me wich version of Acrobat reader is required to read the > > pdf output of reportlab? > > > > I'm asking for the *minimum* requirements here: 5? 6? > > 4.0 should be safe. With 3.0 there were some occasional > problems which we decided not to bother to support. > > > Best Regards, > > -- > Andy Robinson > CEO/Chief Architect > ReportLab Europe Ltd. > Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK > Tel +44-20-8545-1570 > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gherman at darwin.in-berlin.de Mon Nov 17 08:35:42 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 17 Nov 2008 14:35:42 +0100 Subject: [reportlab-users] PDF test pages for printers? Message-ID: <1D630AF4-8B0C-41C5-9048-C447473CCB39@darwin.in-berlin.de> Hi, I wonder if anybody here has created sample PDF pages to be tested with different printers before deciding which one to buy? Since all printers have different demo pages, it is hard to compare them. Features to be tested might include line den- sity, grey levels, color, resolution, non-printable margins, etc. I found this, but it lacks "printing on the edge": http://cream.sourceforge.net/ColorCard.pdf Well, maybe someone wants to test his ReportLab knowledge to create something like this or better for the community? Just an idea... Regards, Dinu ..................................................................... Heute Utopist werden: http://www.utopia.de - Deutschlands gr??te On- line-Community f?r strategischen Konsum und nachhaltigen Lebensstil. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alet at librelogiciel.com Mon Nov 17 08:41:59 2008 From: alet at librelogiciel.com (alet at librelogiciel.com) Date: Mon, 17 Nov 2008 14:41:59 +0100 Subject: [reportlab-users] PDF test pages for printers? In-Reply-To: <1D630AF4-8B0C-41C5-9048-C447473CCB39@darwin.in-berlin.de> References: <1D630AF4-8B0C-41C5-9048-C447473CCB39@darwin.in-berlin.de> Message-ID: <20081117134159.GD27934@vazy.pykota.com> On Mon, Nov 17, 2008 at 02:35:42PM +0100, Dinu Gherman wrote: > > I wonder if anybody here has created sample PDF pages to be > tested with different printers before deciding which one to > buy? > > Since all printers have different demo pages, it is hard to > compare them. Features to be tested might include line den- > sity, grey levels, color, resolution, non-printable margins, > etc. I found this, but it lacks "printing on the edge": > > http://cream.sourceforge.net/ColorCard.pdf > > Well, maybe someone wants to test his ReportLab knowledge > to create something like this or better for the community? > Just an idea... I've created a generator for the attached PDF file, which I use not to test printers but to test my pkpgcounter software. Maybe this can help or serve as a basis for more complex test documents. The source is available at : http://trac.pykota.com/browser/pkpgcounter/trunk/tests/runcolors.py (or http://svn.pykota.com/pkpgcounter/trunk/tests/runcolors.py) hth Jerome Alet -------------- next part -------------- A non-text attachment was scrubbed... Name: colors.pdf Type: application/pdf Size: 9022 bytes Desc: not available Url : From timr at probo.com Mon Nov 17 14:01:28 2008 From: timr at probo.com (Tim Roberts) Date: Mon, 17 Nov 2008 11:01:28 -0800 Subject: [reportlab-users] PDF test pages for printers? In-Reply-To: <1D630AF4-8B0C-41C5-9048-C447473CCB39@darwin.in-berlin.de> References: <1D630AF4-8B0C-41C5-9048-C447473CCB39@darwin.in-berlin.de> Message-ID: <4921BF88.2030301@probo.com> Dinu Gherman wrote: > Hi, > > I wonder if anybody here has created sample PDF pages to be > tested with different printers before deciding which one to > buy? > > Since all printers have different demo pages, it is hard to > compare them. Features to be tested might include line den- > sity, grey levels, color, resolution, non-printable margins, > etc. I found this, but it lacks "printing on the edge": Full bleed printing is rather rare in laser printers. If that's a requirement for you, then it probably narrows the field down more than any of these other criteria. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From tante at the-gay-bar.com Mon Nov 17 15:39:52 2008 From: tante at the-gay-bar.com (=?ISO-8859-1?Q?J=FCrgen?= Geuter) Date: Mon, 17 Nov 2008 21:39:52 +0100 Subject: [reportlab-users] Size of Barcodes in Reportlab Message-ID: <1226954392.7672.16.camel@localhost> Hello. I am trying to generate barcodes with reportlab and it works quite well: ---- example code ----- from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import A4,landscape from reportlab.graphics.barcode import code39 from reportlab.lib.units import mm c = canvas.Canvas("/tmp/barcode.pdf", pagesize=landscape(A4)) barcode = code39.Extended39("123456") barcode.drawOn(c,100*mm,100*mm) c.showpage() c.save() --------------------------- This draws a correct barcode to the position I wanted it printed, but it's too small. The barcode's size is not influenced by the font or the current line width, I tried setting the "height" and "width" attributes of my barcode before calling "drawOn". Nothing would change the barcode's size. I just need it bigger so our scanners can properly read it (there is some dirt involved sometimes and the scanners are not always perfect so in this case, size _does_matter :) Thanks in Advance J?rgen Geuter -- ICQ #81510866 - http://the-gay-bar.com - jabber tante at jabber.org Occam's Razor: -"Entia non sunt multiplicanda praeter necessitatem."- -------------- 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 timr at probo.com Mon Nov 17 16:10:53 2008 From: timr at probo.com (Tim Roberts) Date: Mon, 17 Nov 2008 13:10:53 -0800 Subject: [reportlab-users] Size of Barcodes in Reportlab In-Reply-To: <1226954392.7672.16.camel@localhost> References: <1226954392.7672.16.camel@localhost> Message-ID: <4921DDDD.4080304@probo.com> J?rgen Geuter wrote: > Hello. > > I am trying to generate barcodes with reportlab and it works quite well: > ---- example code ----- > from reportlab.pdfgen import canvas > from reportlab.lib.pagesizes import A4,landscape > from reportlab.graphics.barcode import code39 > from reportlab.lib.units import mm > > c = canvas.Canvas("/tmp/barcode.pdf", pagesize=landscape(A4)) > barcode = code39.Extended39("123456") > barcode.drawOn(c,100*mm,100*mm) > > c.showpage() > c.save() > --------------------------- > > This draws a correct barcode to the position I wanted it printed, but > it's too small. The barcode's size is not influenced by the font or the > current line width, I tried setting the "height" and "width" attributes > of my barcode before calling "drawOn". Nothing would change the > barcode's size Use the source, Luke. ;) The Extended39 constructor accepts a "barWidth" parameter that specifies the base width of the smallest element. It defaults to .0075 inch. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From haraldarminmassa at gmail.com Tue Nov 18 09:40:39 2008 From: haraldarminmassa at gmail.com (Harald Armin Massa) Date: Tue, 18 Nov 2008 15:40:39 +0100 Subject: [reportlab-users] Wordaxe 0.3.0, ReportLab 2.2, MultiBuild and splitting error Message-ID: <7be3f35d0811180640h71517e8dq48403e112296ccbb@mail.gmail.com> Hello, on updating some projekt to RL 2.2; and wordaxe 0.3.0, I ran into some obscure wrapping / splitting bug. As it turned out: the SplitRoutine within NewParagraph get's problems when doc.multibuild is used. I tracked it down to: if not hasattr(self, "_lines"): # This can only happen when split has been called # without a previous wrap for this Paragraph. # From looking at doctemplate.py and frames.py, # I assume this is only the case if the free space # in the frame is not even enough for getSpaceBefore. # Thus we can safely return [] #~ print "split without previous wrap" return [] NewParagraph of Wordaxe relying on self._lines NOT being present when there was no "wrap" in the actual build pass, to return "I cannot split" BUT... in a multibuild, in the second build pass that self._lines is present from the first build pass ... , and _unused is an empty list (as some wraps from the build pass before have used up everything) So MY fix was in doctemplate multibuild: #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 if hasattr(elem, '_lines'): del elem._lines to extend the "cleanup" part to also delete the _lines attribute of a NewParagraph; together with the _postponed attribut. So everything works fine ... but I am not sure if this is really the best approach, and the NewParagraph split/wrap is quite to challenging to really be sure. That's why I am posting this fix for others to enjoy and for more enlightened ones to check:) Harald -- GHUM Harald Massa persuadere et programmare Harald Armin Massa Spielberger Stra?e 49 70435 Stuttgart 0173/9409607 no fx, no carrier pigeon - EuroPython 2009 will take place in Birmingham - Stay tuned! From robin at reportlab.com Tue Nov 18 10:01:45 2008 From: robin at reportlab.com (Robin Becker) Date: Tue, 18 Nov 2008 15:01:45 +0000 Subject: [reportlab-users] Wordaxe 0.3.0, ReportLab 2.2, MultiBuild and splitting error In-Reply-To: <7be3f35d0811180640h71517e8dq48403e112296ccbb@mail.gmail.com> References: <7be3f35d0811180640h71517e8dq48403e112296ccbb@mail.gmail.com> Message-ID: <4922D8D9.9000000@chamonix.reportlab.co.uk> Harald Armin Massa wrote: > Hello, ........ some > wraps from the build pass before have used up everything) > > So MY fix was in doctemplate multibuild: > > #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 > if hasattr(elem, '_lines'): > del elem._lines > > to extend the "cleanup" part to also delete the _lines attribute of a > NewParagraph; together with the _postponed attribut. > > So everything works fine ... but I am not sure if this is really the > best approach, and the NewParagraph split/wrap is quite to challenging > to really be sure. > > That's why I am posting this fix for others to enjoy and for more > enlightened ones to check:) > > Harald > great, we have a sort of combined approach now in the trunk with something called doc._multiBuildEdits which appends to a list of things that need to be cleaned up. Currently that's keepWithNext stuff and _postponed. That mechanism requires us to store (operation, object, attributename) tuples at the point where we know the edit is required to be unwound. This just avoids having to iterate through the whole story to clean stuff up; the clean up code looks like #work through any edits while mbe: e = mbe.pop(0) e[0](*e[1:]) It's not clear whether this approach will work for your _lines attribute. In trunk code at least it's possible for a flowable to get access to the document context during some phases (using self.doctemplateAttr). If this works you could do something like mbe=self._doctemplateAttr('_multiBuildEdits') mbe((self,delattr,'_lines')) where self._lines is created. -- Robin Becker From H.vonBargen at t-p.com Tue Nov 18 12:39:09 2008 From: H.vonBargen at t-p.com (Henning von Bargen) Date: Tue, 18 Nov 2008 18:39:09 +0100 Subject: [reportlab-users] Wordaxe 0.3.0, ReportLab 2.2, MultiBuild and splitting error In-Reply-To: Message-ID: <77A9E75DA75C564D82BDC4B18A7D8525305666@ROHRPOSTIX.tup.ads> Thanks for your bug report, Harald. I added it as item 2310279 to the wordaxe bug tracker at http://sourceforge.net/tracker2/?func=detail&aid=2310279&group_id=105867&atid=642478 Can you perhaps create a simple test case? Henning > From: "Harald Armin Massa" > Subject: Wordaxe 0.3.0, ReportLab 2.2,MultiBuild and splitting error > > Hello, > > on updating some projekt to RL 2.2; and wordaxe 0.3.0, I ran into some > obscure wrapping / splitting bug. > > As it turned out: > > the SplitRoutine within NewParagraph get's problems when > doc.multibuild is used. > > I tracked it down to: > > if not hasattr(self, "_lines"): > # This can only happen when split has been called > # without a previous wrap for this Paragraph. > # From looking at doctemplate.py and frames.py, > # I assume this is only the case if the free space > # in the frame is not even enough for getSpaceBefore. > # Thus we can safely return [] > #~ print "split without previous wrap" > return [] > > NewParagraph of Wordaxe relying on self._lines NOT being present when > there was no "wrap" in the actual build pass, to return "I cannot > split" > > BUT... > > in a multibuild, in the second build pass that self._lines is present > from the first build pass ... , and _unused is an empty list (as some > wraps from the build pass before have used up everything) > > So MY fix was in doctemplate multibuild: > > #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 > if hasattr(elem, '_lines'): > del elem._lines > > to extend the "cleanup" part to also delete the _lines attribute of a > NewParagraph; together with the _postponed attribut. > > So everything works fine ... but I am not sure if this is really the > best approach, and the NewParagraph split/wrap is quite to challenging > to really be sure. > > That's why I am posting this fix for others to enjoy and for more > enlightened ones to check:) > > Harald From matt at tplus1.com Tue Nov 18 16:27:19 2008 From: matt at tplus1.com (Matthew Wilson) Date: Tue, 18 Nov 2008 16:27:19 -0500 Subject: [reportlab-users] Can anyone share some code to draw employee schedules? Message-ID: I want to print a grid where the rows are employees and the columns are dates. In each cell, I'll leave it blank or draw a big X that means this particular employee works on this date. This is such a vanilla report that I thought I'd check if anyone already has something like this that they can share with me. More generally, is there any kind of script repository for reportlab where I can see how people did what they did? Matt -- Matthew Wilson matt at tplus1.com http://tplus1.com From gherman at darwin.in-berlin.de Wed Nov 19 05:50:48 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Wed, 19 Nov 2008 11:50:48 +0100 Subject: [reportlab-users] Future of py2pdf Message-ID: <3A314D7C-5CBD-4606-94C6-5308CACF7F28@darwin.in-berlin.de> Hi, I've just looked again at a tool named py2pdf, that I wrote and that was included in the ReportLab distribution in 2001 I think (with reportlab 0.92 or so!). AFAIK, the Python Wing IDE used this module and maybe still does. Apart from being pretty old code (that still seems to work, though, and for which I got maybe two little buglets repor- ted in all these years) I wonder if I should put it again on my list of things to refurbish. Ideally, I'd like to distribute it as a self contained package, which should demand less repackaging and reportlab knowledge from users to get it running right off the shelf. I understand that I can have access to the RL SVN repository to work on it, but I wonder if that would change the instal- lation issues? Ideally, py2pdf would only need the right entries in the setup.py script of the RL distro, but the RL release cycle is counterproductive for a quick propagation of updates. So I think I will demand from ReportLab to remove py2pdf from its distribution starting with the next release, and distribute it myself as a seperate package, including as one of these insanely ubiquitous "eggs". Therefore, I'd like to know if anybody here would suffer from such a plan? If this would be the case for you, please let me know. Regards, Dinu ...................................................................... Heute Utopist werden: http://www.utopia.de - Deutschlands gr??te On- line-Community f?r strategischen Konsum und nachhaltigen Lebensstil. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at reportlab.com Wed Nov 19 06:37:53 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 19 Nov 2008 11:37:53 +0000 Subject: [reportlab-users] Future of py2pdf In-Reply-To: <3A314D7C-5CBD-4606-94C6-5308CACF7F28@darwin.in-berlin.de> References: <3A314D7C-5CBD-4606-94C6-5308CACF7F28@darwin.in-berlin.de> Message-ID: <956003ae0811190337h4c01cf1cn87f0cef70610fb12@mail.gmail.com> 2008/11/19 Dinu Gherman : > I understand that I can have access to the RL SVN repository > to work on it, but I wonder if that would change the instal- > lation issues? Ideally, py2pdf would only need the right > entries in the setup.py script of the RL distro, but the RL > release cycle is counterproductive for a quick propagation > of updates. We should stop referring to it as a cycle ;-) Think of it as an unexpected 'event', like a white Christmas or sunny August day (for a Brit). Take this with a pinch of salt, but our next target for a release is December. Project work is getting quieter and we have a commercial need to get a better-packaged release out with updated docs, which will require an open source release too. > So I think I will demand from ReportLab to remove py2pdf > from its distribution starting with the next release, and > distribute it myself as a seperate package, including as > one of these insanely ubiquitous "eggs". It's your call. Just let us know. We'll be setting up a page of links to related packages in December anyway. It would be good to decide for sure this month, though. > Therefore, I'd like to know if anybody here would suffer > from such a plan? If this would be the case for you, please > let me know. -- Andy From haraldarminmassa at gmail.com Wed Nov 19 06:42:35 2008 From: haraldarminmassa at gmail.com (Harald Armin Massa) Date: Wed, 19 Nov 2008 12:42:35 +0100 Subject: [reportlab-users] Future of py2pdf In-Reply-To: <3A314D7C-5CBD-4606-94C6-5308CACF7F28@darwin.in-berlin.de> References: <3A314D7C-5CBD-4606-94C6-5308CACF7F28@darwin.in-berlin.de> Message-ID: <7be3f35d0811190342w10d31e41w3ac2de19d5102a4@mail.gmail.com> Dinu, > So I think I will demand from ReportLab to remove py2pdf > from its distribution starting with the next release, and > distribute it myself as a seperate package, including as > one of these insanely ubiquitous "eggs". as the integrated version "works", my recommendation is to leave it where it is, just to update it with some DOC-String like "this may be not the hottest and greatest version of py2pdf; if you need something fresher, please go to " That would be a free marketing for the module, it's better to have a not so active one than none, and it frees the cycles. Harald -- GHUM Harald Massa persuadere et programmare Harald Armin Massa Spielberger Stra?e 49 70435 Stuttgart 0173/9409607 no fx, no carrier pigeon - EuroPython 2009 will take place in Birmingham - Stay tuned! From andy at reportlab.com Wed Nov 19 06:53:06 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 19 Nov 2008 11:53:06 +0000 Subject: [reportlab-users] Future of py2pdf In-Reply-To: <7be3f35d0811190342w10d31e41w3ac2de19d5102a4@mail.gmail.com> References: <3A314D7C-5CBD-4606-94C6-5308CACF7F28@darwin.in-berlin.de> <7be3f35d0811190342w10d31e41w3ac2de19d5102a4@mail.gmail.com> Message-ID: <956003ae0811190353t309624fatcba628492907be7c@mail.gmail.com> 2008/11/19 Harald Armin Massa : > Dinu, > >> So I think I will demand from ReportLab to remove py2pdf >> from its distribution starting with the next release, and >> distribute it myself as a seperate package, including as >> one of these insanely ubiquitous "eggs". > > as the integrated version "works", my recommendation is to leave it > where it is, just to update it with some DOC-String like > > "this may be not the hottest and greatest version of py2pdf; if you > need something fresher, please go to " I would prefer that we either (a) got rid of the demos directory altogether, or (b) ensured things in it help to form relevant, properly commented teaching examples (e.g. the long-awaited "long document with a table of contents" or "print labels") and are maintained. It's a real problem getting even the 80% of ReportLab staff familiar with our framework up to speed, let alone people outside. Removing things which we don't really need is probably a good step. IMHO a clear link from a reportlab.org page listing related packages will market the package better than being in a 'demos' directory which will probably get excluded by some of the packaging mechanisms anyway. We will be rearranging the open source part of the site in December and are happy to promote anyone's work there. - Andy From gabor at nekomancer.net Wed Nov 19 08:31:58 2008 From: gabor at nekomancer.net (=?ISO-8859-1?Q?G=E1bor_Farkas?=) Date: Wed, 19 Nov 2008 14:31:58 +0100 Subject: [reportlab-users] cjk-word-wrapping and xml-character-entities Message-ID: <2c173a350811190531v32f71fu90243b75e1b3b464@mail.gmail.com> hi, the following script fails: """ from reportlab.platypus import SimpleDocTemplate, Paragraph from reportlab.lib.styles import ParagraphStyle doc = SimpleDocTemplate("test.pdf") p = Paragraph(u'aaaa',ParagraphStyle('s',wordWrap='CJK')) story = [p] doc.build(story) """ please note, that "a" is simply "a", so the text in the paragraph is simply "aaaa". the problem is a combination of 2 issues: 1. the CJK algorithm only handles paragraps with 1 ParaFrags 2. the ParaParser, when parses the text, creates 2 frags because of the char-entity is there any way to work around this problem? of course, my real problem is with chinese text. chinese text with "&" in it, to be precise. this problem makes it impossible for me to have that text word-wrapped correctly. or, maybe, is there a way to represent "&" in a paragraph in a different way? in one that does not cause the ParaParser to create new ParaFrags? thanks, gabor From andy at reportlab.com Wed Nov 19 08:58:43 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 19 Nov 2008 13:58:43 +0000 Subject: [reportlab-users] cjk-word-wrapping and xml-character-entities In-Reply-To: <2c173a350811190531v32f71fu90243b75e1b3b464@mail.gmail.com> References: <2c173a350811190531v32f71fu90243b75e1b3b464@mail.gmail.com> Message-ID: <956003ae0811190558m9667e3esb1c24421d0d81f4d@mail.gmail.com> 2008/11/19 G?bor Farkas : > 1. the CJK algorithm only handles paragraps with 1 ParaFrags > 2. the ParaParser, when parses the text, creates 2 frags because of > the char-entity Thanks for such an easy-to-reproduce example! We fixed this several months ago - I believe before the last release 2.2. Your script runs fine for me against SVN trunk. What version are you using? Best Regards, Andy Robinson From matt at tplus1.com Wed Nov 19 11:36:09 2008 From: matt at tplus1.com (Matthew Wilson) Date: Wed, 19 Nov 2008 11:36:09 -0500 Subject: [reportlab-users] How do I left-align my table? Message-ID: I have a small table and it is displayed in the center of the page. How can I have it line up on the left margin like my paragraphs? I understand how to mess with stuff inside the various table cells. I don't care about that. Instead, I want to push the whole table box to the left. Here's the code I'm using: def tfun(title, dt, data): t = Table(data) t.setStyle(TableStyle([ ('GRID', (0, 0), (-1, -1), 0.5, colors.grey), ('BOX', (0, 0), (-1, -1), 2, colors.black), ])) styles = getSampleStyleSheet() def go(): doc = SimpleDocTemplate("foodservice.pdf") style = styles["Normal"] Story = [] Story.append(Paragraph(title, styles['Heading1'])) Story.append(Paragraph(dt.strftime('%A, %B %d, %Y'), styles['Heading2'])) # This draws the table on to the page. Story.append(t) # This renders the doc. doc.build(Story) go() if __name__ == '__main__': employees = ('Matt Wilson', 'Matt Wilson', 'Matt Wilson') data = [(emp, '6:00 AM') for emp in employees] tfun('Food Service Schedule', datetime.now().date(), data) -- Matthew Wilson matt at tplus1.com http://tplus1.com From paul.barrass at safeonlinebilling.com Wed Nov 19 11:44:09 2008 From: paul.barrass at safeonlinebilling.com (Paul Barrass) Date: Wed, 19 Nov 2008 16:44:09 +0000 Subject: [reportlab-users] How do I left-align my table? In-Reply-To: References: Message-ID: <49244259.5050807@safeonlinebilling.com> Matthew Wilson wrote: > I have a small table and it is displayed in the center of the page. > > Here's the code I'm using: > > def tfun(title, dt, data): > > t = Table(data) > > > t.hAlign='LEFT' is what you want. Paul Barrass. From matt at tplus1.com Wed Nov 19 11:48:29 2008 From: matt at tplus1.com (Matthew Wilson) Date: Wed, 19 Nov 2008 11:48:29 -0500 Subject: [reportlab-users] How do I left-align my table? In-Reply-To: <49244259.5050807@safeonlinebilling.com> References: <49244259.5050807@safeonlinebilling.com> Message-ID: Thanks Paul! That was exactly right. On Wed, Nov 19, 2008 at 11:44 AM, Paul Barrass wrote: > Matthew Wilson wrote: >> >> I have a small table and it is displayed in the center of the page. >> >> Here's the code I'm using: >> >> def tfun(title, dt, data): >> >> t = Table(data) >> >> >> > > t.hAlign='LEFT' is what you want. > > Paul Barrass. > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > -- Matthew Wilson matt at tplus1.com http://tplus1.com From Samuele.Kaplun at cern.ch Wed Nov 19 12:29:10 2008 From: Samuele.Kaplun at cern.ch (Samuele Kaplun) Date: Wed, 19 Nov 2008 18:29:10 +0100 Subject: [reportlab-users] pyRXP sources Message-ID: <200811191829.10494.Samuele.Kaplun@cern.ch> Dear ReportLab team, I'm interested in your pyRXP project but I wasn't able to retrieve it from your website. Around I found inconsistent release numbers (1.12, 1.09...) while on your website you refer to version 0.9. The svn tree seems to not contain it anymore. Is the project abandoned? Is there a way to retrieve the last valid version ever? Best regards, Samuele -- .O. ..O OOO From andy at reportlab.com Wed Nov 19 12:36:13 2008 From: andy at reportlab.com (Andy Robinson) Date: Wed, 19 Nov 2008 17:36:13 +0000 Subject: [reportlab-users] pyRXP sources In-Reply-To: <200811191829.10494.Samuele.Kaplun@cern.ch> References: <200811191829.10494.Samuele.Kaplun@cern.ch> Message-ID: <956003ae0811190936l35bb8f64tf5dead2166194cdc@mail.gmail.com> 2008/11/19 Samuele Kaplun : > Dear ReportLab team, > I'm interested in your pyRXP project but I wasn't able to retrieve it from > your website. Around I found inconsistent release numbers (1.12, 1.09...) > while on your website you refer to version 0.9. The svn tree seems to not > contain it anymore. > Is the project abandoned? Is there a way to retrieve the last valid version > ever? We use it daily in production in many applications, but we haven't updated its web page properly in recent months. It's mature with no changes in a long time, and definitely production quality. The latest code is at http://svn.reportlab.com/svn/public/pyRXP/trunk/ Best Regards -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From gabor at nekomancer.net Thu Nov 20 02:56:12 2008 From: gabor at nekomancer.net (=?ISO-8859-1?Q?G=E1bor_Farkas?=) Date: Thu, 20 Nov 2008 08:56:12 +0100 Subject: [reportlab-users] cjk-word-wrapping and xml-character-entities In-Reply-To: <956003ae0811190558m9667e3esb1c24421d0d81f4d@mail.gmail.com> References: <2c173a350811190531v32f71fu90243b75e1b3b464@mail.gmail.com> <956003ae0811190558m9667e3esb1c24421d0d81f4d@mail.gmail.com> Message-ID: <2c173a350811192356k5066c933y1f0950d1a5fd75ae@mail.gmail.com> On Wed, Nov 19, 2008 at 2:58 PM, Andy Robinson wrote: > 2008/11/19 G?bor Farkas : >> 1. the CJK algorithm only handles paragraps with 1 ParaFrags >> 2. the ParaParser, when parses the text, creates 2 frags because of >> the char-entity > > Thanks for such an easy-to-reproduce example! > > We fixed this several months ago - I believe before the last release 2.2. > Your script runs fine for me against SVN trunk. What version are you using? thanks..... yes, it works in 2.2 (i was using 2.1) gabor From stephane.travostino at gmail.com Thu Nov 20 09:29:43 2008 From: stephane.travostino at gmail.com (=?UTF-8?Q?St=C3=A9phane_Travostino?=) Date: Thu, 20 Nov 2008 15:29:43 +0100 Subject: [reportlab-users] Bug when drawing human readable barcodes Message-ID: Hello, I spotted a bug in the barcode addon, and specifically when trying to draw a human readable barcode. Consider this simple example: from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import A4 from reportlab.lib.units import mm from reportlab.graphics.barcode import code39 TEXT = "TEST01L4" c=canvas.Canvas("barcode.pdf",pagesize=A4) barcode=code39.Standard39(TEXT, barWidth=0.423*mm, barHeight=10*mm, ratio=2.75, humanReadable=True) barcode.drawOn(c,50*mm,50*mm) c.showPage() c.save() When run on Ubuntu (python-reportlab 2.1 from intrepid repos and 2.2 imported from debian sid), I get this backtrace: ... File "/usr/lib/python2.5/site-packages/reportlab/pdfbase/pdfmetrics.py", line 399, in _py_stringWidth if not isinstance(text,unicode): text = text.decode(encoding) AttributeError: 'float' object has no attribute 'decode' It seems that somewhere the "text" variable is substituted with a float value. Here is the patch for this issue (diffed from SVN https://svn.reportlab.com/svn/public/reportlab/trunk/src/reportlab/graphics/barcode/common.py ): $ diff -ruN common.py /usr/lib/python2.5/site-packages/reportlab/graphics/barcode/common.py --- common.py 2007-04-13 14:32:39.000000000 +0200 +++ /usr/lib/python2.5/site-packages/reportlab/graphics/barcode/common.py 2008-11-20 15:19:38.000000000 +0100 @@ -173,7 +173,7 @@ if anchor=='middle': func = 'drawCentredString' elif anchor=='end': func = 'drawRightString' else: func = 'drawString' - getattr(canv,func)(text,x,y) + getattr(canv,func)(x,y,text) canv.restoreState() class MultiWidthBarcode(Barcode): St?phane. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephane.travostino at gmail.com Thu Nov 20 09:59:02 2008 From: stephane.travostino at gmail.com (=?UTF-8?Q?St=C3=A9phane_Travostino?=) Date: Thu, 20 Nov 2008 15:59:02 +0100 Subject: [reportlab-users] Barcode checksum printed in human readable format Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, sorry for pasting the same example as in the previous mail. When a Code39 barcode is created with the humanReadable variable set, the text is printed including the checksum. The expected behaviour is to see the text without the checksum. from reportlab.pdfgen import canvas from reportlab.lib.pagesizes import A4 from reportlab.lib.units import mm from reportlab.graphics.barcode import code39 TEXT = "TEST01L4" c=canvas.Canvas("barcode.pdf",pagesize=A4) barcode=code39.Standard39(TEXT, barWidth=0.423*mm, barHeight=10*mm, ratio=2.75, humanReadable=True) barcode.drawOn(c,50*mm,50*mm) c.showPage() c.save() You'll see that the checksum is printed with the text. Here is the patch to solve this issue, diffed from SVN http://svn.reportlab.com/svn/public/reportlab/community/trunk/src/reportlab/graphics/barcode/code39.py : - --- code39.py 2006-05-04 12:48:36.000000000 +0200 +++ /usr/lib/python2.5/site-packages/reportlab/graphics/barcode/code39.py 2008-11-20 15:51:12.000000000 +0100 @@ -138,7 +138,8 @@ return self.decomposed def _humanText(self): - - return self.stop and self.encoded[1:-1] or self.encoded + text = self.stop and self.encoded[1:-1] or self.encoded + return self.checksum and text[:-1] or text class Standard39(_Code39Base): """ Stephane -------------- next part -------------- An HTML attachment was scrubbed... URL: From matt at tplus1.com Thu Nov 20 21:54:40 2008 From: matt at tplus1.com (Matthew Wilson) Date: Thu, 20 Nov 2008 21:54:40 -0500 Subject: [reportlab-users] How can I set the width of a table? Message-ID: I'm drawing several tables and their width seems to be dynamic based on the contents. It looks goofy. How can I require that every table draws with a fixed width? Matt -- Matthew Wilson matt at tplus1.com http://tplus1.com From paul.barrass at safeonlinebilling.com Thu Nov 20 22:00:04 2008 From: paul.barrass at safeonlinebilling.com (Paul Barrass) Date: Fri, 21 Nov 2008 03:00:04 +0000 Subject: [reportlab-users] How can I set the width of a table? In-Reply-To: References: Message-ID: <49262434.9040100@safeonlinebilling.com> Matthew Wilson wrote: > I'm drawing several tables and their width seems to be dynamic based > on the contents. It looks goofy. How can I require that every table > draws with a fixed width? You can pass a colWidths parameter (a list of widths which must be the same length as the number of columns) when you create the table if you want fix the columns widths for each table. I'm not sure it's possible to specify a fixed total width, but with dynamically assigned widths of the individual columns, though someone may know different. Paul Barrass. From Samuele.Kaplun at cern.ch Fri Nov 21 08:41:29 2008 From: Samuele.Kaplun at cern.ch (Samuele Kaplun) Date: Fri, 21 Nov 2008 14:41:29 +0100 Subject: [reportlab-users] pyRXP sources and question about potential memory leak? In-Reply-To: <956003ae0811190936l35bb8f64tf5dead2166194cdc@mail.gmail.com> References: <200811191829.10494.Samuele.Kaplun@cern.ch> <956003ae0811190936l35bb8f64tf5dead2166194cdc@mail.gmail.com> Message-ID: <200811211441.30729.Samuele.Kaplun@cern.ch> Dear Andy, Il Wednesday 19 November 2008 18:36:13 Andy Robinson ha scritto: > We use it daily in production in many applications, but we haven't updated > its web page properly in recent months. > > It's mature with no changes in a long time, and definitely production > quality. > > The latest code is at > http://svn.reportlab.com/svn/public/pyRXP/trunk/ thanks a lot for the quick answer and for the URL. Glad to discover that pyRXP has not disappeared :-) BTW in the project I'm involved in we use it as a part of one of our core library, and we're experiencing a strange behaviour: as part of our tools we instantiate an instance of the parser, and we parse thousands of snippets of XML, one at a time via the parse method of this same pyRXP.Parser instance. We keep the same instance in order to avoid latency in the initialization. However, this procedure is getting slower and slower each time a snipped is parsed. Could it be that pyRXP has a memory leak or is keeping permanent information although these will not be used in the next snippet parsing? Best regards, Samuele -- .O. ..O OOO From andy at reportlab.com Fri Nov 21 08:49:54 2008 From: andy at reportlab.com (Andy Robinson) Date: Fri, 21 Nov 2008 13:49:54 +0000 Subject: [reportlab-users] pyRXP sources and question about potential memory leak? In-Reply-To: <200811211441.30729.Samuele.Kaplun@cern.ch> References: <200811191829.10494.Samuele.Kaplun@cern.ch> <956003ae0811190936l35bb8f64tf5dead2166194cdc@mail.gmail.com> <200811211441.30729.Samuele.Kaplun@cern.ch> Message-ID: <956003ae0811210549k18ecc35dy573a454cccb04a5d@mail.gmail.com> 2008/11/21 Samuele Kaplun : > parsed. Could it be that pyRXP has a memory leak or is keeping permanent > information although these will not be used in the next snippet parsing? > I did find one memory leak a couple of years ago. This was in the callback to locate and parse a DTD; it only happened when parsing XML files with a DTD reference at the top, and we fixed it. Have you tried with the latest SVN code? If you still see the problem, can you send us a script which shows the leak (e.g. parse your XML document a few thousand times) and we will look at it quickly? ... any bugs might bite us one day as well! Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From Samuele.Kaplun at cern.ch Fri Nov 21 10:33:00 2008 From: Samuele.Kaplun at cern.ch (Samuele Kaplun) Date: Fri, 21 Nov 2008 16:33:00 +0100 Subject: [reportlab-users] pyRXP sources and question about potential memory leak? In-Reply-To: <956003ae0811210549k18ecc35dy573a454cccb04a5d@mail.gmail.com> References: <200811191829.10494.Samuele.Kaplun@cern.ch> <200811211441.30729.Samuele.Kaplun@cern.ch> <956003ae0811210549k18ecc35dy573a454cccb04a5d@mail.gmail.com> Message-ID: <200811211633.00889.Samuele.Kaplun@cern.ch> Dear Andy, Il Friday 21 November 2008 14:49:54 Andy Robinson ha scritto: > I did find one memory leak a couple of years ago. This was in the > callback to locate and parse a DTD; it only happened when parsing XML > files with a DTD reference at the top, and we fixed it. Have you > tried with the latest SVN code? > > If you still see the problem, can you send us a script which shows > the leak (e.g. parse your XML document a few thousand times) and we > will look at it quickly? ... any bugs might bite us one day as well! great! It was this!! On our production server we were still using version pyRXP-1.12 (from 2006-11-04) so you were even perfectly right with your guess of a couple of years ago! I've tested by removing the DTD line and it doesn't take a linear amount of time (WRT the number of parsing operation) anymore!! Thanks a lot! We definitively need to upgrade our installation... Best regards, Sam Ps infact I wasn't able to reproduce this on my testing machine, since I was using the latest SVN version... -- .O. ..O OOO From dirk.holtwick at gmail.com Fri Nov 21 11:14:30 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Fri, 21 Nov 2008 17:14:30 +0100 Subject: [reportlab-users] ANNOUNCE pisa 3.0.28 Message-ID: <4926DE66.3040501@gmail.com> Hi, I just published a new version of Pisa/XHTML2PDF. You can get it here: http://pypi.python.org/pypi/pisa/ http://www.xhtml2pdf.com/ So this could also be interesting for the Reportlab community since it includes a modified Paragraph implementation that is able to handle inline background colors. Another interesting feature for your PDF development could be the visual testing feature that uses ImageMagick and TortoiseIDiff to show you if two PDF differ from each other. This could be increasing the quality of your code if used in your unit tests. Enjoy it. Dirk From b.aldemir at e-evolution.de Mon Nov 24 05:58:33 2008 From: b.aldemir at e-evolution.de (=?ISO-8859-1?Q?B=FClent_Aldemir?=) Date: Mon, 24 Nov 2008 11:58:33 +0100 Subject: [reportlab-users] Using EPS Files / PDF Images in canvas Message-ID: Hi, I have googled but I found no solution for embedding EPS files or PDF images in a canvas. Is this possible? Greetings B?lent From andy at reportlab.com Mon Nov 24 06:03:40 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 24 Nov 2008 11:03:40 +0000 Subject: [reportlab-users] Using EPS Files / PDF Images in canvas In-Reply-To: References: Message-ID: <956003ae0811240303q72fcae43rae3aef2ffd21a2b9@mail.gmail.com> 2008/11/24 B?lent Aldemir : > Hi, > > I have googled but I found no solution for embedding EPS files or PDF > images in a canvas. > > Is this possible? It needs our commercial products - Report Markup Language can basically treat PDF files as images and position them in many ways. The open source code lacks a PDF or EPS parser and can't do this. If you'd like a quotation for the commercial libraries, please email me directly and let me know the intended use and rough volumes of PDFs you would be producing. Best Regards, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From ralsina at netmanagers.com.ar Mon Nov 24 06:22:38 2008 From: ralsina at netmanagers.com.ar (Roberto Alsina) Date: Mon, 24 Nov 2008 09:22:38 -0200 Subject: [reportlab-users] Using EPS Files / PDF Images in canvas In-Reply-To: References: Message-ID: <200811240922.48816.ralsina@netmanagers.com.ar> On Monday 24 November 2008 08:58:33 B?lent Aldemir wrote: > Hi, > > I have googled but I found no solution for embedding EPS files or PDF > images in a canvas. > > Is this possible? You can convert EPS to SVG and then use Dinu's svglib, or you can see if uniconvertor can handle the specific file and use my SVGImage flowable (don't be fooled by the name, it can handle some EPS files) My flowable is just these two files (and 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 -- ("\''/").__..-''"`-. . 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From b.aldemir at e-evolution.de Mon Nov 24 06:28:22 2008 From: b.aldemir at e-evolution.de (=?ISO-8859-1?Q?B=FClent_Aldemir?=) Date: Mon, 24 Nov 2008 12:28:22 +0100 Subject: [reportlab-users] Using EPS Files / PDF Images in canvas In-Reply-To: <200811240922.48816.ralsina@netmanagers.com.ar> References: <200811240922.48816.ralsina@netmanagers.com.ar> Message-ID: Thanks Roberto. I will give it a try! If it's so simple, I think it will work for me ;-)) Greetings B?lent 2008/11/24 Roberto Alsina > On Monday 24 November 2008 08:58:33 B?lent Aldemir wrote: > > > Hi, > > > > > > I have googled but I found no solution for embedding EPS files or PDF > > > images in a canvas. > > > > > > Is this possible? > > You can convert EPS to SVG and then use Dinu's svglib, or you can see if > uniconvertor can handle the specific file and use my SVGImage flowable > (don't be fooled by the name, it can handle some EPS files) > > My flowable is just these two files (and 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 > > -- > > ("\''/").__..-''"`-. . 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 > > _______________________________________________ > 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 gherman at darwin.in-berlin.de Mon Nov 24 06:51:56 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 24 Nov 2008 12:51:56 +0100 Subject: [reportlab-users] Using EPS Files / PDF Images in canvas In-Reply-To: References: <200811240922.48816.ralsina@netmanagers.com.ar> Message-ID: B?lent Aldemir: > Thanks Roberto. I will give it a try! If it's so simple, > I think it will work for me ;-)) As Roberto said, if you have SVG you can use my free svglib [1] which has a few hundred test cases. I found it to con- sistenty outperform uniconvertor for SVG import. I also have a direct PDF import tool in the making, but it's not available yet, unless you want to make financial contributions to boost its development. I posted some ex- amples here that you can find in the archives on this list. Regards, Dinu [1] http://pypi.python.org/pypi/svglib From b.aldemir at e-evolution.de Mon Nov 24 07:22:24 2008 From: b.aldemir at e-evolution.de (=?ISO-8859-1?Q?B=FClent_Aldemir?=) Date: Mon, 24 Nov 2008 13:22:24 +0100 Subject: [reportlab-users] Using EPS Files / PDF Images in canvas In-Reply-To: References: <200811240922.48816.ralsina@netmanagers.com.ar> Message-ID: > As Roberto said, if you have SVG you can use my free svglib > [1] which has a few hundred test cases. I found it to con- > sistenty outperform uniconvertor for SVG import. > Actually I was reading your presentation [2]. Are the links [3-4] on your website outdated too? I will have a look on the test cases :-))) B?lent [1] http://pypi.python.org/pypi/svglib [2] http://python.net/~gherman/presentations/rlgsvg-epc2002.pdf [3] http://python.net/~gherman/projects/svglib/ [4] http://python.net/~gherman/svglib.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From gherman at darwin.in-berlin.de Mon Nov 24 07:27:00 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 24 Nov 2008 13:27:00 +0100 Subject: [reportlab-users] Using EPS Files / PDF Images in canvas In-Reply-To: References: <200811240922.48816.ralsina@netmanagers.com.ar> Message-ID: <10DA915F-BAC3-4161-B221-7696D06777A3@darwin.in-berlin.de> B?lent Aldemir: > Actually I was reading your presentation [2]. Are the links [3-4] on > your website outdated too? You'll find all my new stuff on www.python.org/pypi or [1]. Svglib has been updated to 0.6.2. Regards, Dinu [1] http://www.dinu-gherman.net/tmp From gherman at darwin.in-berlin.de Mon Nov 24 09:30:30 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Mon, 24 Nov 2008 15:30:30 +0100 Subject: [reportlab-users] Future of py2pdf In-Reply-To: <956003ae0811190337h4c01cf1cn87f0cef70610fb12@mail.gmail.com> References: <3A314D7C-5CBD-4606-94C6-5308CACF7F28@darwin.in-berlin.de> <956003ae0811190337h4c01cf1cn87f0cef70610fb12@mail.gmail.com> Message-ID: <3081AA8C-F87D-4B62-8E20-1BA0DE4108AE@darwin.in-berlin.de> Andy Robinson: > It's your call. Just let us know. We'll be setting up a page of > links to related packages in December anyway. It would be > good to decide for sure this month, though. Ok, then please remove py2pdf from the distribution! I'll provide later a link to the seperate replacement that you can point to on the reportlab.org website. Thanks, Dinu From andy at reportlab.com Mon Nov 24 10:31:34 2008 From: andy at reportlab.com (Andy Robinson) Date: Mon, 24 Nov 2008 15:31:34 +0000 Subject: [reportlab-users] Future of py2pdf In-Reply-To: <3081AA8C-F87D-4B62-8E20-1BA0DE4108AE@darwin.in-berlin.de> References: <3A314D7C-5CBD-4606-94C6-5308CACF7F28@darwin.in-berlin.de> <956003ae0811190337h4c01cf1cn87f0cef70610fb12@mail.gmail.com> <3081AA8C-F87D-4B62-8E20-1BA0DE4108AE@darwin.in-berlin.de> Message-ID: <956003ae0811240731t3aafe92s42ee35fd2a6bd3a8@mail.gmail.com> 2008/11/24 Dinu Gherman : > Andy Robinson: > >> It's your call. Just let us know. We'll be setting up a page of >> links to related packages in December anyway. It would be >> good to decide for sure this month, though. > > Ok, then please remove py2pdf from the distribution! I'll > provide later a link to the seperate replacement that you > can point to on the reportlab.org website. > Committed now. We'll probably move the other things in 'tools' shortly - Pythonpoint can go to 'demos', and the other bits are small enough to go into 'lib'. Less top level directories makes everything easier to understand. - Andy From mpeters42 at gmail.com Mon Nov 24 13:09:12 2008 From: mpeters42 at gmail.com (Mark Peters) Date: Mon, 24 Nov 2008 13:09:12 -0500 Subject: [reportlab-users] Using EPS Files / PDF Images in canvas In-Reply-To: References: Message-ID: <25a37b830811241009y695f009ctbfd93d685a12e1ac@mail.gmail.com> I have recently resurrected an older project, initially started as a proposal for the first Google Summer of Code project. In the last few months, I've refactored most of the code and have something I'd call alpha functionality. Right now, it handles most EPS clipart I've thrown at it, but I still have some work to do getting embedded fonts and subsets passed along to the PDF. See my original proposal here: http://ivanhouse.com/gsc/proposal.pdf What kind of EPS files do you want to include? If you send me an example via email, I can run it through what I have now and let you know if there are any problems. Once I get some more time to thow at this project and polish it up some more, my plan is to submit a patch. Mark Peters On Mon, Nov 24, 2008 at 5:58 AM, B?lent Aldemir wrote: > Hi, > > I have googled but I found no solution for embedding EPS files or PDF > images in a canvas. > > Is this possible? > > Greetings > B?lent > _______________________________________________ > 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 matt at tplus1.com Mon Nov 24 18:33:21 2008 From: matt at tplus1.com (Matthew Wilson) Date: Mon, 24 Nov 2008 18:33:21 -0500 Subject: [reportlab-users] Why isn't my really wide table splitting? Message-ID: I want my really wide table to wrap, but instead, it just runs off the edge of the PDF. This is how I'm building it: from reportlab.platypus import Table, SimpleDocTemplate row = range(1, 101) data = [row, row, row] doc = SimpleDocTemplate('x.pdf') doc.build([Table(data)]) And when I look at the PDF, it doesn't wrap. Instead, I just see the middle. What am I doing wrong? -- Matthew Wilson matt at tplus1.com http://tplus1.com From bfreeman at appropriatesolutions.com Mon Nov 24 19:23:04 2008 From: bfreeman at appropriatesolutions.com (Bill Freeman) Date: Mon, 24 Nov 2008 19:23:04 -0500 Subject: [reportlab-users] Why isn't my really wide table splitting? In-Reply-To: References: Message-ID: <492B4568.5080608@appropriatesolutions.com> Matthew Wilson wrote: > I want my really wide table to wrap, but instead, it just runs off the > edge of the PDF. > > This is how I'm building it: > > from reportlab.platypus import Table, SimpleDocTemplate > row = range(1, 101) > data = [row, row, row] > doc = SimpleDocTemplate('x.pdf') > doc.build([Table(data)]) > > And when I look at the PDF, it doesn't wrap. Instead, I just see the middle. > > What am I doing wrong? > > Last time I looked at the code (maybe 3 months ago) there was no code for splitting horizontally. (A nice variable to say what you preferred, but only vertical splitting code.) Bill From andy at reportlab.com Tue Nov 25 02:24:59 2008 From: andy at reportlab.com (Andy Robinson) Date: Tue, 25 Nov 2008 07:24:59 +0000 Subject: [reportlab-users] Why isn't my really wide table splitting? In-Reply-To: <492B4568.5080608@appropriatesolutions.com> References: <492B4568.5080608@appropriatesolutions.com> Message-ID: <956003ae0811242324v6acf2e9s9eccae7d394f9030@mail.gmail.com> 2008/11/25 Bill Freeman : > Matthew Wilson wrote: >> I want my really wide table to wrap, but instead, it just runs off the >> edge of the PDF. > Last time I looked at the code (maybe 3 months ago) there was no code for > splitting horizontally. Bill's right. Although there is some old and probably unmaintained code from years back to help a programmer explicitly split tables horizontally, the main Platypus algorithm assumes all your content fits within the width of your frame, and asks them to split vertically. IMHO it's much easier for programmers to cut up their data into chunks in Python and generate a sequence of smaller tables than it is for us to split tables in 2 dimensions and correctly take care of all the box and border styling rules. Sorry, -- Andy Robinson CEO/Chief Architect ReportLab Europe Ltd. Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK Tel +44-20-8545-1570 From matt at tplus1.com Tue Nov 25 07:13:15 2008 From: matt at tplus1.com (Matthew Wilson) Date: Tue, 25 Nov 2008 07:13:15 -0500 Subject: [reportlab-users] Why isn't my really wide table splitting? In-Reply-To: <956003ae0811242324v6acf2e9s9eccae7d394f9030@mail.gmail.com> References: <492B4568.5080608@appropriatesolutions.com> <956003ae0811242324v6acf2e9s9eccae7d394f9030@mail.gmail.com> Message-ID: That's cool -- but I would really like to request that the documentation make that clearer. Can I submit a patch with a change to the docs? Matt On Tue, Nov 25, 2008 at 2:24 AM, Andy Robinson wrote: > 2008/11/25 Bill Freeman : >> Matthew Wilson wrote: >>> I want my really wide table to wrap, but instead, it just runs off the >>> edge of the PDF. >> Last time I looked at the code (maybe 3 months ago) there was no code for >> splitting horizontally. > Bill's right. Although there is some old and probably unmaintained > code from years back to help a programmer explicitly split tables > horizontally, the main Platypus algorithm assumes all your content > fits within the width of your frame, and asks them to split > vertically. > > IMHO it's much easier for programmers to cut up their data into chunks > in Python and generate a sequence of smaller tables than it is for us > to split tables in 2 dimensions and correctly take care of all the box > and border styling rules. > > Sorry, > > -- > Andy Robinson > CEO/Chief Architect > ReportLab Europe Ltd. > Media House, 3 Palmerston Road, Wimbledon, London SW19 1PG, UK > Tel +44-20-8545-1570 > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users > -- Matthew Wilson matt at tplus1.com http://tplus1.com From andy at reportlab.com Tue Nov 25 07:44:28 2008 From: andy at reportlab.com (Andy Robinson) Date: Tue, 25 Nov 2008 12:44:28 +0000 Subject: [reportlab-users] Why isn't my really wide table splitting? In-Reply-To: References: <492B4568.5080608@appropriatesolutions.com> <956003ae0811242324v6acf2e9s9eccae7d394f9030@mail.gmail.com> Message-ID: <956003ae0811250444l4f4cec4ane78afa4676efe167@mail.gmail.com> 2008/11/25 Matthew Wilson : > That's cool -- but I would really like to request that the > documentation make that clearer. > > Can I submit a patch with a change to the docs? > Yes please! We love such patches and will commit it very quickly if it looks reasonable ;-) - Andy From dirk.holtwick at gmail.com Wed Nov 26 12:41:10 2008 From: dirk.holtwick at gmail.com (Dirk Holtwick) Date: Wed, 26 Nov 2008 18:41:10 +0100 Subject: [reportlab-users] BUGFIX: Re:   in paragraph In-Reply-To: <956003ae0810060450m39d20d74pb6e15b9e92e97ff3@mail.gmail.com> References: <48E778F6.3010601@gmail.com> <956003ae0810060450m39d20d74pb6e15b9e92e97ff3@mail.gmail.com> Message-ID: <492D8A36.3070302@gmail.com> Hi, to fix the described error please modify the following function in "paragraph.py": -----------------8<---------------[cut here] #on UTF8 branch, split and strip must be unicode-safe! def split(text, delim=None): if type(text) is str: text = text.decode('utf8') if type(delim) is str: delim = delim.decode('utf8') # This fixes   issue and multiple linebraks on splitted page part if delim is None and text == u'\xa0': delim = ' ' return [uword.encode('utf8') for uword in text.split(delim)] -----------------8<---------------[cut here] Cheers Dirk Andy Robinson schrieb: > 2008/10/4 Dirk Holtwick : >> Hi, >> >> for my project pisa I create the paragraph >> fragments directly. Until version 2.1 of RL I used a non breaking space >> placeholder like u"\u00a0" and it worked fine. Since 2.2 this one seems to >> be considered a normal whitespace and therefore removed. Any hints how I can >> define a fragment with just nothing in it and the length of a space >> character? > > This sounds like a bug. I have logged it in our tracker (issue 679, > and hopefully the tracker will be visible by midweek); Robin's back > from vacation now and will hopefully be able to look at it this week > before we do 2.2.1. > > > - Andy > _______________________________________________ > reportlab-users mailing list > reportlab-users at reportlab.com > http://two.pairlist.net/mailman/listinfo/reportlab-users From simon.king at motorola.com Thu Nov 27 12:24:58 2008 From: simon.king at motorola.com (King Simon-NFHD78) Date: Thu, 27 Nov 2008 17:24:58 -0000 Subject: [reportlab-users] PDF Transparency Message-ID: <8D20BBB55F590E42AADF592A815E861703BF1ACB@zuk35exm65.ds.mot.com> Hi, Does anyone have any plans to support the PDF Transparency model in ReportLab? I had a need for basic support (just the stroking and non-stroking alpha constants), which I've managed to hack in to reportlab. However, I don't know if the method is suitable for general consumption. In particular, I don't know if it would make it difficult to support the more general transparency model The basic idea was: * add an attribute to the canvas that tracks ExtGStates * add set[Non]StrokeAlphaConstant methods that create and activate new ExtGStates * in canvas.showPage, pass the ExtGStates on to the page * add strokeOpacity and fillOpacity to some of the shapes in reportlab.graphics.shapes * update _PDFRenderer.applyStateChanges to pas those properties on to the canvas. I also had to update PDFHeader to PDF version 1.4, because that is the first version that supported transparency. This is the first time I've looked at both the PDF spec and the reportlab code, so I've probably done something very silly. Does this approach sound reasonable? One flaw at the moment is that a new graphics state gets created every time you call set[Non]StrokeAlphaConstant, even if you pass the same parameter. It would be much better to reuse states if possible. I can post the patch if anyone is interested. Thanks for listening, Simon King From robin at reportlab.com Thu Nov 27 12:45:31 2008 From: robin at reportlab.com (Robin Becker) Date: Thu, 27 Nov 2008 17:45:31 +0000 Subject: [reportlab-users] PDF Transparency In-Reply-To: <8D20BBB55F590E42AADF592A815E861703BF1ACB@zuk35exm65.ds.mot.com> References: <8D20BBB55F590E42AADF592A815E861703BF1ACB@zuk35exm65.ds.mot.com> Message-ID: <492EDCBB.2000903@chamonix.reportlab.co.uk> King Simon-NFHD78 wrote: > Hi, > > Does anyone have any plans to support the PDF Transparency model in > ReportLab? .......... > > The basic idea was: > > * add an attribute to the canvas that tracks ExtGStates > > * add set[Non]StrokeAlphaConstant methods that create and activate new > ExtGStates > > * in canvas.showPage, pass the ExtGStates on to the page > > * add strokeOpacity and fillOpacity to some of the shapes in > reportlab.graphics.shapes > > * update _PDFRenderer.applyStateChanges to pas those properties on to > the canvas. > > I also had to update PDFHeader to PDF version 1.4, because that is the > first version that supported transparency. > > This is the first time I've looked at both the PDF spec and the > reportlab code, so I've probably done something very silly. Does this > approach sound reasonable? > > One flaw at the moment is that a new graphics state gets created every > time you call set[Non]StrokeAlphaConstant, even if you pass the same > parameter. It would be much better to reuse states if possible. > > I can post the patch if anyone is interested. > > Thanks for listening, > > Simon King ....... by all means post the patch. I guess the main problem is that we'd probably like to expose 1.4 capabilities in a controlled way. Perhaps we should have an attribute that specified which level of PDF is being aimed at. I guess that should probably be on the PDFDoc, but perhaps it should be settable on the canvas (as that needs support as well). -- Robin Becker From simon.king at motorola.com Thu Nov 27 13:09:37 2008 From: simon.king at motorola.com (King Simon-NFHD78) Date: Thu, 27 Nov 2008 18:09:37 -0000 Subject: [reportlab-users] PDF Transparency In-Reply-To: <492EDCBB.2000903@chamonix.reportlab.co.uk> Message-ID: <8D20BBB55F590E42AADF592A815E861703BF1AD5@zuk35exm65.ds.mot.com> > -----Original Message----- > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of > Robin Becker > Sent: 27 November 2008 17:46 > To: Support list for users of Reportlab software > Subject: Re: [reportlab-users] PDF Transparency > > King Simon-NFHD78 wrote: > > Hi, > > > > Does anyone have any plans to support the PDF Transparency model in > > ReportLab? > .......... > > > > I can post the patch if anyone is interested. > > > > Thanks for listening, > > > > Simon King > ....... > by all means post the patch. I guess the main problem is that > we'd probably like > to expose 1.4 capabilities in a controlled way. Perhaps we > should have an > attribute that specified which level of PDF is being aimed > at. I guess that > should probably be on the PDFDoc, but perhaps it should be > settable on the > canvas (as that needs support as well). > -- > Robin Becker OK, here's the patch - it's a little ugly at the moment. I was thinking a little more about managing the ExtGState dictionaries. Do you think it is reasonable to create a state for each 'extended attribute' value? For example, setting both the stroke alpha and fill alpha results in the creation of two states. This keeps the canvas interface nice and simple, possibly at the expense of efficiency. I suppose you could expose add_extgstate method and activate_extgstate as well, for users who want to manage them manually. Thanks again, Simon -------------- next part -------------- A non-text attachment was scrubbed... Name: reportlab_opacity_patch.patch Type: application/octet-stream Size: 5865 bytes Desc: reportlab_opacity_patch.patch Url : From simon.king at motorola.com Fri Nov 28 09:13:59 2008 From: simon.king at motorola.com (King Simon-NFHD78) Date: Fri, 28 Nov 2008 14:13:59 -0000 Subject: [reportlab-users] [PATCH] PDF Transparency In-Reply-To: <8D20BBB55F590E42AADF592A815E861703BF1AD5@zuk35exm65.ds.mot.com> Message-ID: <8D20BBB55F590E42AADF592A815E861703BF1C76@zuk35exm65.ds.mot.com> > -----Original Message----- > From: reportlab-users-bounces at reportlab.com > [mailto:reportlab-users-bounces at reportlab.com] On Behalf Of > King Simon-NFHD78 > Sent: 27 November 2008 18:10 > To: Support list for users of Reportlab software > Subject: Re: [reportlab-users] PDF Transparency > > OK, here's the patch - it's a little ugly at the moment. > > I was thinking a little more about managing the ExtGState > dictionaries. > Do you think it is reasonable to create a state for each 'extended > attribute' value? For example, setting both the stroke alpha and fill > alpha results in the creation of two states. This keeps the canvas > interface nice and simple, possibly at the expense of efficiency. > > I suppose you could expose add_extgstate method and activate_extgstate > as well, for users who want to manage them manually. > > Thanks again, > > Simon > Here's an updated version of the patch, and an example PDF with the results. With this new patch, reportlab should generate exactly the same PDFs that it has always done (including the version, 1.3) if you don't ever call canvas.setStrokeAlphaConstant or canvas.setFillAlphaConstant. If you call one of those functions, a version 1.4 PDF will be generated instead. It now caches the graphics states, so there will only be a single state for each transparency level used. I think it would be fairly easy to add different blend modes, but I haven't done it. I also haven't done anything about transparency mask shapes - I've no idea if they would be easy to implement. I hope this can be considered for inclusion in ReportLab, but I am happy to continue to use my patched version if it is not acceptable. I think it does everything I need at this point so I probably won't be putting any more work into it for the moment. Thanks, Simon King -------------- next part -------------- A non-text attachment was scrubbed... Name: transparency.pdf Type: application/octet-stream Size: 3025 bytes Desc: transparency.pdf Url : -------------- next part -------------- A non-text attachment was scrubbed... Name: reportlab_opacity_patch2.patch Type: application/octet-stream Size: 11984 bytes Desc: reportlab_opacity_patch2.patch Url : From gherman at darwin.in-berlin.de Fri Nov 28 10:50:18 2008 From: gherman at darwin.in-berlin.de (Dinu Gherman) Date: Fri, 28 Nov 2008 16:50:18 +0100 Subject: [reportlab-users] Adding word/hyphenations to wordaxe Message-ID: Hi, does anybody here use wordaxe (I'm using 0.3.0) and knows how to pass it a list of additional words with allowed hyphenation points? Thanks, Dinu