Skip to content

Commit 00bdec9

Browse files
authored
fix: workaround pdf.js issue (#116)
Workaround until we update the dependency.
1 parent 6b92760 commit 00bdec9

File tree

3 files changed

+210
-21
lines changed

3 files changed

+210
-21
lines changed

apps/server/src/utilities/file.service.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class FileService {
110110

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

116116
/**
@@ -160,6 +160,7 @@ export class FileService {
160160
cMapUrl: CMAP_URL,
161161
cMapPacked: CMAP_PACKED,
162162
standardFontDataUrl: STANDARD_FONT_DATA_URL,
163+
isEvalSupported: false,
163164
}).promise;
164165

165166
this.pdfCache.set(conversionFilePath, pdfDocument);

package-lock.json

+206-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fbw-simbridge",
3-
"version": "0.5.2",
3+
"version": "0.5.3",
44
"description": "The simbridge server for FBW addons for various tasks the addons themselves can't achieve",
55
"author": "",
66
"private": false,
@@ -81,7 +81,7 @@
8181
"reflect-metadata": "^0.1.13",
8282
"rimraf": "^3.0.2",
8383
"rxjs": "^7.2.0",
84-
"sharp": "^0.30.3",
84+
"sharp": "^0.32.6",
8585
"skia-canvas": "^0.9.29",
8686
"swagger-ui-express": "^4.3.0",
8787
"systray2": "^2.1.4",

0 commit comments

Comments
 (0)