fill-pdf
fill-pdf copied to clipboard
ENOENT on generatePdf
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.
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.
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
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
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