Changed PdfFile.filename to exclude file extensions. Other naming fixes

This commit is contained in:
Saud Fatayerji
2023-11-16 02:24:10 +03:00
parent 667583984f
commit 576b0e02f6
11 changed files with 108 additions and 83 deletions

View File

@@ -86,8 +86,13 @@ export class PdfFile {
}
constructor(originalFilename: string, representation: Uint8Array | PDFLibDocument | PDFJSDocument, representationType: RepresentationType, filename?: string) {
if (originalFilename.toLowerCase().endsWith(".pdf"))
originalFilename = originalFilename.slice(0, -4);
this.originalFilename = originalFilename;
this.filename = filename ? filename : originalFilename;
if (this.filename.toLowerCase().endsWith(".pdf"))
this.filename = this.filename.slice(0, -4);
this.representation = representation;
this.representationType = representationType;