I’m having a similar problem, although I’m getting the error
“PDF::Toolkit::ExecutionError: Error invoking PDFTK” directly when
running Ruby on the command line
When I invoke this script I get the “Error invoking PDFTK”
$ ruby lib/test_pdf_toolkit.rb
/Library/Ruby/Gems/1.8/gems/pdf-toolkit-0.49/lib/pdf/toolkit.rb:556:in read_data': Error invoking PDFTK (PDF::Toolkit::ExecutionError) from /Library/Ruby/Gems/1.8/gems/pdf-toolkit-0.49/lib/pdf/toolkit.rb:279:in reload’
from
/Library/Ruby/Gems/1.8/gems/pdf-toolkit-0.49/lib/pdf/toolkit.rb:227:in
`open’
from lib/test_pdf_toolkit.rb:5
I tried making a symlink from /usr/bin/pdftk to the real pdftk
executable here: /usr/local/bin/pdftk
But still no luck. I’m on Mac OS X 10.5 and I installed PDFTK using the
package installer
(PDFtk - The PDF Toolkit)
I did notice in the readme for PDFTK that it says: “NOTE: The version of
pdftk installed by this package will only work on macs running OS X
10.3.” – I don’t suppose it means it really won’t work on 10.4 and 10.5
and if you like me, on 10.5, you really need to build it using
DarwinPORTS ? (I guess I assumed it work was forward compatible).
I am having the same problem as those above. I am using winxp, ruby 1.91
and pdftoolkit 0.49
Just like the above, if I type the code into irb it works just fine. If
I run it in an IDE(I use netbeans) then it returns the following error:
C:/Ruby19/lib/ruby/gems/1.9.1/gems/pdf-toolkit-0.49/lib/pdf/toolkit.rb:556:in read_data': Error invoking PDFTK (PDF::Toolkit::ExecutionError) from C:/Ruby19/lib/ruby/gems/1.9.1/gems/pdf-toolkit-0.49/lib/pdf/toolkit.rb:279:inreload’
from
C:/Ruby19/lib/ruby/gems/1.9.1/gems/pdf-toolkit-0.49/lib/pdf/toolkit.rb:227:in open' from H:/NetBeansProjects/Beeprocessoradvanced/lib/main.rb:12:in’
Someone PLEASE give me an idea of how to resolve this problem. The worst
part is this code is part of a program that worked only a week ago. I
don’t know what changed but I went back to run the program and got this
error.
Code:
require ‘pdf/toolkit’
require ‘pp’