Solifugus / fpdf-njs

Tool for Generation of PDF files -- converted from Classic ASP version that was converted from PHP version.
MIT License
3 stars 0 forks source link

lib is not defined while trying to add an Image to a PDF #4

Open llaine opened 5 years ago

llaine commented 5 years ago

I'm trying to run the following spinnet :

var FPDF = require('fpdf-njs/fpdf');
var pdf = new FPDF('P', 'px', [180, 297]);
pdf.CreatePDF();
pdf.AddPage();
pdf.Image('../img.jpg', 100, 100);
pdf.Output('F', 'toto.pdf');

but I'm getting the following error while running it

if (!lib.isset(this.images[xfile])) {
^

ReferenceError: lib is not defined

any idea?

( I also have to import FPDF using require('fpdf-njs/fpdf'); otherwise I get a TypeError when I'm trying to new FPDF)

kev0629 commented 4 years ago

did you find a solution about this error ?

llaine commented 4 years ago

@kev0629 Unfortunately not. I ended up using another lib --> https://github.com/tecnickcom/TCPDF