node-html-pdf-sample | Sample application for print pdf | Runtime Evironment library
kandi X-RAY | node-html-pdf-sample Summary
kandi X-RAY | node-html-pdf-sample Summary
Sample application for print pdf from node.js using middleware called 'node-html-pdf' and send it to angular.js client application.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-html-pdf-sample
node-html-pdf-sample Key Features
node-html-pdf-sample Examples and Code Snippets
Print PDF in new window
//inject $scope, $q, $http, $sce to angular controller.
$scope.getPDF = function(){
$scope.loading = true;
var q = $q.defer();
$http.defaults.headers.common['content-ty
var express = require('express');
var http = require('http');
var fs = require('fs');
var bodyParser = require('body-parser');
var pdf = require('html-pdf');
//nunjucks templating
var nunjucks = require('nunjucks');
//html file which you want to con
$ npm install --save express
$ npm install --save body-parser
$ npm install --save html-pdf (main node-html-pdf npm command)
$ npm install --save nunjucks
Community Discussions
Trending Discussions on node-html-pdf-sample
QUESTION
This is a plunker link. I run pdfSample.js
using node, pdfsample.html
is actual data to convert into pdf and generatepdf.html
is used to fetch it .
When i run it, it shows me an error Failed to load Pdf Document
. I reffered this sample. I am not getting any issue why it is not working?
ANSWER
Answered 2017-Dec-15 at 12:31You need to create the blob to the actual data not the response object.
You need new Blob([response.data], {type: 'application/pdf'})
But make sure that when you hit http://localhost:8081/api/printpdf1
you get the pdf and not an error.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-html-pdf-sample
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page