-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Sorry to bother with this, but I can't seem cat wrapper to work. Combining the format shown here:
cat(pdf, start, end, callback)
with the pdftk documentation for cat has gotten me nowhere as they seem like totally different syntaxes.
I've searched and searched and tried passing in the pdfs I want to catenate in a multitude of different ways, adjusting based on the vague errors that come back. All I eventually achieved was a call that didn't spit out any errors, but didn't do anything either.
I initially tried:
PDFTK.cat(A.pdf, B.pdf, Out.pdf, function(err, stdout, stderr){}
But got errors about combinations of digits and text in range. Eventually found that only by putting numbers in start and end could I get rid of those errors. I tried using end or "end" for the end of the range, since it would nice to not always have to know the exact page length of the pdf file. But it didn't like that.
So, in the end all I came up with to not get errors was:
PDFTK.cat(A.pdf, 1, 100, function(err, stdout, stderr) {}
Which of course does nothing since it only uses a single pdf, doesn't take any more to catenate together, nor a path or filename for the catenated file to output to.
Optimally, what I'd like to be able to do is input an array of pdf files and join them together. If that's not possible, just being able to join 2 pdf files together would be enough, as I could just keep feeding the output file back in and joining more pdfs onto the end of it.
Would greatly appreciate any help getting this figured out. I'm sure I'm just not grasping the concept/syntax, so an example of the syntax to join 2 pdfs together should get me sorted.