← Back to team overview

schooltool-developers team mailing list archive

Re: Photo instance

 

On 02/17/2012 01:23 AM, Douglas Cerna wrote:

Thanks Justas! When you're OK with these changes I'll merge my branch.

Now I need your help with another thing:

I tried to insert a photo in a PDF. Just for testing, I tried to modify the default report template inserting an image directive with its file attribute pointing to the photo url.

The problem is that z3c.rml.attr.File.fromUnicode uses urllib.urlopen to retrieve the resource, which produces a Forbidden page, since the request doesn't have session info :( You end up with an IOError, because PIL.Image tries to open the HTML.

Is there a way to modify z3c.rml behavior when processing<image ...>  directives?

Let me know what you think.


  If you merge with trunk, you can start using:

<image tal:attributes="imageName student/photo/@@data_uri" ... />

  to embed images in RML.

Cheers,
Justas



References