fix(annotation): invoke sigature background creation to fix z-index problem

This commit is contained in:
tekh 2025-09-23 19:25:09 +02:00
parent a1f4898c35
commit b5d744c1cd

View File

@ -2,12 +2,12 @@
async function createAnnotations(document) {
const signatures = [];
for(var element of document.elements) {
for (let element of document.elements) {
const annotParams = await getAnnotationParams(element.left, element.top);
const page = element.page - 1
//#region background
if(annotParams.background){
if (annotParams.background) {
let background = annotParams.background;
const id_background = PSPDFKit.generateInstantId();
const annotation_background = new PSPDFKit.Annotations.WidgetAnnotation({
@ -22,18 +22,23 @@ async function createAnnotations(document) {
borderWidth: background.borderWidth,
borderColor: background?.borderColor ? new PSPDFKit.Color(background.borderColor) : null
});
const formFieldBackground = new PSPDFKit.FormFields.ButtonFormField({
name: id_background,
annotationIds: PSPDFKit.Immutable.List([annotation_background.id]),
value: "",
readOnly: false
readOnly: true
});
signatures.push(annotation_background)
signatures.push(formFieldBackground)
}
//#endregion
}
for (let element of document.elements) {
const annotParams = await getAnnotationParams(element.left, element.top);
const page = element.page - 1
//#region signatures
const id = PSPDFKit.generateInstantId()