public List <StampAnnotation> GetAppearance(OfdReader ctx, AtomicSignId idProvider) { // 解析OFD页码获取页面对应的ID string id = string.Empty; //ctx.getPageObjectId(page).ref (); StampAnnotation annotation = new StampAnnotation(null) { Id = idProvider.IncrementAndGet(), Boundary = (new StBox(Tlx, Tly, Width, Height)), PageRef = string.Empty }; List <StampAnnotation> res = new List <StampAnnotation>(1) { annotation }; return(res); }
public List <StampAnnot> GetAppearance(OfdReader ctx, AtomicSignId idProvider) { // 解析OFD页码获取页面对应的ID string id = string.Empty; //ctx.getPageObjectId(page).ref (); StampAnnot annotation = new StampAnnot() { Id = idProvider.IncrementAndGet(), Boundary = $"{Tlx} {Tly} {Width} {Height}", PageRef = string.Empty }; List <StampAnnot> res = new List <StampAnnot>(1) { annotation }; return(res); }
public List <StampAnnotation> GetAppearance(OfdReader ctx, AtomicSignId idProvider) { throw new NotImplementedException(); //// 总页码数 //int numPage = ctx.getNumberOfPages(); //List<StampAnnot> res = new ArrayList<>(numPage); //if (side == Side.Right || side == Side.Left) //{ // // 按页码平分印章图片 // double itemWith = this.width / numPage; // for (int i = 0; i < numPage; i++) // { // Page page = ctx.getPage(i + 1); // ST_Box pageSize = ctx.getPageSize(page); // double x; // ST_Box clip = null; // if (side == Side.Right) // { // x = pageSize.getWidth() - itemWith * (i + 1); // clip = new ST_Box(i * itemWith, 0, itemWith, this.height); // } // else // { // x = 0 - itemWith * (numPage - 1 - i); // clip = new ST_Box((numPage - 1 - i) * itemWith, 0, itemWith, this.height); // } // double y = pageSize.getHeight() / 2 - this.height / 2; // ST_RefID ref = ctx.getPageObjectId(i + 1).ref (); // StampAnnot annot = new StampAnnot() // .setID(idProvider.incrementAndGet()) // .setBoundary(new ST_Box(x, y, this.width, this.height)) // .setPageRef(ref) // .setClip(clip); // res.add(annot); // } //} //else //{ // double itemHeight = this.height / numPage; // for (int i = 0; i < numPage; i++) // { // Page page = ctx.getPage(i + 1); // ST_Box pageSize = ctx.getPageSize(page); // double x = pageSize.getWidth() / 2 - this.width / 2; // double y; // ST_Box clip = null; // if (side == Side.Bottom) // { // y = pageSize.getHeight() - itemHeight * (i + 1); // clip = new ST_Box(0, itemHeight * i, this.width, itemHeight); // } // else // { // y = 0 - itemHeight * (numPage - 1 - i); // clip = new ST_Box(0, (numPage - 1 - i) * itemHeight, this.width, itemHeight); // } // ST_RefID ref = ctx.getPageObjectId(i + 1).ref (); // StampAnnot annot = new StampAnnot() // .setID(idProvider.incrementAndGet()) // .setBoundary(new ST_Box(x, y, this.width, this.height)) // .setPageRef(ref) // .setClip(clip); // res.add(annot); // } //} //return res; }