[reportlab-users] RE: reportlab-users digest, Vol 2 #162 - 6 msgs

Jody Burgess reportlab-users@reportlab.com
Wed, 21 Jul 2004 08:27:01 -0600


Thanks Andy.

Jody Burgess ISP
Systems Analyst
Seward Consulting Ltd.
780.702.5103
jody.burgess@sewardconsulting.com


-----Original Message-----
From: reportlab-users-admin@reportlab.com
[mailto:reportlab-users-admin@reportlab.com]On Behalf Of
reportlab-users-request@reportlab.com
Sent: Wednesday, July 21, 2004 12:08 AM
To: reportlab-users@reportlab.com
Subject: reportlab-users digest, Vol 2 #162 - 6 msgs


Send reportlab-users mailing list submissions to
	reportlab-users@reportlab.com

To subscribe or unsubscribe via the World Wide Web, visit
	http://two.pairlist.net/mailman/listinfo/reportlab-users
or, via email, send a message with subject or body 'help' to
	reportlab-users-request@reportlab.com

You can reach the person managing the list at
	reportlab-users-admin@reportlab.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of reportlab-users digest..."


Today's Topics:

   1. "setfont" tag in RML seems not to work propelry (Ulrich Weber)
   2. Re: "setfont" tag in RML seems not to work propelry (Bogdan M.
Maryniuck)
   3. Re: "setfont" tag in RML seems not to work propelry (Robin Becker)
   4. Re: "setfont" tag in RML seems not to work propelry (Robin Becker)
   5. Re: "setfont" tag in RML seems not to work propelry (Bogdan M.
Maryniuck)
   6. Re: RE: reportlab-users digest, Vol 2 #160 - 1 msg
(andy@reportlab.com)

--__--__--

Message: 1
To: reportlab-users@reportlab.com
From: Ulrich Weber <uweber@csc.com>
Date: Mon, 19 Jul 2004 11:59:04 +0200
Subject: [reportlab-users] "setfont" tag in RML seems not to work propelry
Reply-To: reportlab-users@reportlab.com





When using the setfont tag in RML with a font name different from
"Helvetica" or "Times-Roman" I get a python exception as shown in the
following example:

RML-Code:

<?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
<!DOCTYPE document SYSTEM "rml_1_0.dtd">
<document filename="dummy.pdf">
 <template pageSize="(21cm, 29.7cm)" leftMargin="2cm" rightMargin="2cm"
topMargin="2.5cm" bottomMargin="2.5cm">
  <pageTemplate id="main">
   <pageGraphics>
    <setFont name="Helvetica-Bold" size="14"/>
    <drawString x="2cm" y="28.0cm">test</drawString>
   </pageGraphics>
   <frame id="body" x1="1.8cm" y1="2.5cm"  width="17.4cm" height="24.7cm"/>
  </pageTemplate>
 </template>
 <stylesheet>
 </stylesheet>
 <story>
  <para>This is the "story". This is the part of the RML document where
your text is placed.</para>
 </story>
</document>

Resulting python message:

Traceback (most recent call last):
  File "D:\Program
Files\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
    exec codeObject in __main__.__dict__
  File "D:\AR_Tool\AR_Tool_V9.1\AR_Tool\Script1.py", line 27, in ?
    x = parseString(rml)
  File "trml2pdf\trml2pdf.py", line 518, in parseString
  File "trml2pdf\trml2pdf.py", line 148, in render
  File "trml2pdf\trml2pdf.py", line 507, in render
  File "D:\Program
Files\Python23\lib\site-packages\reportlab\platypus\doctemplate.py", line
650, in build
    self._endBuild()
  File "D:\Program
Files\Python23\lib\site-packages\reportlab\platypus\doctemplate.py", line
607, in _endBuild
    if getattr(self,'_doSave',1): self.canv.save()
  File "D:\Program
Files\Python23\lib\site-packages\reportlab\pdfgen\canvas.py", line 847, in
save
    self._doc.SaveToFile(self._filename, self)
  File "D:\Program
Files\Python23\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 234, in
SaveToFile
    f.write(self.GetPDFData(canvas))
  File "D:\Program
Files\Python23\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 256, in
GetPDFData
    return self.format()
  File "D:\Program
Files\Python23\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 413, in
format
    return File.format(self)
  File "D:\Program
Files\Python23\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 770, in
format
    return string.join(self.strings, "")
  File "D:\Program Files\Python23\Lib\string.py", line 135, in join
    return sep.join(words)
UnicodeDecodeError: 'ascii' codec can't decode byte 0x93 in position 11:
ordinal not in range(128)

As stated above, font names "Helvetica" and "Times-Roman" work fine, all
other font names don't work.

I am using Python 2.3; may this cause the problem ?

I am looking forward to your advice!

Ulrich Weber


--__--__--

Message: 2
Date: Tue, 20 Jul 2004 11:31:18 +0300
To: reportlab-users@reportlab.com
Subject: Re: [reportlab-users] "setfont" tag in RML seems not to work
propelry
From: bo@bitute.b4net.lt (Bogdan M. Maryniuck)
Reply-To: reportlab-users@reportlab.com

On Mon, Jul 19, 2004 at 11:59:04AM +0200, Ulrich Weber wrote:
> Traceback (most recent call last):
>   File "D:\Program
>
Files\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
> line 310, in RunScript
>     exec codeObject in __main__.__dict__
>   File "D:\AR_Tool\AR_Tool_V9.1\AR_Tool\Script1.py", line 27, in ?
>     x = parseString(rml)
>   File "trml2pdf\trml2pdf.py", line 518, in parseString
>   File "trml2pdf\trml2pdf.py", line 148, in render
>   File "trml2pdf\trml2pdf.py", line 507, in render
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\platypus\doctemplate.py", line
> 650, in build
>     self._endBuild()
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\platypus\doctemplate.py", line
> 607, in _endBuild
>     if getattr(self,'_doSave',1): self.canv.save()
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\pdfgen\canvas.py", line 847, in
> save
>     self._doc.SaveToFile(self._filename, self)
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 234,
in
> SaveToFile
>     f.write(self.GetPDFData(canvas))
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 256,
in
> GetPDFData
>     return self.format()
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 413,
in
> format
>     return File.format(self)
>   File "D:\Program
> Files\Python23\lib\site-packages\reportlab\pdfbase\pdfdoc.py", line 770,
in
> format
>     return string.join(self.strings, "")
>   File "D:\Program Files\Python23\Lib\string.py", line 135, in join
>     return sep.join(words)
> UnicodeDecodeError: 'ascii' codec can't decode byte 0x93 in position 11:
> ordinal not in range(128)

1. Unicode && TTF's are supported in my fork of this project. But I never
had
tried it (and probably never will) on Win32 OS.

2. Current recipe to you: yourunicodestring.encode(yourcharset) for your
strings.

--
暮

reduce(lambda c,d:chr(ord(d)-2)+c, 'ofcpqkekhhC"zwpkN"fgtgyqR/pqjv{R')

--__--__--

Message: 3
Date: Tue, 20 Jul 2004 09:37:51 +0100
From: Robin Becker <robin@reportlab.com>
To: reportlab-users@reportlab.com
Subject: Re: [reportlab-users] "setfont" tag in RML seems not to work
propelry
Reply-To: reportlab-users@reportlab.com

Ulrich Weber wrote:
>
>
> When using the setfont tag in RML with a font name different from
> "Helvetica" or "Times-Roman" I get a python exception as shown in the
> following example:
>
> RML-Code:
>
> <?xml version="1.0" encoding="iso-8859-1" standalone="no" ?>
> <!DOCTYPE document SYSTEM "rml_1_0.dtd">
> <document filename="dummy.pdf">
>  <template pageSize="(21cm, 29.7cm)" leftMargin="2cm" rightMargin="2cm"
> topMargin="2.5cm" bottomMargin="2.5cm">
>   <pageTemplate id="main">
>    <pageGraphics>
>     <setFont name="Helvetica-Bold" size="14"/>
>     <drawString x="2cm" y="28.0cm">test</drawString>
>    </pageGraphics>
>    <frame id="body" x1="1.8cm" y1="2.5cm"  width="17.4cm"
height="24.7cm"/>
>   </pageTemplate>
>  </template>
>  <stylesheet>
>  </stylesheet>
>  <story>
>   <para>This is the "story". This is the part of the RML document where
> your text is placed.</para>
>  </story>
> </document>
>
> Resulting python message:
>
> Traceback (most recent call last):
........
> I am using Python 2.3; may this cause the problem ?
>
> I am looking forward to your advice!
>
> Ulrich Weber

Ulrich I tried this exact source with the current SVN version of
rml2pdf/reportlab and it works perfectly (as expected) with Python 2.3 under
win32 and freebsd. Since Helvetica-Bold is one of the standard fonts it
should
be available always.

Is it possible that your source text is encoded in some way? I can't seem to
find character 0x93 in your example probably. When I use that character
explicitly pasted in (it seems to be a special double quote) I still get a
working PDF.

Can you say which version or rml2pdf/reportlab you are using?
--
Robin Becker

--__--__--

Message: 4
Date: Tue, 20 Jul 2004 09:41:31 +0100
From: Robin Becker <robin@reportlab.com>
To: reportlab-users@reportlab.com
Subject: Re: [reportlab-users] "setfont" tag in RML seems not to work
propelry
Reply-To: reportlab-users@reportlab.com

Robin Becker wrote:

.......
>> I am using Python 2.3; may this cause the problem ?
>>
>> I am looking forward to your advice!
>>
>> Ulrich Weber
>
>
> Ulrich I tried this exact source with the current SVN version of
> rml2pdf/reportlab and it works perfectly (as expected) with Python 2.3
> under win32 and freebsd. Since Helvetica-Bold is one of the standard
> fonts it should be available always.
>
> Is it possible that your source text is encoded in some way? I can't
> seem to find character 0x93 in your example probably. When I use that
> character explicitly pasted in (it seems to be a special double quote) I
> still get a working PDF.
>
> Can you say which version or rml2pdf/reportlab you are using?

my colleague points out that your traceback seems to indicate that you're
using
someone elses version of rml2pdf eg

   File "D:\AR_Tool\AR_Tool_V9.1\AR_Tool\Script1.py", line 27, in ?
     x = parseString(rml)
   File "trml2pdf\trml2pdf.py", line 518, in parseString
   File "trml2pdf\trml2pdf.py", line 148, in render
   File "trml2pdf\trml2pdf.py", line 507, in render

in which case all bets are off. You probably better consult the author
directly.
--
Robin Becker

--__--__--

Message: 5
Date: Tue, 20 Jul 2004 11:45:18 +0300
To: reportlab-users@reportlab.com
Subject: Re: [reportlab-users] "setfont" tag in RML seems not to work
propelry
From: bo@bitute.b4net.lt (Bogdan M. Maryniuck)
Reply-To: reportlab-users@reportlab.com

On Tue, Jul 20, 2004 at 09:37:51AM +0100, Robin Becker wrote:
> rml2pdf/reportlab and it works perfectly (as expected) with Python 2.3

Robin, I don't think you _expect_ Traceback when using your *commertial*
RML2PDF! ;-)
But seems like Ulrich uses TinyRML from www.openreport.org instead of
RML2PDF from RL.

--
暮

> find /lib/modules/2.4.17-expt/kernel/ -type f|while read i; do insmod $i;
done
You're sick.  I like you.
	-- Andrew Morton on lkml

--__--__--

Message: 6
Date: Tue, 20 Jul 2004 04:24:14 -0700
From: <andy@reportlab.com>
Subject: Re: [reportlab-users] RE: reportlab-users digest, Vol 2 #160 - 1
msg
To: reportlab-users@reportlab.com
Reply-To: reportlab-users@reportlab.com

This has been done but is not easy.  It is possible to insert
postscript 'tray commands' in the document at certain points.
However, the commands to insert require detailed knowledge
of your specific printer and its postscript drivers.  It is
officially 'no longer supported' by Adobe and may require you to
print from an older copy of Acrobat Reader (4.0 works for us).
The best thing would be for you to email the precise printer
model and any driver details to us at support@reportlab.com,
and I will try to dig out what we did on the most recent similar
consulting
project.

Thanks,

Andy Robinson
CEO/Chief Architect
RepoortLab Europe Ltd.
tel +44 20 8544 8049

-----Original Message-----
From: Jody Burgess <jody.burgess@sewardconsulting.com>
To: reportlab-users@reportlab.com
Sent: Mon, 19 Jul 2004 14:42:23 -0600
Subject: [reportlab-users] RE: reportlab-users digest, Vol 2 #160 - 1
msg

Hi;
	I have another question about reportLabs processing. I need to be able
to
encode certain pages to print from specific print trays. For example: A
section heading page would be encoded to print from papertray 1 and the
detailed pages from papertray 2. Can I do this with ReportLabs? If so,
how?
If not, how do I accomplish this? P.S. (example code is very much
appreciated and more useful than a statement like "use Win32all API"


Thanks Very much.

Jody Burgess ISP
Systems Analyst
Seward Consulting Ltd.
780.702.5103
jody.burgess@sewardconsulting.com


-----Original Message-----
From: reportlab-users-admin@reportlab.com
[mailto:reportlab-users-admin@reportlab.com]On Behalf Of
reportlab-users-request@reportlab.com
Sent: Sunday, July 18, 2004 12:06 AM
To: reportlab-users@reportlab.com
Subject: reportlab-users digest, Vol 2 #160 - 1 msg


Send reportlab-users mailing list submissions to
	reportlab-users@reportlab.com

To subscribe or unsubscribe via the World Wide Web, visit
	http://two.pairlist.net/mailman/listinfo/reportlab-users
or, via email, send a message with subject or body 'help' to
	reportlab-users-request@reportlab.com

You can reach the person managing the list at
	reportlab-users-admin@reportlab.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of reportlab-users digest..."


Today's Topics:

   1. Re: Importing a Multipage .Tif file. (Dinu Gherman)

-- __--__--

Message: 1
Cc: Jody Burgess <jody.burgess@sewardconsulting.com>
From: Dinu Gherman <gherman@darwin.in-berlin.de>
Subject: Re: [reportlab-users] Importing a Multipage .Tif file.
Date: Sat, 17 Jul 2004 13:26:10 +0200
To: reportlab-users@reportlab.com
Reply-To: reportlab-users@reportlab.com

Jody Burgess:

> I am using ReportLab to create a pdf and have been successfull in
> importing
> all flavours of ".tif" files. However, I am having problems when the
> tif
> file contains mutiple images. What I need to do is for each image
> contained
> in the .tif file (there are > 1 image stored in each tif file), I need
> to
> create a separate page in the resulting pdf file. Can anyone assist
> with
> this?

Hi Jody,

a Python/PIL-independant solution to your problem - yes, even
on Win32 as it seems, would be to use libtiff externally for
splitting such files. I'd asume libtiff is handling more TIFF
variants than PIL, which at least used to have some problems
with TIFF files generated on a Mac.

   http://www.libtiff.org/tools.html

Regards,

Dinu

--
Dinu C. Gherman - http://python.net/~gherman
......................................................................
I miss you! - http://www.angelika-birck.info



-- __--__--

_______________________________________________
reportlab-users mailing list
reportlab-users@reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users


End of reportlab-users Digest

_______________________________________________
reportlab-users mailing list
reportlab-users@reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users


--__--__--

_______________________________________________
reportlab-users mailing list
reportlab-users@reportlab.com
http://two.pairlist.net/mailman/listinfo/reportlab-users


End of reportlab-users Digest