diff --git a/src/frontend/app/viewer/document-viewer.component.ts b/src/frontend/app/viewer/document-viewer.component.ts
index 5a9e5eebe14bcd5f4a4163f6e2fdf67979853c8f..e00a80b441e759eb5eb22fd5862d3f0dd8949337 100755
--- a/src/frontend/app/viewer/document-viewer.component.ts
+++ b/src/frontend/app/viewer/document-viewer.component.ts
@@ -393,8 +393,8 @@ export class DocumentViewerComponent implements OnInit, OnDestroy {
                 if (data === 'createNewVersion' && this.mode === 'mainDocument') {
                     const objToSend: any = {
                         resId: this.resId,
-                        encodedFile: file.base64,
-                        format: 'pdf',
+                        encodedFile: file.content,
+                        format: data.format
                     };
                     this.http.put(`../rest/resources/${this.resId}?onlyDocument=true`, objToSend).pipe(
                         tap(() => {