Skip to content

Commit

Permalink
fix: workaround pdf.js issue (#116)
Browse files Browse the repository at this point in the history
Workaround until we update the dependency.
  • Loading branch information
Saschl authored May 7, 2024
1 parent 6b92760 commit 00bdec9
Show file tree
Hide file tree
Showing 3 changed files with 210 additions and 21 deletions.
3 changes: 2 additions & 1 deletion apps/server/src/utilities/file.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class FileService {

async getNumberOfPdfPages(Directory: string, fileName: string): Promise<number> {
const retrievedFile = await this.getFile(Directory, fileName);
return getDocument({ data: retrievedFile }).promise.then((document) => document.numPages);
return getDocument({ data: retrievedFile, isEvalSupported: false }).promise.then((document) => document.numPages);
}

/**
Expand Down Expand Up @@ -160,6 +160,7 @@ export class FileService {
cMapUrl: CMAP_URL,
cMapPacked: CMAP_PACKED,
standardFontDataUrl: STANDARD_FONT_DATA_URL,
isEvalSupported: false,
}).promise;

this.pdfCache.set(conversionFilePath, pdfDocument);
Expand Down
224 changes: 206 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fbw-simbridge",
"version": "0.5.2",
"version": "0.5.3",
"description": "The simbridge server for FBW addons for various tasks the addons themselves can't achieve",
"author": "",
"private": false,
Expand Down Expand Up @@ -81,7 +81,7 @@
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0",
"sharp": "^0.30.3",
"sharp": "^0.32.6",
"skia-canvas": "^0.9.29",
"swagger-ui-express": "^4.3.0",
"systray2": "^2.1.4",
Expand Down

0 comments on commit 00bdec9

Please sign in to comment.