diff --git a/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts b/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts index 83cab4409..92ae1ba39 100644 --- a/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts +++ b/apps/red-ui/src/app/modules/pdf-viewer/services/pdf-viewer.service.ts @@ -201,13 +201,14 @@ export class PdfViewer { this.fileId = file.fileId; this.dossierId = file.dossierId; + const filename = file?.filename.includes('.pdf') ? file?.filename : `${file?.filename}.pdf`; this._logger.info('[PDF] Loading document...'); await this.runWithCleanup(async () => { const document = await this.documentViewer.getDocument()?.getPDFDoc(); await document?.lock(); - this.#instance.UI.loadDocument(blob, { documentId: file.fileId, filename: file?.filename ?? 'document.pdf', onError }); + this.#instance.UI.loadDocument(blob, { documentId: file.fileId, filename: filename ?? 'document.pdf', onError }); }); }