1

I have process that I want to do that I'm not sure it is possible. I am using iTextSharp to generate and populate a PDF with collected data that a user has entered in a previous screen.

Then the PDF is saved to a SQL Server Database as binary data. Then it is pulled back for the user to view in the browser if they would like too.

It is possible to generate the PDF, do not flatten the form, and then allow the user to edit areas that may have not been prefilled by the users information. Then I will need to be able to save this back to the database.

I have some findings on using a adobe submit button that submits the pdf to a URL that would collect the data, but I want to know if iTextSharp is capable of this. Using ASP.NET or another example.

I do not want to save the form field information, but save the whole pdf to the database with some sort of submit button.

Ian Frees
  • 11
  • 3
  • possible duplicate of [read pdf form data using iTextSharp](http://stackoverflow.com/questions/3367390/read-pdf-form-data-using-itextsharp) – Brad C Jun 17 '15 at 19:21
  • The example provides how to get the field data. I need to be able to save the whole pdf to the database as binary after the user has edited. Need a possible way to run some server side script to take the pdf that is being edited and save it. – Ian Frees Jun 17 '15 at 20:37
  • You'll have to add an upload form so they can re-upload the PDF in your proposed method. The best option would be to have a HTML form that mirrors the fields and use iText to populate it. That way you can ensure the areas are all filled out before even serving the PDF – Brad C Jun 17 '15 at 20:51
  • Thanks. That is what I have been doing but it is a very time consuming process. Was just hoping there was a better way to go about it. – Ian Frees Jun 17 '15 at 21:04
  • You might be able to just create a button on the form that has an action of `PdfAction.SUBMIT_PDF` which if I remember correctly will actually send the entire PDF as-is. However, this action might also only work in Adobe's products, you'll need to test it. – Chris Haas Jun 17 '15 at 22:05
  • If you want to submit the complete PDF, the end user needs Adobe Acrobat. Adobe Reader can only post data as a query string, FDF or XFDF. See my answer to this duplicate question: [Edit pdf embedded in the browser and save the pdf directly to server](http://stackoverflow.com/questions/29113588/edit-pdf-embedded-in-the-browser-and-save-the-pdf-directly-to-server) Note that not all browser plug-in support this functionality. It works with Adobe Reader, but not necessarily with pdf.js, Chrome PDF viewer or Preview. – Bruno Lowagie Jun 18 '15 at 06:22
  • Bruno, you solution is the one I am using now. But your right they need adobe reader installed to use it. Chrome and Firefox PDF readers do not allow for the forms submit buttons to work. – Ian Frees Jun 18 '15 at 13:20

0 Answers0