ng serve
ng serve
NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/
Date: 2018-03-21T21:31:35.963Z
Hash: 18557726d72714bcba44
Time: 6720ms
chunk {inline} inline.bundle.js (inline) 3.85 kB [entry] [rendered]
chunk {main} main.bundle.js (main) 18.9 kB [initial] [rendered]
chunk {polyfills} polyfills.bundle.js (polyfills) 549 kB [initial] [rendered]
chunk {styles} styles.bundle.js (styles) 41.5 kB [initial] [rendered]
chunk {vendor} vendor.bundle.js (vendor) 9 MB [initial] [rendered]
WARNING in ./node_modules/iconv/build/Release/iconv.node
Module parse failed: Unexpected character '�' (1:0)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
ERROR in ./node_modules/iconv/lib/iconv.js
Module not found: Error: Can't resolve '../build/Debug/iconv.node' in '/Users/nabgilby/Google Drive/Code/Web/testFill/node_modules/iconv/lib'
ERROR in ./node_modules/pdffiller/index.js
Module not found: Error: Can't resolve 'child_process' in '/Users/nabgilby/Google Drive/Code/Web/testFill/node_modules/pdffiller'
ISSUE: I can't do a simple run/build with Angular 5. I spent many hours trying many things but nada
VERSIONS: node@v8.9.4 npm@5.7.1 @angular/cli@1.7.3
STEPS TO RECREATE:
ng new testFill
cd test
npm install pdffiller --save
Edit app.component.ts:
import { Component } from '@angular/core'; import { pdffiller } from 'pdffiller';
@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'app';
sourcePDF = "./test/test.pdf"; destinationPDF = "./test/testJDoe.pdf";
data = { "last_name" : "John", "first_name" : "Doe", "date" : "Jan 1, 2013", "football" : "Off", "baseball" : "Yes", "basketball" : "Off", "hockey" : "Yes", "nascar" : "Off" };
doFill(event) {
pdffiller.fillForm( this.sourcePDF, this.destinationPDF, this.data, function(err) { if (err) throw err; console.log("In callback (we're done)."); });
}
Edit app.component.html:
Welcome to {{ title }}!
Try test pdf
<button (click)="doFill($event)" Test PDF>
Hash: 18557726d72714bcba44 Time: 6720ms chunk {inline} inline.bundle.js (inline) 3.85 kB [entry] [rendered] chunk {main} main.bundle.js (main) 18.9 kB [initial] [rendered] chunk {polyfills} polyfills.bundle.js (polyfills) 549 kB [initial] [rendered] chunk {styles} styles.bundle.js (styles) 41.5 kB [initial] [rendered] chunk {vendor} vendor.bundle.js (vendor) 9 MB [initial] [rendered]
WARNING in ./node_modules/iconv/build/Release/iconv.node Module parse failed: Unexpected character '�' (1:0) You may need an appropriate loader to handle this file type. (Source code omitted for this binary file)
ERROR in ./node_modules/iconv/lib/iconv.js Module not found: Error: Can't resolve '../build/Debug/iconv.node' in '/Users/nabgilby/Google Drive/Code/Web/testFill/node_modules/iconv/lib' ERROR in ./node_modules/pdffiller/index.js Module not found: Error: Can't resolve 'child_process' in '/Users/nabgilby/Google Drive/Code/Web/testFill/node_modules/pdffiller'
webpack: Failed to compile.
Thank you for your consideration.