diff --git a/src/dbp-signature-lit-element.js b/src/dbp-signature-lit-element.js index 1fe6400f47069686cd5c405dbe3f5d339afe7c44..223a2ec7d2ecbda05132eb0e828e6416bc78cad5 100644 --- a/src/dbp-signature-lit-element.js +++ b/src/dbp-signature-lit-element.js @@ -200,7 +200,7 @@ export default class DBPSignatureLitElement extends DBPSignatureBaseLitElement { const organizationNumber = (annotation.organizationNumber || '').trim(); const value = (annotation.value || '').trim(); - if (annotationType === '' || organizationNumber === '' || value === '') { + if (annotationType === '' || value === '') { return; } diff --git a/src/utils.js b/src/utils.js index 3a3ad8ebe559c2b81d478071ea23feb55d676bd8..16dc508e811fdb45fe98af7791a5c6d750709ee8 100644 --- a/src/utils.js +++ b/src/utils.js @@ -192,7 +192,7 @@ export const addKeyValuePdfAnnotationsToAnnotationFactory = (annotationFactory, value = value.trim(); // don't annotate if key or value are empty - if (annotationType === '' || organizationNumber === '' || value === '') { + if (annotationType === '' || value === '') { return annotationFactory; } @@ -202,8 +202,9 @@ export const addKeyValuePdfAnnotationsToAnnotationFactory = (annotationFactory, annotationFactory = addPdfAnnotationToAnnotationFactory(annotationFactory, author, content); // add machine readable annotation + const organizationNumberContent = organizationNumber !== '' ? '_' + organizationNumber : ''; author = 'Maschinell aufgebracht, bitte nicht entfernen / Applied automatically, please do not remove'; - content = 'dbp_annotation_' + annotationType + '_' + organizationNumber + '=' + value; + content = 'dbp_annotation_' + annotationType + organizationNumberContent + '=' + value; annotationFactory = addPdfAnnotationToAnnotationFactory(annotationFactory, author, content); return annotationFactory;