I got distracted.  my real problem is something changed in the last
year.  imagine that.

last year I would get everything on one page.  good.
Now I get a blank page, then most of the content, then a bit on page 3. bad.

I am trying to track down when it changed, so I wrote a small .py,
which gives the same error, but does create the .pdf - anyone know how
to get a page count from a pdf?  That will at least let me figure out
when the report engine changed from good to bad.


#!/usr/bin/python
# ckdre.py
# check dabo report engine

# currently checks number of pages - 1 = pass, anything else = fail.

from cStringIO import StringIO

# from reportlab.pdfbase import pdfmetrics
# from reportlab.pdfbase.ttfonts import TTFont
from dabo.dReportWriter import dReportWriter
import os

# import poppler
# from gtk.gdk import Pixbuf,COLORSPACE_RGB

def mkpdf(ds, xmlfile):
    """
    Return a pdf made from the passed dataset.
    """

    # buffer to create pdf in
    buffer = StringIO()

    # generate the pdf in the buffer, using the layout and data
    rw = dReportWriter(OutputFile=buffer, ReportFormFile=xmlfile, Cursor=ds)
    rw.write()

    # get the pdf out of the buffer
    pdf = buffer.getvalue()
    buffer.close()

    return pdf


if __name__=='__main__':
    ds={'talk_title':"My Great PyCon08 Talk", 'presenter_name':"John
Doh", 'talk_id':"PM5", 'event_id':"113"}

    pdf = mkpdf([ds],'release.rfxml')
    open('test.pdf','wb').write(pdf)

-- 
Carl K


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to