fix language difference when printing resume

This commit is contained in:
Amruth Pillai
2022-09-15 19:49:57 +02:00
parent 2faa15db5a
commit ec27e5e6ab
12 changed files with 1077 additions and 1129 deletions

View File

@ -8,7 +8,7 @@
"start": "node dist/main"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.159.0",
"@aws-sdk/client-s3": "^3.171.0",
"@nestjs/axios": "^0.1.0",
"@nestjs/common": "^9.0.11",
"@nestjs/config": "^2.2.0",
@ -21,7 +21,7 @@
"@nestjs/serve-static": "^3.0.0",
"@nestjs/terminus": "^9.1.1",
"@nestjs/typeorm": "^9.0.1",
"@types/passport": "^1.0.10",
"@types/passport": "^1.0.11",
"bcryptjs": "^2.4.3",
"cache-manager": "^4.1.0",
"class-transformer": "^0.5.1",
@ -29,7 +29,7 @@
"cookie-parser": "^1.4.6",
"csvtojson": "^2.0.10",
"dayjs": "^1.11.5",
"google-auth-library": "^8.4.0",
"google-auth-library": "^8.5.1",
"joi": "^17.6.0",
"lodash": "^4.17.21",
"multer": "^1.4.4",
@ -41,24 +41,24 @@
"passport-local": "^1.0.0",
"pdf-lib": "^1.17.1",
"pg": "^8.8.0",
"playwright-chromium": "^1.25.1",
"playwright-chromium": "^1.25.2",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.5.6",
"typeorm": "0.3.9",
"uuid": "^8.3.2"
"uuid": "^9.0.0"
},
"devDependencies": {
"@nestjs/cli": "^9.1.1",
"@nestjs/schematics": "^9.0.1",
"@nestjs/cli": "^9.1.3",
"@nestjs/schematics": "^9.0.3",
"@reactive-resume/schema": "workspace:*",
"@types/bcryptjs": "^2.4.2",
"@types/cookie-parser": "^1.4.3",
"@types/express": "^4.17.13",
"@types/lodash": "^4.14.184",
"@types/express": "^4.17.14",
"@types/lodash": "^4.14.185",
"@types/multer": "^1.4.7",
"@types/node": "^18.7.13",
"@types/nodemailer": "^6.4.5",
"@types/node": "^18.7.18",
"@types/nodemailer": "^6.4.6",
"@types/passport-jwt": "^3.0.6",
"@types/passport-local": "^1.0.34",
"prettier": "^2.7.1",
@ -66,7 +66,7 @@
"ts-loader": "^9.3.1",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.0",
"typescript": "^4.8.2",
"typescript": "^4.8.3",
"webpack": "^5.74.0"
}
}

View File

@ -27,6 +27,7 @@ export class PrinterService implements OnModuleInit, OnModuleDestroy {
async printAsPdf(username: string, slug: string): Promise<string> {
const url = this.configService.get<string>('app.url');
const serverUrl = this.configService.get<string>('app.serverUrl');
const secretKey = this.configService.get<string>('app.secretKey');
const page = await this.browser.newPage();
@ -45,7 +46,7 @@ export class PrinterService implements OnModuleInit, OnModuleDestroy {
const pdf = await PDFDocument.create();
const directory = join(__dirname, '..', 'assets/exports');
const filename = `RxResume_PDFExport_${nanoid()}.pdf`;
const publicUrl = `/assets/exports/${filename}`;
const publicUrl = `${serverUrl}/assets/exports/${filename}`;
for (let index = 0; index < resumePages.length; index++) {
await page.evaluate((page) => (document.body.innerHTML = page.innerHTML), resumePages[index]);