TypeError: wrong arguments, pass 1 argument which is a valid index in the array

312 views Asked by At

First of all, I have filled the form with hummusjs(https://github.com/galkahana/HummusJS) then I need to remove editable fields or we can say lock form. When I'm doing this but it throws error TypeError: wrong arguments, pass 1 argument which is a valid index in the array.

const pdfWriter2 = hummus.createWriterToModify(source, {
  modifiedFilePath: target,
  log: __dirname + "/logs.txt",
});

lockForm(pdfWriter2)
pdfWriter2.end();
1

There are 1 answers

1
mkamranhamid On

maybe you want to use the below code with log property

var pdfWriter = hummus.createWriter(__dirname + 
'/output/BasicPNGImagesTest.pdf',{log:__dirname + '/output/BasicPNGImagesTest.log'});

the code you showed don't take any log property

var pdfWriter = hummus.createWriterToModify(__dirname + 
'/TestMaterials/PDFWithPassword.PDF', {
            modifiedFilePath: __dirname + '/output/PDFWithPasswordModified.pdf',
            userPassword: 'user'
        });