fill-pdf icon indicating copy to clipboard operation
fill-pdf copied to clipboard

ENOENT on generatePdf

Open alex-mironov opened this issue 5 years ago • 4 comments

I'm facing issue with pdftk on mac. Apparently it cannot generate pdf:

      fillPdf.generatePdf({ name: 'alex' }, `${__dirname}/fixtures/form.pdf`, (err, output) => {
        if (err) {
          console.log(err)
        } else {
          console.log(output)
        }
      })
 { Error: ENOENT: no such file or directory, open '/tmp/119219-94314-hv0ys2.14oi.pdf'
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/tmp/119219-94314-hv0ys2.14oi.pdf' }
Error: ENOENT: no such file or directory, open '/tmp/119219-94314-hv0ys2.14oi.pdf'

pdftk is installed:

 pdftk --version

pdftk 2.02 a Handy Tool for Manipulating PDF Documents
Copyright (c) 2003-13 Steward and Lee, LLC - Please Visit: www.pdftk.com
This is free software; see the source code for copying conditions. There is
NO warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

alex-mironov avatar Mar 19 '19 11:03 alex-mironov

Sorry for the delay. Is this still an issue? Looks like you are trying to read a file from tmp, instead of the one articulated in the first snippet.

ScottONeal avatar Apr 19 '19 23:04 ScottONeal

I still have this same issue, did anyone found a workaround or a fix for this? I'm currently working on ubuntu. And this are my logs: Error in node

{[Error: ENOENT: no such file or directory, open '/tmp/119824-6900-bjjbx2.eenbq.pdf']
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/tmp/119824-6900-bjjbx2.eenbq.pdf' }
(node:6900) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/tmp/119824-6900-bjjbx2.eenbq.pdf'

pdftk installed

pdftk --version

pdftk 2.02 a Handy Tool for Manipulating PDF Documents
Copyright (c) 2003-13 Steward and Lee, LLC - Please Visit: www.pdftk.com
This is free software; see the source code for copying conditions. There is
NO warranty, not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Thanks in advance

nicolaselopez avatar Sep 24 '19 13:09 nicolaselopez

i think that my problem was that i had installed pdftk from snap. To fix this i uninstalled that one and installed this one:

sudo add-apt-repository ppa:malteworld/ppa
sudo apt update
sudo apt install pdftk

nicolaselopez avatar Sep 25 '19 12:09 nicolaselopez

On Ubuntu 18 Server

sudo apt install pdftk

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package pdftk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'pdftk' has no installation candidate

gik000 avatar Dec 29 '20 18:12 gik000