<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2912" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=563272016-17072006><FONT face=Arial
color=#0000ff size=2>Found the problem: context was changing. When
called from html2pdf, the parent object was different from when the dtml was
called raw.</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Jonathan [mailto:dev101@magma.ca]
<BR><B>Sent:</B> Monday, July 17, 2006 10:52 AM<BR><B>To:</B> Smith, Barrett;
zope@zope.org<BR><B>Subject:</B> Re: [Zope] RE: html2pdf truncating html
content<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2>some more wags:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>1) remove the html comments from the generated html
code (ie. get rid of the <!-- PAGE BREAK --> tags)</FONT></DIV>
<DIV><FONT face=Arial size=2>2) remove the body loop and hard code in a 1 liner
instead eg. body +='some new text' and see what happens</FONT></DIV>
<DIV><FONT face=Arial size=2>3) where are the <html> and </html>
tags added into the html code you pass to html2pdf? (they weren't in the python
code you posted)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jonathan</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=bsmith@constellagroup.com
href="mailto:bsmith@constellagroup.com">Smith, Barrett</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=dev101@magma.ca
href="mailto:dev101@magma.ca">Jonathan</A> ; <A title=zope@zope.org
href="mailto:zope@zope.org">zope@zope.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, July 17, 2006 10:39
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [Zope] RE: html2pdf
truncating html content</DIV>
<DIV><BR></DIV>
<DIV dir=ltr align=left><SPAN class=213093714-17072006><FONT face=Arial
color=#0000ff size=2>Thanks, Jonathan, but no joy. Testing for the value
of of d.title before writing it doesn't change the output and even a hardcoded
body+="text goes here" just inside the for loop doesn't get
printed.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=213093714-17072006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=213093714-17072006><FONT face=Arial
color=#0000ff size=2>Barrett</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Jonathan [mailto:dev101@magma.ca]
<BR><B>Sent:</B> Monday, July 17, 2006 10:25 AM<BR><B>To:</B> Smith, Barrett;
<A href="mailto:zope@zope.org">zope@zope.org</A><BR><B>Subject:</B> Re: [Zope]
RE: html2pdf truncating html content<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2>Just a wag (wild assed guess)... in your BODY
loop, if d.title is null could you be embedding a 'null' char in the text
string, which may cause html2pdf to choke?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Jonathan</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=bsmith@constellagroup.com
href="mailto:bsmith@constellagroup.com">Smith, Barrett</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=zope@zope.org
href="mailto:zope@zope.org">zope@zope.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, July 17, 2006 9:30
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> RE: [Zope] RE: html2pdf
truncating html content</DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><BR></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=519452413-17072006>Refinement of problem
statement:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=519452413-17072006></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=519452413-17072006>The DTML file on which html2pdf is called is
populated by a python script which builds and returns html by processing a
list of objects in a for loop. <SPAN class=519452413-17072006><FONT
face=Arial color=#0000ff size=2>The html content which is missing from the
pdf is generated inside the for loop. As said before though, the
information built in the for loop is displayed in the DTML when it is viewed
as a webpage.</FONT></SPAN></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=519452413-17072006><SPAN
class=519452413-17072006></SPAN></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=519452413-17072006>The python is below:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=519452413-17072006></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=519452413-17072006>data = [n for n in context.objectValues(['RDMA
Narrative','RDMA Indicator']) if n.country==selectedCountry]
</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=519452413-17072006>body=""</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=519452413-17072006>##TITLE PAGE<BR>body+="<h1>%s</h1>\n" %
selectedCountry<BR>body+="<!-- PAGE BREAK -->\n"</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=519452413-17072006>##BODY<BR>for d in data:<BR> body+="%s\n" %
(d.title)<BR> if d.meta_type == 'RDMA
Indicator':<BR> if
hasattr(d,'xltohtml'):<BR>
body+=d.xltohtml()<BR> elif d.meta_type == 'RDMA
Narrative':<BR> body+="<h3>%s</h3>" %
d.narrativeType<BR> body+=d.narrativeText<BR>
body+="<!-- PAGE BREAK -->\n"</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=519452413-17072006>return body</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<DIV><SPAN class=519452413-17072006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial
size=2></FONT><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
zope-bounces+bsmith=constellagroup.com@zope.org
[mailto:zope-bounces+bsmith=constellagroup.com@zope.org] <B>On Behalf Of
</B>Smith, Barrett<BR><B>Sent:</B> Monday, July 17, 2006 9:14
AM<BR><B>To:</B> zope@zope.org<BR><B>Subject:</B> [Zope] RE: html2pdf
truncating html content<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=070215912-17072006><FONT face=Arial
size=2>I'm using html2pdf and it seems to be truncating the content.
The html on which html2pdf is:</FONT></SPAN></DIV>
<DIV><SPAN class=070215912-17072006></SPAN> </DIV>
<DIV><SPAN class=070215912-17072006><<SPAN
class=start-tag>html</SPAN>><BR><<SPAN
class=start-tag>head</SPAN>><<SPAN
class=start-tag>title</SPAN>>Narrative Report</<SPAN
class=end-tag>title</SPAN>></<SPAN
class=end-tag>head</SPAN>><BR><<SPAN
class=start-tag>body</SPAN>><BR><BR><BR><<SPAN
class=start-tag>h1</SPAN>>PNG</<SPAN
class=end-tag>h1</SPAN>><BR><SPAN class=comment><!-- PAGE BREAK
--></SPAN><BR><<SPAN class=start-tag>h2</SPAN>>Narrative: PNG-
Challenge Situation</<SPAN class=end-tag>h2</SPAN>><BR><SPAN
class=comment><!-- PAGE BREAK --></SPAN><BR><<SPAN
class=start-tag>h2</SPAN>>Narrative: PNG- Key Accomplishments</<SPAN
class=end-tag>h2</SPAN>><BR><SPAN class=comment><!-- PAGE BREAK
--></SPAN><BR><<SPAN class=start-tag>h2</SPAN>>Narrative: PNG-
Program Performance</<SPAN class=end-tag>h2</SPAN>><BR></DIV>
<DIV><PRE id=line13><SPAN class=comment><!-- PAGE BREAK --></SPAN>
<<SPAN class=start-tag>h2</SPAN>>Narrative: PNG- Success Stories</<SPAN class=end-tag>h2</SPAN>>
<SPAN class=comment><!-- PAGE BREAK --></SPAN>
<<SPAN class=start-tag>h2</SPAN>>Table 1-2 PNG</<SPAN class=end-tag>h2</SPAN>>
<SPAN class=comment><!-- PAGE BREAK --></SPAN>
<<SPAN class=start-tag>h2</SPAN>>Table 1-4 PNG</<SPAN class=end-tag>h2</SPAN>>
<SPAN class=comment><!-- PAGE BREAK --></SPAN>
<<SPAN class=start-tag>h2</SPAN>>Narrative: PNG- Annex II</<SPAN class=end-tag>h2</SPAN>>
<SPAN class=comment><!-- PAGE BREAK --></SPAN>
<<SPAN class=start-tag>h2</SPAN>>Narrative: PNG- Annex III</<SPAN class=end-tag>h2</SPAN>>
<SPAN class=comment><!-- PAGE BREAK --></SPAN>
</PRE><PRE id=line25></<SPAN class=end-tag>body</SPAN>>
</<SPAN class=end-tag>html</SPAN>>
</PRE><PRE><SPAN class=070215912-17072006>The html which html2pdf is writing to the pdf though is:</SPAN></PRE><PRE><SPAN class=070215912-17072006><html><BR><head><title>Narrative Report</title></head><BR><body><BR></SPAN><SPAN class=070215912-17072006></SPAN></PRE><PRE><SPAN class=070215912-17072006><h1>PNG</h1><BR><!-- PAGE BREAK --><BR></SPAN></PRE><PRE><SPAN class=070215912-17072006></body><BR></html><BR></SPAN></PRE><PRE><SPAN class=070215912-17072006>I'm at a loss to explain the truncation. Can anyone offer some suggestions?</PRE></SPAN></SPAN></DIV>
<P>
<HR>
<P></P>_______________________________________________<BR>Zope
maillist -
Zope@zope.org<BR>http://mail.zope.org/mailman/listinfo/zope<BR>**
No cross posts or HTML encoding! **<BR>(Related lists -
<BR> http://mail.zope.org/mailman/listinfo/zope-announce<BR> http://mail.zope.org/mailman/listinfo/zope-dev
)<BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>