On Wed, 8 Jun 2011 21:46:01 +0200
André Wobst <wobsta@...> scribit:
> Hi René,
>
> looks like you're creating a document with several pages. Fine, but you need writePSfile in the first version (as EPS can be created for a single page document only).
>
> When changing (1) to PS instead of EPS you may end up with the same problem you observe in (2). Now it would be interesting to see how your epsfile statement looks like.
>
>
> André
Merci André,
writePSfile works! (writePDFfile dont), but
after compiling one can use ps2pdf to get a PDF file.
(making sound synthesis & music composition with Python, I can now write the music,
edit a visual score (on several pages) and insert pitches and chords above to aid the perception).
Thanks for PyX !
>
>
> Am 08.06.2011 um 19:39 schrieb R. Bastian:
>
> > Bonsoir tous,
> >
> > I try to insert the file "f.eps" created by Pyx:
> >
> > 1) writeEPSfile returns:
> >
> > Traceback (most recent call last):
> > File "exemple2.py", line 120, in <module>
> > d.writeEPSfile(titre)
> > File "/usr/local/lib/python2.6/site-packages/pyx/document.py", line 163, in writeEPSfile
> > pswriter.EPSwriter(self, _outputstream(file, "eps"), **kwargs)
> > File "/usr/local/lib/python2.6/site-packages/pyx/pswriter.py", line 131, in __init__
> > raise ValueError("EPS file can be constructed out of a single page document only")
> > ValueError: EPS file can be constructed out of a single page document only
> >
> > ---------------------------------------------
> > 2)
> > writePDFfile returns:
> >
> > EPS file is included as a bitmap created using pipeGS
> > Traceback (most recent call last):
> > File "exemple2.py", line 121, in <module>
> > d.writePDFfile(titre)
> > File "/usr/local/lib/python2.6/site-packages/pyx/document.py", line 169, in writePDFfile
> > pdfwriter.PDFwriter(self, _outputstream(file, "pdf"), **kwargs)
> > File "/usr/local/lib/python2.6/site-packages/pyx/pdfwriter.py", line 316, in __init__
> > catalog = PDFcatalog(document, self, registry)
> > File "/usr/local/lib/python2.6/site-packages/pyx/pdfwriter.py", line 142, in __init__
> > self.PDFpages = PDFpages(document, writer, registry)
> > File "/usr/local/lib/python2.6/site-packages/pyx/pdfwriter.py", line 201, in __init__
> > page = PDFpage(page, pageno, self, writer, registry)
> > File "/usr/local/lib/python2.6/site-packages/pyx/pdfwriter.py", line 235, in __init__
> > self.PDFcontent = PDFcontent(page, writer, self.pageregistry)
> > File "/usr/local/lib/python2.6/site-packages/pyx/pdfwriter.py", line 267, in __init__
> > page.processPDF(contentfile, writer, acontext, registry, self.bbox)
> > File "/usr/local/lib/python2.6/site-packages/pyx/document.py", line 132, in processPDF
> > self._process("processPDF", *args)
> > File "/usr/local/lib/python2.6/site-packages/pyx/document.py", line 126, in _process
> > getattr(cc, processMethod)(contentfile, writer, context, registry, bbox)
> > File "/usr/local/lib/python2.6/site-packages/pyx/canvas.py", line 174, in processPDF
> > item.processPDF(file, writer, context, registry, nbbox)
> > File "/usr/local/lib/python2.6/site-packages/pyx/epsfile.py", line 346, in processPDF
> > c.pipeGS(fname, device="pngalpha", resolution=600)
> > File "/usr/local/lib/python2.6/site-packages/pyx/canvas.py", line 323, in pipeGS
> > self.writeEPSfile(pipe, **kwargs)
> > File "/usr/local/lib/python2.6/site-packages/pyx/canvas.py", line 289, in wrappedindocument
> > return method(d, file)
> > File "/usr/local/lib/python2.6/site-packages/pyx/document.py", line 163, in writeEPSfile
> > pswriter.EPSwriter(self, _outputstream(file, "eps"), **kwargs)
> > File "/usr/local/lib/python2.6/site-packages/pyx/pswriter.py", line 142, in __init__
> > file.write("%!PS-Adobe-3.0 EPSF-3.0\n")
> > IOError: [Errno 9] Bad file descriptor
> >
> > ------------------------------------------------
> >
> > What can I do? Do you need other infos?
> >
> > Thanks for your help.
> >
> >
> >
> > --
> > René Bastian
> > http://www.pythoneon.org
> > http://www.musiques-rb.org
> >
> > ------------------------------------------------------------------------------
> > EditLive Enterprise is the world's most technically advanced content
> > authoring tool. Experience the power of Track Changes, Inline Image
> > Editing and ensure content is compliant with Accessibility Checking.
> > http://p.sf.net/sfu/ephox-dev2dev
> > _______________________________________________
> > PyX-user mailing list
> > PyX-user@...
> > https://lists.sourceforge.net/lists/listinfo/pyx-user
>
> --
> by _ _ _ Dr. André Wobst, Amselweg 22, 85716 Unterschleißheim
> / \ \ / ) wobsta@..., http://www.wobsta.de/
> / _ \ \/\/ / PyX - High quality PostScript and PDF figures
> (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/
>
--
René Bastian
http://www.pythoneon.org
http://www.musiques-rb.org
|