'PSPDFKIT adding stamps to each page

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?



Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Miguel Calderón