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.