PSPDFKIT adding stamps to each page

151 Views Asked by At

Checking through the trial for using this framework for my client and while I can add a "received" stamp on a single page there doesn't seem to be a way to add a stamp to each page automatically. Does the framework support that without calling the API for each page? Is this better done in the front-end UI?

1

There are 1 best solutions below

0
On

Yes, you need to add the stamp to each page, but it can be done in a single call to instance.create() by passing an array of stamp annotations:

instance.create(
    Array.from({
        length: instance.totalPageCount
    }).map((_, pageIndex) =>
        new PSPDFKit.Annotations.StampAnnotation({
            pageIndex,
            // other annotation properties
        })
    )
)

However, "received" is not a built-in stamp annotation type, so you'll probably have to use image annotations instead.