Refinement of problem statement:
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. 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.
The python is below:
data = [n for n in context.objectValues(['RDMA
Narrative','RDMA Indicator']) if n.country==selectedCountry]
body=""
##TITLE PAGE
body+="<h1>%s</h1>\n" %
selectedCountry
body+="<!-- PAGE BREAK -->\n"
##BODY
for d in data:
body+="%s\n" %
(d.title)
if d.meta_type == 'RDMA Indicator':
if
hasattr(d,'xltohtml'):
body+=d.xltohtml()
elif d.meta_type == 'RDMA
Narrative':
body+="<h3>%s</h3>" %
d.narrativeType
body+=d.narrativeText
body+="<!-- PAGE BREAK -->\n"
return body
I'm using html2pdf and it seems to be truncating the content. The
html on which html2pdf is:
<html>
<head><title>Narrative Report</title></head>
<body>
<h1>PNG</h1>
<h2>Narrative: PNG- Challenge Situation</h2>
<h2>Narrative: PNG- Key
Accomplishments</h2>
<h2>Narrative: PNG- Program Performance</h2>
<h2>Narrative: PNG- Success Stories</h2>
<h2>Table 1-2 PNG</h2>
<h2>Table 1-4 PNG</h2>
<h2>Narrative: PNG- Annex II</h2>
<h2>Narrative: PNG- Annex III</h2>
</body>
</html>
The html which html2pdf is writing to the pdf though is:
<html>
<head><title>Narrative Report</title></head>
<body>
<h1>PNG</h1>
<!-- PAGE BREAK -->
</body>
</html>
I'm at a loss to explain the truncation. Can anyone offer some suggestions?