def webfetch(self,REQUEST): """ web """ theTemplate = PDFPageTemplate('issue','products/Newspaper/issue.pd') parent = self.aq_inner return theTemplate.web(REQUEST,parent)
def pdfshow(self,REQUEST): """ pdf """ theTemplate = PDFPageTemplate('issue','var/issue.pd') parent = self.aq_inner return theTemplate.pt_render(REQUEST,parent)
def callNative(self, c, x, y, REQUEST, parent, top, pagenumber): """ Native Version of callPDFPDTBySameName without Wrappers """ y = y + 40 self.left = x self.top = y print self.Title() self.pagenumber = pagenumber # skin = self.portal_skins.newspaper_templates skinTool = getToolByName(self, "portal_skins") # containercontainer = skinTool.newspaper_templates.test.getPhysicalPath() containercontainer = ( "/opt/development/newholland/press/products/Newspaper/skins/newspaper_templates/" + self.Title() ) print containercontainer obj = PDFPageTemplate(self.Title(), containercontainer) print "Container: %s" % self.Title() # y += self.getTop() # x += self.getLeft() # Here is where we replace the continuePDF # Which loops through the items in the folder # with a obj.processScript that uses the directions in the script # to decide what to call next. result = obj.continuePDF(c, x, y, REQUEST, parent, pagenumber) x = result[0] y = result[1] return (x, y)
def callPDTBySameName(self,show,REQUEST,parent,top,left): """ Test """ thePath = '/opt/development/newholland/press/products/Newspaper/skins/newspaper_templates/' + self.Title() + '.pd' containercontainer = PDFPageTemplate(self.Title(),thePath) showTemplate=containercontainer.continueWEB(REQUEST,parent,thePath,'0','0','0','0','0','0') return showTemplate[0]
def webfetch(self, REQUEST): """ web """ theTemplate = PDFPageTemplate( "issue", "/opt/development/newholland/press/products/Newspaper/skins/newspaper_templates/issue.pd" ) parent = self.aq_inner return theTemplate.web(REQUEST, parent)
def pdfshow(self, REQUEST): """ pdf """ theTemplate = PDFPageTemplate( "issue", "/opt/newhol/press/products/Newspaper/skins/newspaper_templates/issue.pd" ) parent = self.aq_inner thePDF = theTemplate.pt_render(REQUEST, parent) REQUEST.response.setHeader("Content-type", "application/pdf") return thePDF
def callPDTBySameName(self, REQUEST, parent, top, left, width, height, start2="", end2=""): """ Test """ # print "Column" # print self.Title() pathcontainer = ( "/opt/development/newholland/press/products/Newspaper/skins/newspaper_templates/" + self.Title() + ".pd" ) # print pathcontainer result = PDFPageTemplate(self.Title(), pathcontainer) fontSize = self.getFontSize() fontName = self.getFontName() fontWeight = self.getFontWeight() fontClass = self.getFontClass() charsPerLine = self.getCharsPerLine() width = charsPerLine * 6 # style = "top:" # style += top # style += "0" # style += "px;" style = "font-size:11pt;position:relative;" style += "width:" style += str(width) style += "px;" # style += "left:" # style += str(left) # style += "px;" style += "text-justify:inter-word;text-align:justify;float:left;margin-right:20px;" # style += "border-color:yellow;border-style:solid;border-width:2px;position:relative;" # print style start = "<div id='" start += self.getId() start += "' class='" start += "column" start += "' style='" start += style start += "'>" end = "</div>" output = start output += start2 output2 = result.continueWEB(REQUEST, parent, pathcontainer) output += output2[0] output += end height = 0 left = str(int(width) + int(left)) return (output, top, left, width, height)
def callPDFPDTBySameName(self,c,x,y,REQUEST,parent,top,pagenumber): """ Test """ print self.Title() columncontainer = '/opt/development/newholland/press/products/Newspaper/skins/newspaper_templates/'+self.Title() obj=PDFPageTemplate(self.Title(),columncontainer) containerLeft = parent.getLeft() width = self.getCharsPerLine() * 6 useLeft = x result=obj.continuePDF(c,useLeft,y+30,REQUEST,parent) #verbage = self.getLinesVerbage() #c.drawString(x,y,verbage) #returnTriplets = self.tripletOutput(x,y,lineSpacing) #self.outputTriplets(c,returnTriplets,x,y) #self.pdfOutput(c,x,y) newx = x + containerLeft return (newx,y)
def callPDFPDTBySameName(self,c,x,y,REQUEST,parent,top,pagenumber): """ Test """ y = y + 40 left = self.getLeft() top = self.getTop() print self.Title() self.pagenumber=pagenumber #skin = self.portal_skins.newspaper_templates skinTool = getToolByName(self, 'portal_skins') #containercontainer = skinTool.newspaper_templates.test.getPhysicalPath() containercontainer = '/opt/development/newholland/press/products/Newspaper/skins/newspaper_templates/'+self.Title() print containercontainer obj = PDFPageTemplate(self.Title(),containercontainer) print "Container: %s" % self.Title() result=obj.continuePDF(c,left,top,REQUEST,self,pagenumber) x = result[0] y = result[1] return (x,y)
def callPDTBySameName(self,REQUEST,parent,top='0',left='0',width='0',height='0',start="",end=""): """ Test """ print "Block" print self.Title() style3="'" containercontainer = '/opt/development/newholland/press/products/Newspaper/skins/newspaper_templates/'+self.Title()+'.pd' result = PDFPageTemplate(self.Title(),containercontainer) theDiv = self.getDivid() theClass = self.getClass() style2="'" theLeft = self.getLeft() if theLeft is not None: style2 += "left:" style2 += str(theLeft) style2 += "px" style2 += ";" style3 += "left:" style3 += str(theLeft) style3 += "px" style3 += ";" left = theLeft else: left = 0 style2 += "position:relative;" output = "<div style='position:absolute;left:0px;top:" output += str(top) output += "px'><div id='" output += self.getId() output += "' class='" output += "container'" start = "<div class='" start += "name" start += "' onmouseover=" start += '"' start += "this.style.cursor='hand'" start += '"' style3 += "display:none;position:relative;background-color:rgba(0,255,0,0.5);color:red;'" start += " style=" start += style3 start += ">" start += self.getId() start += "</div>" start = "<div style='clear:both;'></div>" output2 = result.continueWEB(REQUEST,parent,containercontainer,start) style2 += "top:" style2 += str(2*int(output2[1])) style2 += "px;" style2 += "'" output += "style=" output += style2 output += ">" output += output2[0] output += "</div><br/>" height = 0 return (output,top,left,width,height)