Hi all,
I'm writing an angular7 project and I want to save an svg as PDF.
I'm trying to use pdfkit in a very basic use case. I have an SVG that i'm trying to export to pdf. For some reason I keep getting the following error:
"Cannot read property 'prototype' of undefined".
The error appears to arise from the 'reference.js' file. The issue starts at line 19:
extend(PDFReference, superClass);
and and error is throw because superClass is undefined at line 11 at this assignment:
... ctor.prototype = parent.prototype ...
What is causing this issue? I've tried many things but nothing seems to help and I couldn't find anything to help with this issue online. Any help will be appreciated!
Here is my package.json file:
{
"name": "svgToPdfTest",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"browser": {
"fs": false,
"stream": false,
"zlib": false
},
"private": true,
"dependencies": {
"@angular/animations": "~7.1.0",
"@angular/common": "~7.1.0",
"@angular/compiler": "~7.1.0",
"@angular/core": "~7.1.0",
"@angular/forms": "~7.1.0",
"@angular/platform-browser": "~7.1.0",
"@angular/platform-browser-dynamic": "~7.1.0",
"@angular/router": "~7.1.0",
"apexcharts": "^2.4.1",
"core-js": "^2.5.4",
"rxjs": "~6.3.3",
"svg-to-pdfkit": "^0.1.7",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.11.0",
"@angular/cli": "~7.1.0",
"@angular/compiler-cli": "~7.1.0",
"@angular/language-service": "~7.1.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.6"
}
}
Hi all,
I'm writing an angular7 project and I want to save an svg as PDF.
I'm trying to use pdfkit in a very basic use case. I have an SVG that i'm trying to export to pdf. For some reason I keep getting the following error:
"Cannot read property 'prototype' of undefined".
The error appears to arise from the 'reference.js' file. The issue starts at line 19:
extend(PDFReference, superClass);and and error is throw because superClass is undefined at line 11 at this assignment:
... ctor.prototype = parent.prototype ...What is causing this issue? I've tried many things but nothing seems to help and I couldn't find anything to help with this issue online. Any help will be appreciated!
Here is my package.json file:
{
"name": "svgToPdfTest",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"browser": {
"fs": false,
"stream": false,
"zlib": false
},
"private": true,
"dependencies": {
"@angular/animations": "~7.1.0",
"@angular/common": "~7.1.0",
"@angular/compiler": "~7.1.0",
"@angular/core": "~7.1.0",
"@angular/forms": "~7.1.0",
"@angular/platform-browser": "~7.1.0",
"@angular/platform-browser-dynamic": "~7.1.0",
"@angular/router": "~7.1.0",
"apexcharts": "^2.4.1",
"core-js": "^2.5.4",
"rxjs": "~6.3.3",
"svg-to-pdfkit": "^0.1.7",
"tslib": "^1.9.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.11.0",
"@angular/cli": "~7.1.0",
"@angular/compiler-cli": "~7.1.0",
"@angular/language-service": "~7.1.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.6"
}
}