0

I am writing a Program in Rub On Rails 4.x and I have to take PDF files with defined fields that can be filled out, fill in data from a form submission(This part is DONE!), and lastly allow the user to modify the saved PDF file on the server and overwrite said PDF after making their modifications.

Like I said I have already gotten the PDF files filled out with what has been submitted in the form through pdftk . What I now need to do is provide a server side editing capability to the said PDF files on server generated from the first step of the process.

I have seen similar posts but none wanting to do the same thing I do. If I am wrong links would be great. Thanks in advance for all your help!

The Gugaru
  • 618
  • 6
  • 23
  • Seems like you need to find a Javascript PDF editor you can load your PDF into, allow the user to modify it, and ultimately submit it back to the server. Seems like they exist, here's one [for ASP projects](http://www.radpdf.com)... Somewhat hard to find though. You may want to widen your net a bit to get good responses, this isn't really a Rails or Ruby issue at all. – Nick Veys Jun 05 '15 at 20:51
  • That would be nice but I cannot find one that explicitly states that you can save the pdf's to the server. That is why I posted my question. None clearly state exactly what I want to do so I wanted to see if anyone had any experience in doing this or not. – The Gugaru Jun 05 '15 at 23:31
  • Posted the answer in case anyone needs to same solution or anything close to it. – The Gugaru Jun 07 '15 at 00:14

2 Answers2

0

After lots of digging and research here is what I have found to be the facts surrounding this issue and implementing a program to allow embedding the PDF file, editing it, and saving it back to the server. This process would be great however from what I can tell there is nothing out there that really does this for Ruby On Rails. To quote @Nick Veys

Seems like you need to find a Javascript PDF editor you can load your PDF into, allow the user to modify it, and ultimately submit it back to the server. Seems like they exist, here's one for ASP projects

You are correct but still wrong in the sense that yes there is one for ASP projects however that is Microsoft Based, yes I know that it can run on Linux environments through Mono. However to the point it would appear in this instance that a Ruby On Rails specific solution is indeed needed.

The solution that we have come up with is as follows 1. Use a PDF editing package in the linux repositories like PDFtk 2. You then render a page with the PDF embeded on one side and a form representing the live fields in the PDF to take input. 3. Once submitted you use PDFtk to write the values into a new template PDF file and overwrite what was previously stored.

This requires a few additional steps to process the data than I really care for myself. However it is the best solution that our team could come up with, without bleeding the project budget dry for just 1 piece of functionality.

I hope this helps anyone else looking to do the same thing in Ruby On Rails.

The Gugaru
  • 618
  • 6
  • 23
-2

I have done something like this using my company's .NET product. It can also be done using its Java version too. http://www.gnostice.com/nl_article.asp?id=255&t=Save_Form_Submit_Data_Back_To_Original_PDF_Document_In_NET

enter image description here

gn1
  • 526
  • 2
  • 5
  • This answer is misleading as the OP was looking for a solution in Ruby on Rails, not .NET. – Vadim May 14 '16 at 21:09