c# - Can not apply indexing with[] to an expression of type method group." -
i working itextsharp c#.net , dealing rendertext method getting "can not apply indexing with[] expression of type method group." error in below "chunk location" section. here code:
public virtual void rendertext(textrenderinfo renderinfo) { linesegment segment = renderinfo.getbaseline(); textchunk location = new textchunk(renderinfo.gettext(), segment.getstartpoint(), segment.getendpoint(), renderinfo.getsinglespacewidth()); **"//chunk location:"** debug.print(renderinfo.gettext()); location.posleft =renderinfo.getdescentline().getstartpoint[vector.i1])); //in below 4 lines getting error. location.posright = renderinfo.getascentline().getendpoint[vector.i1]; location.posbottom = renderinfo.getdescentline().getstartpoint[vector.i2]; location.postop = renderinfo.getascentline().getendpoint[vector.i2]; //chunk font size: (height) location.curfontsize = location.postop - segment.getstartpoint()[vector.i2]; //use font name , size key in sortedlist string strkey = renderinfo.getfont().postscriptfontname + location.curfontsize.tostring(); //add font thispdfdocfonts sortedlist if it's not present if (!thispdfdocfonts.containskey(strkey)) { thispdfdocfonts.add(strkey, renderinfo.getfont()); } //store sortedlist index in chunk, can later location.fontindex = thispdfdocfonts.indexofkey(strkey); locationalresult.add(location); }
you need place indexing after method call.
location.posleft =renderinfo.getdescentline().getstartpoint()[vector.i1]; location.posright = renderinfo.getascentline().getendpoint()[vector.i1]; location.posbottom = renderinfo.getdescentline().getstartpoint()[vector.i2]; location.postop = renderinfo.getascentline().getendpoint()[vector.i2];
Comments
Post a Comment