# Create image stamp annotations getting internal server error

**URL:** <https://pdfjs.community/t/create-image-stamp-annotations-getting-internal-server-error/115>\
**Category:** Technical Support\
**Created:** [July 7, 2020, 5:03am UTC](https://pdfjs.community/t/create-image-stamp-annotations-getting-internal-server-error/115 "2020-07-07T05:03:39Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jithinkp](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@jithinkp](https://pdfjs.community/u/jithinkp)\
**Post date:** [July 7, 2020, 5:03am UTC](https://pdfjs.community/t/create-image-stamp-annotations-getting-internal-server-error/115/1 "2020-07-07T05:03:39Z")

</div>

I want to add image stamp for 6 pages of pdf in a single click.I tried below method to add stamp but i got “Internal server error”.

```
instance.setHeaderItems(function(header) {
            header.push({
                type: 'actionButton',
                img: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m0 0h24v24h-24z" fill="none"></path><path d="m21 19v-14c0-1.1-.9-2-2-2h-14c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-12.5-5.5 2.5 3.01 3.5-4.51 4.5 6h-14z"></path></svg>',
                onClick: function() {

                    var pages=docViewer.Pq.length;
                    onSavetwo();
                    async function onSavetwo() {

                        for (i = 1; i <= pages; i++) {
                            var stampAnnot = new Annotations.StampAnnotation();
                            stampAnnot.PageNumber = i;
                            stampAnnot.X = 100;
                            stampAnnot.Y = 250;
                            stampAnnot.Width = 275;
                            stampAnnot.Height = 40;
                            stampAnnot.ImageData = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB.....';
                            stampAnnot.Author = await annotManager.getCurrentUser();

                            annotManager.addAnnotation(stampAnnot);
                            annotManager.redrawAnnotation(stampAnnot);
                        }

                    }

                }
            });
        });

```

 ![Annotation 2020-07-07 103123](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ff415bd3396c7d3234d3dffb2bc78db70c9a5d27.png)

The below pdf i have used

[pdf](https://wetransfer.com/downloads/93069331bcf43e2f741698b240a134e920200707050805/0f9013644d27982da8fab73672aa485920200707050823/15cb39)

I have tried first two pages image stamp annotations it is working morethan 3 page pdf getting this error.Please help.

---

_[View the full topic](https://pdfjs.community/t/create-image-stamp-annotations-getting-internal-server-error/115)._
