Skip to content

Images and internal links don't work? #508

Open
@chris-bingham

Description

@chris-bingham

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) {});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions