ReportLab + Zope : here's a working example
Hi, some time ago I've put some sample scripts for people who didn't know how to use ReportLab from within Zope, at : http://cortex.unice.fr/~jerome/RLfromZope unfortunately, because of lack of time those scripts were just made for people to look at, but people couldn't make them run, because I hadn't stripped all our particularities : some methods and images were missing. so I'm please to announce the availability of rlzope, available from the very same url as mentionned above, but which is a completely self contained and working example (tested under Netscape 4.77 and Mozilla 0.9.7 under Debian GNU/Linux) which you can play with. See the README for installation instructions. Hoping this helps. Jerome Alet
Thanks for your helpful example. I have some problems including the logo image (I used a gif image). I always get an error (pdf does not start with '%PDF-') from Mozilla and IE6 and the file is not created. Maybe a PIL problem? I am using Zope 2.5 and PIL 1.1.2 for Python 2.1 on Win2k. Juergen --On Dienstag, 12. Februar 2002 20:47 +0100 Jerome Alet <alet@unice.fr> wrote:
Hi,
some time ago I've put some sample scripts for people who didn't know how to use ReportLab from within Zope, at :
http://cortex.unice.fr/~jerome/RLfromZope
unfortunately, because of lack of time those scripts were just made for people to look at, but people couldn't make them run, because I hadn't stripped all our particularities : some methods and images were missing.
so I'm please to announce the availability of rlzope, available from the very same url as mentionned above, but which is a completely self contained and working example (tested under Netscape 4.77 and Mozilla 0.9.7 under Debian GNU/Linux) which you can play with.
See the README for installation instructions.
Hoping this helps.
Jerome Alet
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Mit freundlichen Grüßen, DI Jürgen R. Plasser Gesellschafter plasser@hexagon.at Tel.: +43 / 732 / 640 530 DW 40 HEXAGON EDV-Dienstleistungen Hosiner OEG A-4221 Steyregg Weissenwolffstraße 14 Tel.: +43 / 732 / 640 530 Fax: +43 / 732 / 640 530 - 20 http://www.hexagon.at info@hexagon.at Bankverbindung: Allg. Sparkasse OÖ, BLZ: 20320, Kto.-Nr.: 1900003623 Firmenbuchnummer: FN 167631t Firmenbuchgericht: Handelsgericht Linz
On Wed, 13 Feb 2002, Juergen R. Plasser / HEXAGON wrote:
Thanks for your helpful example.
it would be more helpful if it worked everywhere... (any help appreciated)
I have some problems including the logo image (I used a gif image). I
should work, my test image is a .gif
always get an error (pdf does not start with '%PDF-') from Mozilla and IE6 and the file is not created. Maybe a PIL problem? I am using Zope 2.5 and PIL 1.1.2 for Python 2.1 on Win2k.
My successful tests were done on : Debian GNU/Linux 3.0 (Woody) Zope 2.4.2 (Debian standard package) Python 2.1.2 (Debian standard package) Mozilla 0.9.7 (Debian standard package) Netscape 4.77 (Debian standard package) Adobe Acrobat Reader 4.05 (Debian standard package) and on the same system, with the help of VMWare (3.0.0 build 1455) : Windows 98 Internet Explorer 5.00.2614.3500 Netscape 6.2 Adobe Acrobat Reader 5.05 Under Windows the pdf file is not opened in the browser window, but Acrobat Reader is launched and the file is read correctly. The same if I save the file then open it later with Acrobat Reader. It works the same whatever browser I use. BTW the script was updated with the help of Robin Becker from the ReportLab team, to take care of installations made in the "Shared" directory, find it at : http://cortex.unice.fr/~jerome/RLfromZope/ hth. Jerome Alet
I haven't looked at the code yet, but I remember having the same problems with my report lab pdf creation... When I opened the created pdf file with the 'rb' parameter it worked perfectly... as in return open(filename,'rb').read() Regards, Tom. ----- Original Message ----- From: "Jerome Alet" <alet@unice.fr> To: "Juergen R. Plasser / HEXAGON" <plasser@hexagon.at> Cc: <zope@zope.org> Sent: Wednesday, February 13, 2002 3:28 PM Subject: Re: [Zope] ReportLab + Zope : here's a working example
On Wed, 13 Feb 2002, Juergen R. Plasser / HEXAGON wrote:
Thanks for your helpful example.
it would be more helpful if it worked everywhere... (any help appreciated)
I have some problems including the logo image (I used a gif image). I
should work, my test image is a .gif
always get an error (pdf does not start with '%PDF-') from Mozilla and IE6 and the file is not created. Maybe a PIL problem? I am using Zope 2.5 and PIL 1.1.2 for Python 2.1 on Win2k.
My successful tests were done on :
Debian GNU/Linux 3.0 (Woody) Zope 2.4.2 (Debian standard package) Python 2.1.2 (Debian standard package) Mozilla 0.9.7 (Debian standard package) Netscape 4.77 (Debian standard package) Adobe Acrobat Reader 4.05 (Debian standard package)
and on the same system, with the help of VMWare (3.0.0 build 1455) :
Windows 98 Internet Explorer 5.00.2614.3500 Netscape 6.2 Adobe Acrobat Reader 5.05
Under Windows the pdf file is not opened in the browser window, but Acrobat Reader is launched and the file is read correctly. The same if I save the file then open it later with Acrobat Reader. It works the same whatever browser I use.
BTW the script was updated with the help of Robin Becker from the ReportLab team, to take care of installations made in the "Shared" directory, find it at :
http://cortex.unice.fr/~jerome/RLfromZope/
hth.
Jerome Alet
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
On Wed, 13 Feb 2002, Tom Deprez wrote:
I haven't looked at the code yet, but I remember having the same problems with my report lab pdf creation... When I opened the created pdf file with the 'rb' parameter it worked perfectly...
as in return open(filename,'rb').read()
Oh, yes ! This would explain why it works fine if the server is under *Nix and not if it is under Windows. However no open is done, the file is built in memory with a cStringIO and returned to the browser using StringIO's getvalue() method. How could I make it binary safe ? thanks in advance. Jerome Alet
I haven't looked at the code yet, but I remember having the same problems with my report lab pdf creation... When I opened the created pdf file with the 'rb' parameter it worked perfectly...
as in return open(filename,'rb').read()
Oh, yes !
This would explain why it works fine if the server is under *Nix and not if it is under Windows.
Correct.
However no open is done, the file is built in memory with a cStringIO and returned to the browser using StringIO's getvalue() method. How could I make it binary safe ?
Urgh, sorry, don't know... I wish I knew it myself... that's why I moved to storing it on a file and then opening the file. What I do is to make a file in the tempory directory of the server. I wished I didn't had to use this method. Regards, Tom.
Thanks to Chris Herrnberger I solved the problem. It seem to be a PIL installation problem. See http://vsbabu.org/webdev/zopedev/pil4win.html for very helpful instructions on windows systems. HTH, Juergen --On Mittwoch, 13. Februar 2002 14:19 +0100 "Juergen R. Plasser / HEXAGON" <plasser@hexagon.at> wrote:
Thanks for your helpful example. I have some problems including the logo image (I used a gif image). I always get an error (pdf does not start with '%PDF-') from Mozilla and IE6 and the file is not created. Maybe a PIL problem? I am using Zope 2.5 and PIL 1.1.2 for Python 2.1 on Win2k.
Juergen
--On Dienstag, 12. Februar 2002 20:47 +0100 Jerome Alet <alet@unice.fr> wrote:
Hi,
some time ago I've put some sample scripts for people who didn't know how to use ReportLab from within Zope, at :
http://cortex.unice.fr/~jerome/RLfromZope
unfortunately, because of lack of time those scripts were just made for people to look at, but people couldn't make them run, because I hadn't stripped all our particularities : some methods and images were missing.
so I'm please to announce the availability of rlzope, available from the very same url as mentionned above, but which is a completely self contained and working example (tested under Netscape 4.77 and Mozilla 0.9.7 under Debian GNU/Linux) which you can play with.
See the README for installation instructions.
Hoping this helps.
Jerome Alet
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Mit freundlichen Grüßen, DI Jürgen R. Plasser Gesellschafter
plasser@hexagon.at Tel.: +43 / 732 / 640 530 DW 40
HEXAGON EDV-Dienstleistungen Hosiner OEG A-4221 Steyregg Weissenwolffstraße 14 Tel.: +43 / 732 / 640 530 Fax: +43 / 732 / 640 530 - 20 http://www.hexagon.at info@hexagon.at
Bankverbindung: Allg. Sparkasse OÖ, BLZ: 20320, Kto.-Nr.: 1900003623 Firmenbuchnummer: FN 167631t Firmenbuchgericht: Handelsgericht Linz
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Mit freundlichen Grüßen, DI Jürgen R. Plasser Gesellschafter plasser@hexagon.at Tel.: +43 / 732 / 640 530 DW 40 HEXAGON EDV-Dienstleistungen Hosiner OEG A-4221 Steyregg Weissenwolffstraße 14 Tel.: +43 / 732 / 640 530 Fax: +43 / 732 / 640 530 - 20 http://www.hexagon.at info@hexagon.at Bankverbindung: Allg. Sparkasse OÖ, BLZ: 20320, Kto.-Nr.: 1900003623 Firmenbuchnummer: FN 167631t Firmenbuchgericht: Handelsgericht Linz
Interesting! Thanks for the link. Tom. ----- Original Message ----- From: "Juergen R. Plasser / HEXAGON" <plasser@hexagon.at> To: <zope@zope.org> Sent: Thursday, February 14, 2002 9:34 AM Subject: Re: [Zope] ReportLab + Zope : here's a working example
Thanks to Chris Herrnberger I solved the problem. It seem to be a PIL installation problem. See http://vsbabu.org/webdev/zopedev/pil4win.html for very helpful instructions on windows systems.
HTH, Juergen
--On Mittwoch, 13. Februar 2002 14:19 +0100 "Juergen R. Plasser / HEXAGON" <plasser@hexagon.at> wrote:
Thanks for your helpful example. I have some problems including the logo image (I used a gif image). I always get an error (pdf does not start with '%PDF-') from Mozilla and IE6 and the file is not created. Maybe a PIL problem? I am using Zope 2.5 and PIL 1.1.2 for Python 2.1 on Win2k.
Juergen
--On Dienstag, 12. Februar 2002 20:47 +0100 Jerome Alet <alet@unice.fr> wrote:
Hi,
some time ago I've put some sample scripts for people who didn't know how to use ReportLab from within Zope, at :
http://cortex.unice.fr/~jerome/RLfromZope
unfortunately, because of lack of time those scripts were just made for people to look at, but people couldn't make them run, because I hadn't stripped all our particularities : some methods and images were missing.
so I'm please to announce the availability of rlzope, available from the very same url as mentionned above, but which is a completely self contained and working example (tested under Netscape 4.77 and Mozilla 0.9.7 under Debian GNU/Linux) which you can play with.
See the README for installation instructions.
Hoping this helps.
Jerome Alet
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Mit freundlichen Grüßen, DI Jürgen R. Plasser Gesellschafter
plasser@hexagon.at Tel.: +43 / 732 / 640 530 DW 40
HEXAGON EDV-Dienstleistungen Hosiner OEG A-4221 Steyregg Weissenwolffstraße 14 Tel.: +43 / 732 / 640 530 Fax: +43 / 732 / 640 530 - 20 http://www.hexagon.at info@hexagon.at
Bankverbindung: Allg. Sparkasse OÖ, BLZ: 20320, Kto.-Nr.: 1900003623 Firmenbuchnummer: FN 167631t Firmenbuchgericht: Handelsgericht Linz
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Mit freundlichen Grüßen, DI Jürgen R. Plasser Gesellschafter
plasser@hexagon.at Tel.: +43 / 732 / 640 530 DW 40
HEXAGON EDV-Dienstleistungen Hosiner OEG A-4221 Steyregg Weissenwolffstraße 14 Tel.: +43 / 732 / 640 530 Fax: +43 / 732 / 640 530 - 20 http://www.hexagon.at info@hexagon.at
Bankverbindung: Allg. Sparkasse OÖ, BLZ: 20320, Kto.-Nr.: 1900003623 Firmenbuchnummer: FN 167631t Firmenbuchgericht: Handelsgericht Linz
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Jerome Alet -
Juergen R. Plasser / HEXAGON -
Tom Deprez