On 10.11.08, Michael J Gruber wrote:
> This is a reappearance of a similar problem with other writer
> parameters. You're not telling us what your g is, but most probably it's
> a canvas (such as a graph's canvas). If you call the writePDFfile method
> it creates a page instance and a document instance (as you can see in
> the error message). Any parameters passed to canvas.writePDFfile are
> passed on to the page creator (__init__), none are passed to the
> document creator, and none are passed to the writer method of document
> (which you would need), even though you think you're calling the writer
> method with parameters...

Yes, we might need to think about that, although it's not completely
obvious which parameters need to be passed to which constructor.

Anyway, one can solve this problem readily by creating the document
and page instances explicitly (untested!):

   from pyx import *

   c = canvas.canvas()
   # create most magnificent drawing...
   # ...
   # ... and wrap it by yourself
   document.document([document.page(c)]).writePDFfile(title="my opus magnum")

Cheers,

        Jörg

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to