diff --git a/src/frontend/app/viewer/document-viewer.component.ts b/src/frontend/app/viewer/document-viewer.component.ts index e65a9671fffff4ac8712edd93974e709fabaa7d4..9704b32b809d8fe1f052fa13cbfe5bd92c81a32b 100755 --- a/src/frontend/app/viewer/document-viewer.component.ts +++ b/src/frontend/app/viewer/document-viewer.component.ts @@ -691,11 +691,12 @@ export class DocumentViewerComponent implements OnInit, OnDestroy { this.requestWithLoader(`../rest/resources/${resId}/content?mode=base64`).subscribe( (data: any) => { if (data.encodedDocument) { + const fileToDownload: string = !this.file.subinfos.signedDocVersions ? 'originalContent' : 'content'; this.file.contentMode = 'route'; this.file.name = `${data.filename}`; this.file.format = data.originalFormat; this.file.signatoryId = data.signatoryId; - this.file.content = `../rest/resources/${resId}/originalContent?mode=base64`; + this.file.content = `../rest/resources/${resId}/${fileToDownload}?mode=base64`; this.file.contentView = `../rest/resources/${resId}/content?mode=base64`; this.file.src = this.base64ToArrayBuffer(data.encodedDocument); this.loading = false; @@ -1342,4 +1343,4 @@ export class DocumentViewerComponent implements OnInit, OnDestroy { ).subscribe(); }); } -} \ No newline at end of file +}