Skip to content
Snippets Groups Projects
Unverified Commit 4c8b205a authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Fix adding annotations without organization to PDFs (#37)

parent a0a3d46d
No related branches found
No related tags found
No related merge requests found
Pipeline #18876 passed
...@@ -200,7 +200,7 @@ export default class DBPSignatureLitElement extends DBPSignatureBaseLitElement { ...@@ -200,7 +200,7 @@ export default class DBPSignatureLitElement extends DBPSignatureBaseLitElement {
const organizationNumber = (annotation.organizationNumber || '').trim(); const organizationNumber = (annotation.organizationNumber || '').trim();
const value = (annotation.value || '').trim(); const value = (annotation.value || '').trim();
if (annotationType === '' || organizationNumber === '' || value === '') { if (annotationType === '' || value === '') {
return; return;
} }
......
...@@ -192,7 +192,7 @@ export const addKeyValuePdfAnnotationsToAnnotationFactory = (annotationFactory, ...@@ -192,7 +192,7 @@ export const addKeyValuePdfAnnotationsToAnnotationFactory = (annotationFactory,
value = value.trim(); value = value.trim();
// don't annotate if key or value are empty // don't annotate if key or value are empty
if (annotationType === '' || organizationNumber === '' || value === '') { if (annotationType === '' || value === '') {
return annotationFactory; return annotationFactory;
} }
...@@ -202,8 +202,9 @@ export const addKeyValuePdfAnnotationsToAnnotationFactory = (annotationFactory, ...@@ -202,8 +202,9 @@ export const addKeyValuePdfAnnotationsToAnnotationFactory = (annotationFactory,
annotationFactory = addPdfAnnotationToAnnotationFactory(annotationFactory, author, content); annotationFactory = addPdfAnnotationToAnnotationFactory(annotationFactory, author, content);
// add machine readable annotation // add machine readable annotation
const organizationNumberContent = organizationNumber !== '' ? '_' + organizationNumber : '';
author = 'Maschinell aufgebracht, bitte nicht entfernen / Applied automatically, please do not remove'; 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); annotationFactory = addPdfAnnotationToAnnotationFactory(annotationFactory, author, content);
return annotationFactory; return annotationFactory;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment