I am using pdfkit to generate a pdf file in Node JS, but I am having trouble to display an image. The image is in the same folder as my Node javascript file, but it keeps telling me "no such file or directory".
I tried all the following:
doc.image('./Logo.png');
doc.image('/Logo.png');
doc.image('Logo.png');
What am I missing here?
I tried using
pdf.image('./img.png')and it never worked. But when i triedpdf.image('rootDirectory/Subfolder/img.png'), it worked.Hope this helps.