I am unable to get images to work in the generated PDF, if i prefix the base value with file:// i get a broken image, otherwise I just get the image alt text.
I have links within the HTML to various elements within the same page, these don't work and are prefixed with the value of the base property.
Any help with images would be greatly appreciated, and is it possible to have internal links?
Heres my code:
var html = fs.readFileSync(htmlName, "utf8");
var options = {
phantomPath: require("phantomjs-prebuilt").path,
base: "file://" + path.resolve(".")
};
pdfFromHtml.create(html, options).toFile(pdfName, function(err, res) {});
I am unable to get images to work in the generated PDF, if i prefix the base value with
file://i get a broken image, otherwise I just get the image alt text.I have links within the HTML to various elements within the same page, these don't work and are prefixed with the value of the
baseproperty.Any help with images would be greatly appreciated, and is it possible to have internal links?
Heres my code: