Issue with Image rendering.
See original GitHub issueThanks for the Plugin. It made my work so easy. I am facing only one issue. I have created a pdf for a HTML table and added an image as header. It is working fine. But I have another feature where I need to send the pdf via email. So I am doing the following,
- Create a pdf on the client side side using jspdf and jspdf-autotable.
- Sending it to server (NodeJS) using FormData.
- When I send the image all the elements in the pdf are intact except the header image which is not getting rendered properly.
Clinet side: (AngularJS)
var doc = pdfService.createPdf( ... ); // This steps gives me the pdf in expected format.
var fileName = "Expense_Reporting.pdf";
var uploadData = new Blob([doc.output()], {
type: 'application/pdf'
});
var formData = new FormData();
formData.append("pdf", uploadData, fileName);
var request = new XMLHttpRequest();
request.open("POST", "/mailapi/sendmail");
request.send(formData);
Server Side (NodeJS)
var fs = require('fs');
var formidable = require('formidable');
// other code
form.parse(req, function(err, fields, files) {
mFileName = files.pdf.name;
mFileType = files.pdf.type;
});
form.on('end', function() {
mFilePath = this.openedFiles[0].path;
}
When I open the file it looks as below,
Note: When the same pdf doc is downloaded on client side it working great.
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
image-rendering - CSS: Cascading Style Sheets | MDN
The image-rendering CSS property sets an image scaling algorithm. The property applies to an element itself, to any images set in its other ......
Read more >Image Rendering Issues - Oxygen XML Editor
Problem I encounter image rendering issues in Oxygen XML Web Author . Cause This happens when your documents contain images that are in...
Read more >Rendering issues in Outlook and how to fix them
Background not rendering. Solution: Unfortunately, Outlook 2007 – 2013 does not support background images. If you want the background image to show on...
Read more >iOS11 image rendering issues - css - Stack Overflow
What I am doing is lazyloading a list of images on scroll but randomly some images fail to render. I have tried debugging...
Read more >Unexpected image rendering behavior in the Library module
Solutions to resolve the image display or rendering problems in the Library module in Lightroom Classic CC 7.0.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@simonbengtsson : I found the solution as below from : http://www.codediesel.com/nodejs/processing-file-uploads-in-node-js/
var express = require(‘express’); var app = express(); var fs = require(‘fs-extra’); var http = require(‘http’); var bodyParser = require(‘body-parser’); var util = require(‘util’); var formidable = require(‘formidable’), form = new formidable.IncomingForm();
http.createServer(function(req,res){ if (req.url == ‘/’ && req.method.toLowerCase() == ‘post’) {
var form = new formidable.IncomingForm(); form.parse(req, function(err, fields, files) { res.writeHead(200, {‘content-type’: ‘application/pdf’,“Access-Control-Allow-Origin”: “*”}); res.write(‘received upload:\n\n’); res.end(util.inspect({fields: fields, files: files})); });
}) .listen(3000, function() { console.log(‘Server app listening’); });
With this code, I am able to perfectly save a pdf generated by jsPDF and html2canvas on the server.
how to Generate same autoTable in two different places