[reportlab-users] SimpleDocTemplate stripping internal whitespace??

Schollnick, Benjamin reportlab-users@reportlab.com
Fri, 20 Feb 2004 15:07:36 -0500


Folks,

	I have run into a issue, that I can't explain.... 

	I use the follow routine, for Canvas.DrawString, without any
problems...

def format_lines    ( fieldname, data, fieldname_width=15, data_width=20):
    """
        Reformat the data into a string.
        Simply a "Macro", to reduce duplication.
        
        Inputs -
            FieldName   - Name of the field that is to be reformated.
            data        - The actual stored data.

        Outputs -
            fieldname = "This is the fieldname"
            data      = "This is the data."
            "This is the fie: This is the "

        Example:

    """
    fmt = '  %-' + str(fieldname_width) + 's: %-' + str(data_width) + 's'
    return fmt % (fieldname, data)


	Now since I decided to use SimpleDocTemplate, it is appearing that
the
	internal whitespace is being removed...

		i.e.

			Version : 1.7h

	Is there a simple way to have it not filter the internal white
space?

        Contents.append (Paragraph ( format_lines    ( entry[1],
data[entry[2]],
                                                      fieldname_width=25,
data_width=20),
                                     normal ) ) 
    

			- Ben