Thank you so much for your help! I am finally able to install pdftk. I have a question about how to send pdf to browser directly.
my code is here: pdf_output = `pdftk #{filename} fill_form #{fdf.path} output` respond_to do |format| format.pdf do send_data pdf_output, :filename => filename, :type => "application/pdf" end end But the browser can not open the pdf. It says it is empty. What is the correct way to do this? Craig White wrote: > On Wed, 2010-03-10 at 22:24 +0100, John Wu wrote: >> Thanks for the response. >> >> I want to narrow down the problem. It seems to me that rjb can not load >> iText even though I installed pdf-stampers as a gem. >> >> I have looked at prawn but it doesn't have the features I wanted. There >> is a bug about installing pdftk on snow leopard. > ---- > seems to me that my original suggestion was by far the easiest solution > and didn't require rjb, java or itext. It simply required a class for > Fdf and a web server somewhere (could even be the 'public' directory on > your rails server) to serve up the PDF document which is dynamically > loaded when the end user opens the FDF document. > > I didn't know that pdftk wasn't an option on Macintosh but I am not a > Macintosh fan so I'm not going to lose any sleep over it. Now that I > think about it, pdftk also requires itext so I am wondering if the > problem with pdftk running on your Macintosh is getting itext to run. > What I do recall was that pdftk was entirely useful to me because once I > could assemble and disassemble PDF's and FDF's, it all became clear to > me. > > pdf-stamper requires a functional rjb which means that you must have a > working ruby/java bridge connection and I suspect that is one of your > issues. Also, it seems to me that there is no reason to put any part of > itext or rjb in your lib/ directory and it might make matters worse. > > Craig > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.