Hi,

we do have different set of keyword arguments involved in pages and  
documents. There are page-wide parameters (like the paperformat,  
centered, fittosize, etc.) and document-wide parameters, like the  
mesh_as_bitmap or text_as_path.

In the canvas-methods we pass keyword arguments to the page, not to  
the document. To influence the document parameters, you thus cannot  
(currently) use the canvas-write shortcut methods.

Regarding your N.B. comment --- could you please explain it again? I  
don't understand what you mean.

Best,


André

Am 09.06.2008 um 14:28 schrieb Michael J Gruber:

> Hi there
>
> I'm trying out the new mesh_as_bitmap writer option (current svn),
> because gv and printer disagree with evince about the pdfs I generate.
>
> I use g.writeEPSfile() and such on a graph instance g which inherits
> from canvas.
>
> Friendly python says
>
>     g.writeEPSfile(__file__[:-3],mesh_as_bitmap=1)
>   File "/home/mjg/lib/python/PyX-git/pyx/canvas.py", line 285, in
> wrappedindocument
>     d = document.document([document.page(self, **kwargs)])
> TypeError: __init__() got an unexpected keyword argument  
> 'mesh_as_bitmap'
>
> I suspect the culprit in the following snippet from canvas.py. While I
> can't possibly wrap my brain around ingenious code like that I reckon
> that the "kwargs" it passes to the document.page constructor are  
> rather
> meant to be passed to "method", because they ultimately stem from a  
> call
> to the wrapped writer method. Making that change results in success  
> for
> my case, but I'm not sure about the full implications.
>
> Michael
>
> N.B.: In fact I think evince got it wrong for the (shaded, not
> bitmapped) pdf. The surface looks semi-transparent with a stroked  
> mesh.
> So, I guess printer and gs are both correct here, which is not a
> coincidence...
>
> def _wrappedindocument(method):
>     def wrappedindocument(self, file=None, **kwargs):
>         d = document.document([document.page(self, **kwargs)])
>         self.__name__ = method.__name__
>         self.__doc__ = method.__doc__
>         return method(d, file)
>     return wrappedindocument
>
>
> class canvas(_canvas):
>
>     """a canvas holds a collection of canvasitems"""
>
>     writeEPSfile = _wrappedindocument(document.document.writeEPSfile)
>     writePSfile = _wrappedindocument(document.document.writePSfile)
>     writePDFfile = _wrappedindocument(document.document.writePDFfile)
>     writetofile = _wrappedindocument(document.document.writetofile)
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> PyX-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyx-devel
>

-- 
by  _ _      _    Dr. André Wobst, Amselweg 22, 85716 Unterschleißheim
    / \ \    / )   [EMAIL PROTECTED], http://www.wobsta.de/
   / _ \ \/\/ /    PyX - High quality PostScript and PDF figures
  (_/ \_)_/\_/     with Python & TeX: visit http://pyx.sourceforge.net/


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
PyX-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-devel

Reply via email to