Reputation: 35
I need to generate a PDF with an image in the background. To generate the PDF I'm using jsReport.
I'm using the HTML tag image <img src="Content/img/boleta2.png" />
and this is working great, because when I open this in Firefox, the image shows up.
But when I generate the PDF, only shows the HTML without any image.
In the official page http://jsreport.net/learn/images it says something like "To upload an image you can use simple http POST...." But I don't understand this very well.
Upvotes: 2
Views: 3144
Reputation: 3095
Content/img/boleta2.png seems like a relative path to somewhere. In every case jsreport has no idea what is the full path.
You can use html base tag to specify the root path http://www.w3schools.com/tags/tag_base.asp Or you can use full path directly in the img src.
The image extension is used for uploading images directly into the jsreport storage where it can be later referenced. Image is uploaded usually from html jsreport studio, the mention about http POST is about using API what is an advanced use case you probably don't struggle with right now.
Upvotes: 2