def InitCanvas(self): pdfmetrics.registerFont (ttfonts.TTFont ('chinese', Constant.GetFont_msjhbd())) # 註冊字型 if os.path.exists(self.tempPdf): os.remove(self.tempPdf) cv = canvas.Canvas(self.tempPdf) cv.setFont ('chinese', 10) return cv
def WhichS89(self, delegationDict): if delegationDict[Delegation.DcitName()].find(self.jpStr)>=0: return Constant.GetS89J() else: return Constant.GetS89CH()
def __init__(self): self.outputPath = Constant.GetOutputFolder() + "\\" + TimeUtil.GetCurrentTime() self.tempPdf = Constant.GetXlsFolder() + "\\temp.pdf" self.jpStr = "JP" self.description = "傳道與生活聚會委派通知單-" self.jpDescription = "日語-"
def __init__(self): self.xlsList = [] self.delegateDate = "" self.tempXls = Constant.GetXlsFolder() + "\\temp.xls" self.sheetName = "Sheet1"
def FindFirstExcel(self): allFileList = os.listdir(Constant.GetXlsFolder()) for file in allFileList: if file.endswith("xls") or file.endswith("xlsx"): return file return ""
def InitAndGetExcelFile(self): if os.path.exists(self.tempXls): os.remove(self.tempXls) xls = self.FindFirstExcel() shutil.copy(Constant.GetXlsFolder() + "\\" + xls, self.tempXls) return self.tempXls
def InitDir(): if os.path.exists(Constant.GetXlsFolder())==False: os.makedirs(Constant.GetXlsFolder()) if os.path.exists(Constant.GetOutputFolder())==False: os.makedirs(Constant.GetOutputFolder())