s = s + "%5.3f %5.3f M (%s) SH \n" % (self.pWidth * thiselement / nelements, texty,
                                                  title)
            if info_string:
                info = self.postscriptEscape(info_string)
                # This is deliberately printed in the previous font.
                s = s + "( - ) SH\n"
                if "email" in title_string.lower():
                    s = s + "/%s %5.3f selectfont\n" % (self.di.personalinfoFixedFontName,
                                                        infofontsize)
                else:
                    s = s + "/%s %5.3f selectfont\n" % (self.di.personalinfoFontName,
                                                        infofontsize)
                s = s + "(%s) SH\n" % info
            thiselement += 1
        liney = self.pHeight - self.linenum * self.linespacing
        if linethick:
            s = s + "%5.2f SLW " % self.di.underlineThick
        else:
            s = s + "0   SLW "
        s = s + "0 %5.3f M %5.3f 0 RL S\n" % (liney,self.pWidth)
        self.linenum = self.linenum + 1
        return s


if __name__ == '__main__':
    di = DiaryInfo(sys.argv[0], sys.argv[1:])
    pip = PersonalInformationPage(di)
    print preamble(di)
    print pip.page()
    print postamble(di)
Example #2
0
        epsfilepathname = self.findEPSFile(self.epsfilename)
        if epsfilepathname is None:
            print >> sys.stderr, "cannot find %s" % self.epsfilename
            return "%% %s: cannot find %s\n" % (self.__class__.__name__,
                                                self.epsfilename)
        s = s + "%% %s: found %s at %s\n" % (self.__class__.__name__,
                                             self.epsfilename, epsfilepathname)

        title1 = self.title1
        if title1 is not None and (self.title2 is None or self.title2 == ''):
            # This single space is a bit of a hack to get a line across underneath where the
            # title would go, without putting a title there.
            title2 = ' '
        else:
            title2 = self.title2
        s = s + HalfEPSFilePage(self.dinfo, epsfilepathname,
                                title1, HalfEPSFilePage.LEFT).page() \
              + HalfEPSFilePage(self.dinfo, epsfilepathname,
                                title2, HalfEPSFilePage.RIGHT).page()
        return s


if __name__ == '__main__':
    di = DiaryInfo(sys.argv[0], sys.argv[1:])
    #di.epsFilePageOption('eps/units/units.eps|EPS file units.eps', 1)
    #di.epsFilePageOption('eps/units/units.eps', 2)
    print preamble(di)
    print EPSFilePage(di, 'makediary-qrcode.eps').page()
    print TwoEPSFilePages(di, 'makediary-qrcode.eps').page()
    print postamble(di)