jjwilly16 / node-pdftk

A wrapper for PDF Toolkit with streams and promises.
MIT License
139 stars 33 forks source link

`spawn ENAMETOOLONG` when trying to process too many files or files with long pathes #5

Closed goraSi closed 6 years ago

goraSi commented 6 years ago

I've got an error Fatal error: spawn ENAMETOOLONG when trying to process too many files or files has too long pathes.

Is it possible to implement same solution as here to use stdin:

https://github.com/dbushell/grunt-svg2png/pull/25/commits/e5f57c7bf1c9e498f9fac78ad0f39f05870d2a0a

jjwilly16 commented 6 years ago

I'd like to look into this, but probably won't have time until after the holidays. I'll update this hopefully next month sometime.

In the meantime, feel free to submit a pull request if you have this implemented.

jjwilly16 commented 6 years ago

This is a common Windows filesystem limitation: https://support.microsoft.com/sv-se/help/830473/command-prompt-cmd--exe-command-line-string-limitation.

I considered your suggested solution, but ran into a road block there. In the PdfTk docs it states that you can pass a single PDF into PdfTk via stdin. Since it is very common to pass in multiple source PDFs with this tool, it doesn't look possible to pass them through stdin.

It looks like you may have to batch your files into the tool. Sorry I couldn't be of more help.