Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.post('/', function(req, res) {
- console.log("post request detected");
- let pdfParser = new PDFParser(this, 1);
- pdfParser.on("pdfParser_dataError", function(errData) {
- console.error(errData.parserError)
- });
- pdfParser.on("pdfParser_dataReady", function(pdfData) {
- fs.writeFile("./public/data.json", JSON.stringify(pdfData));
- });
- //so here I have to pass the path of the file, now i wrote it manually to test
- pdfParser.loadPDF("C:\Users\Lenovo\Downloads\schedule.pdf");
- });
- <input type="file" id="file"/>
- <input class="btn btn-primary" ng-click="fileSubmit()" type="submit" value="submit"/>
- $scope.fileSubmit = function() {
- //here it work when i write it manually :)
- $http.post('/', "C:\Users\Lenovo\Downloads\Personal Schedule.pdf");
- };
Add Comment
Please, Sign In to add comment