jquery, populate pdf form fields

Any one knows how to populate pdf fields using jquery? I have all of the data on browser and I want to populate values into pdf fields.
I know we can use c#, itextsharp but there is no point for me to use server side language if jquery can do the faster job for me...

Let me know if you know how....
LVL 1
ITsolutionWizardAsked:
Who is Participating?
 
Jim RiddlesConnect With a Mentor Prepress/OMS SpecialistCommented:
I know of several JavaScript libraries that allow you to work with PDFs, however none that I know of that allow working with form fields in PDFs, at least on the client side.  There are a few Node modules that allow you to do this from the server side, however.  One of them is pdffiller: https://www.npmjs.com/package/pdffiller.
0
 
lenamtlCommented:
Hi,

 you can use LocalStorage for this

LocalStorage value will be saved to user browser and then you can read the value from there too.

To set an item in LocalStorage:
localStorage.setItem('key', 'some value');

Open in new window


To read an item from LocalStorage:
var value = LocalStorage.getItem('key');

Open in new window


Using chrome dev tool (right click - inspect) the value will appear under Application tab / LocalStorage
You can set a limit of time or unlimited for LocalStorage
(if you need the info only for a session you can use SessionStorage)

You can also use cookies for this if you prefer...

This is working ok with regular form, so depending how you render the PDF form you are probabaly be able to use the same technique.

I'm using PHP, AJax & Jquery with this PDF library
mPDF https://github.com/mpdf/mpdf
0
 
Jim RiddlesPrepress/OMS SpecialistCommented:
I think the author was asking about filling the PDF form on the client side with jQuery.  Of course, if you are going to use AJAX, you can use any server side solution you like, as the author already alluded to by mentioning C# with iTextSharp, as well as my mention of pdffiller for use with Node.js.

If the author was serious about using a server side solution, I would consider using SyncFusion's excellent PDF library.  Here is a link to their page showing how to use their library with PDF forms from C#:
http://asp.syncfusion.com/demos/reporting/Pdf/Modify%20Documents/Form%20Filling/cs/default.aspx

That said, your solution does not answer the author's question of how to do this without a server side solution.
0
 
Jim RiddlesPrepress/OMS SpecialistCommented:
The answer to the author's question is that it is not currently possible.  The proposed solution offers a server side solution.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.