Ejemplo n.º 1
0
    def processPS(self, file, writer, context, registry, bbox):
        registry.add(_BeginEPSF)
        registry.add(_EndEPSF)
        bbox += self.bbox()

        if self.kpsearch:
            epsfile = filelocator.open(self.filename,
                                       [filelocator.format.pict], "rb")
        else:
            epsfile = open(self.filename, "rb")

        file.write("BeginEPSF\n")

        if self.clip:
            llx_pt, lly_pt, urx_pt, ury_pt = self.mybbox.transformed(
                self.trafo).highrestuple_pt()
            file.write("%g %g %g %g rectclip\n" %
                       (llx_pt, lly_pt, urx_pt - llx_pt, ury_pt - lly_pt))

        self.trafo.processPS(file, writer, context, registry, bbox)

        file.write("%%%%BeginDocument: %s\n" % self.filename)
        file.write(epsfile.read())
        file.write("%%EndDocument\n")
        file.write("EndEPSF\n")
        epsfile.close()
Ejemplo n.º 2
0
    def processPS(self, file, writer, context, registry, bbox):
        registry.add(_BeginEPSF)
        registry.add(_EndEPSF)
        bbox += self.bbox()

        if self.kpsearch:
            epsfile = filelocator.open(self.filename, [filelocator.format.pict], "rb")
        else:
            epsfile = open(self.filename, "rb")

        file.write("BeginEPSF\n")

        if self.clip:
            llx_pt, lly_pt, urx_pt, ury_pt = self.mybbox.transformed(self.trafo).highrestuple_pt()
            file.write("%g %g %g %g rectclip\n" % (llx_pt, lly_pt, urx_pt-llx_pt, ury_pt-lly_pt))

        self.trafo.processPS(file, writer, context, registry, bbox)

        file.write("%%%%BeginDocument: %s\n" % self.filename)
        file.write(epsfile.read())
        file.write("%%EndDocument\n")
        file.write("EndEPSF\n")
        epsfile.close()
Ejemplo n.º 3
0
 def open(self):
     if self.kpsearch:
         return filelocator.open(self.filename, [filelocator.format.pict], "rb")
     else:
         return open(self.filename, "rb")