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

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

View File

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