Fill a PDF form with input tables - javascript

I have a PDF file with two kinds of fields: simple text box and drop-down menus with a list of choices. I also have separate plain text tables with information to fill those fields. Ideally, I would like to take this PDF with the fields empty and fill it according to the information I have in the tables.
Therefore, I was wondering if someone can help me to try to solve this problem or at least point me in the right direction. The closest thing that I have found as a solution is to write a javascript that fills the PDF. However, I am afraid that I am not familiar with modifying PDFs nor javascript, and without a clear example it would be difficult for me to understand what is going on. I am familiar with python and R so if anyone knows a solution using those that would be great (I am okay learning new stuff too!).
One last note, the PDF does not come from me, I am trying to avoid copy-pasting work for my colleagues. The tables do come from me so I can modify them as I please.
Thanks.

Related

copy text from excel file and paste in browser

I have this working using html table and javascript. i thought it was a one off but now other departments within the company want to use it. i need to make something the user can alter as they please, the way it is now the comments are hard coded (i know a really bad idea). I was thinking about excel but not everyone has it. So Im down to the idea of a text file.
Sample of the html as it is no looks like this:
The label describing the comment and then the text of the comment next to it on one row of the table.
Comment 1 This is the text to copy
Ive tried to find a similar solution but cant find what Im looking for. If anyone has a idea please post. Thanks.

jQuery DataTables altEditor issue

I've been trying to get this free alternative editor I found here to work but it keeps on blowing up on me because I am terrible at javaScript. Been debugging, reading documentations like mad all day but my scrub mind is out of ideas but I'm still trying anyway.
I deleted some of the stuff it had in there like ajax to server,the ID row, because I don't need those, I just want to be able to insert, edit, and delete rows in the table while keeping the <option> dropdown and pattern validation.
I prepared a jsfiddle with my exact setup here. Any hints/help will be greatly appreciated.
Managed to figure it out myself.
This jsfiddle is an updated version that works.
This diff shows the modifications I made compared to the original.
What is the point you ask?
The point is to be able to validate stuff before adding/editing them, to have a neat dropdown select, and to be able to send the data from the table itself as a JSON string in a "Column Name" : "Cell Data" format so that I can json_decode($_POST['table'] and use a nice associative array to add the data to my database.
Why?
Beats me, do what you want with it. I plan to use it to send a list of addresses one way only to the server.
Why not use the official editor?
Because I can't justify the price for my meaningless project and I hardly need 10% of what it offers.
Big thanks to Kingcode.com where I found the free datatables editor alternative and KasperOlesen for making it more awesome.

How to add a "select file" button that saves an image in a mongodb collection for a meteor project

I've made a form for a project I'm working on and in it there's the tipical text inputs: "First Name", "Last Name", "Address" etc, etc... but there's a problem I'm facing and it's due to my lack of knowledge in Meteor and maybe HTML and Javascript too... I tried searching in other places but I didn't seem to find exactly what I'm looking for.
Anyways what I'm looking for is a way to make that when a user clicks on a button it pops up a window that lets the user select an image from his or her computer and then it will be saved in a mongodb collection. It also has to show inside this form in a small image.
I tried looking, and so far I've found that the HTML has the "input" tag with the "file" attribute that makes the pop-up window I want, my problem is what do I do from there? How do I link the event the user inputs and save the image into a mongodb collection?
I know this might sound really silly, I've seen many webpages and what not that have this kind of things... I'm really new at learning to code, and I really want to learn. So thank you for any help I can get.
There are 2 packkages on atmosphere you could use
https://atmospherejs.com/vsivsi/file-collection
https://atmospherejs.com/jalik/ufs
I have used the first of these successfully on several projects now, and recommend it. File uploading is fiddly in any environment, but they come with examples and documentation, so it's quite possible to be successful.
See if these solutions solve your problem:
https://atmospherejs.com/yogiben/autoform-file
or
http://collectionfs.github.io/Meteor-CollectionFS/

How to write a twitter-like RichText box for mentioning entities?

After weeks of trying and testing to find a solution for my needs I admit that I still have no idea how I can solve this problem.
It sounds simple: I want that a user is able to mention things in a text area similar to twitter.
The problem is that I can't seem to manage it to make it work. Every browser has its own specialties which are coming into my way and break things. I have tried multiple different attempts but none of them worked even on a single browser completely.. mixing text and HTML appears to be incredibly hard to do.
So here I am. Asking you guys for any kind of help. Whether it's a library you can recommend me that is already doing what I need here, or if you did something similar and can tell me what exactly you did to make this work on multiply browsers.
My current solution looks something like this: Hitting # will insert a input text field into a div contenteditable everything is working nice so far unless the whole thing is the first element of a row. If the caret is also at position 0 and the user hits Enter, then something dies inside the browser which removes the whole input box without further notice or any events - at least not on Chrome. That was the most promising solution that I was able to come up with. Don't think I didn't try to save it by inserting e.g. a native Text with a zero-whitespace-character but that doesn't work either. It works better - but not completely.
I'm really frustrated by now and this is holding my whole project back which has this key feature that has to work properly - mainly because the information put there is going to be persisted as XML but that is a completely different story.
I really hope somebody can help me to get a solution for this. Bear in mind that I am actually using GWT 2.8.0 but I would not mind to use/wrap a JavaScript library at this point ..

Change data in PDF from HTML/JS

I want to change text in my PDF document from webpage. It will be some sort of diploma. I have large illustration and the text on it. There will be two empty rows - "Name" and "Date". I wonder if there's a way to change the "name" on pdf? I know, that there is an interactive PDF, but i dont know how to instert variables to the document from HTML. Anyone can help me?
Or perhaps you know better way to do this? I have two variables from JS or from Cookies (date and name), and want to generate a diploma. I have that illustration, fancy font and text. I was trying to do that with generating PDF from HTML, but it was problem with parsing a giant picture, and it was trying to open a pop-up, but I cant do this like that. It must be on same page or new tab.
I think what you want to do is creating a new pdf, inserting the template and name and stuff. But I do not think it is possible with Javascript alone, but with an ajax call to your server. PHP for example got TCPDF library which is relatively easy to use.

Categories