I'm building a site in which a catalog (of products) is shown and when clicked a Adobe Livecycle generated pdf will be opened. There are a few form fields and when the submit button is pressed, the fields will be submitted to the url http://localhost:3000/pdf-parser.
This file gets all the parameters and can store them in the database. The problem is to identify which user is sending the data via Pdf? This could be accomplished if I could inject some parameter like user_id into the Livecycle pdf file which would get passsed to the http://localhost:3000/pdf-parser so that I can stamp the user.
I googled for this several times but I couldn't get the answer to this as Adobe Livecycle is a new product.
So, can any Rails coder point me in the right direction? Or is this even achievable?
Or is there any other solution to this problem?
If you set any cookies when sending the pdf over to the user (e.g. go ahead and store something inside the controller's session object, e.g. session[:user_id]=1234), does Acrobat send back the cookies alongside the submitted form data? (e.g. is session[:user_id]=1234?) If so, then you have your answer.
I resolved it using the XFA xml file and dotNet custom built renderer library.
Related
I have the following requirement:
We have a page that requires a user to enter some data into a form that consists of various input fields and dropdowns.
Special is, imho, that within this form is a part for fileupload. The user shall there be able to upload some (multiple) files. Then when he/she presses submit at the end of the page, the whole input shall be submitted and written to an object. In this object also the path to the uploaded files must be saved.
I want to achieve the file upload with primefaces' (3.4) component.
Now to my challenge:
The fileUpload requires its own h:form with enctype "multipart/form-data". The other data is within a "normal" .
For me this means that I must place the forms after each other within the page. But the fileUpload component shall be displayed in the middle of the other form.
How can I achieve this?
Any ideas?
Best regards,
Florian
Now to my challenge: The fileUpload requires its own h:form with enctype "multipart/form-data". The other data is within a "normal" . For me this means that I must place the forms after each other within the page.
This makes honestly no sense. I'm not sure how you come up to this conclusion. Perhaps you concluded this based on an incorrect observation of a problem. Perhaps you used the wrong bean scope and encountered null values for all so far entered input and previously uploaded files while processing the form submit. You should be using #ViewScoped if you want the very same bean instance to live as long as you're interacting with the same view by several ajax requests.
You can perfectly put "normal" input fields like <h:inputText> in the very same form with multipart/form-data encoding. With this encoding, the HTTP request is just been sent in a bit different format which allows room for binary content. See also params not getting passed to backing bean for h:commandLink under rich:popupPanel and t:dataList for a detailed background explanation.
See also:
How to choose the right bean scope?
Image not getting updated
Multiple Image upload in primefaces
Unrelated to the concrete problem, I'm not sure how to interpret
In this object also the path to the uploaded files must be saved
but I'd like to note that you can absoutely not rely on the full client side file paths being sent to the server. This would only occur when the IE browser is been used due to a security bug in that browser. You should rather be interested in the file contents in flavor of InputStream or byte[]. You should be autogenerating a (temp) file with an unique name yourself, if necessary based on the sole filename (and make sure that a second uploaded file with coincidentally the same filename doesn't override it). See also How to get the file path from HTML input form in Firefox 3
My app uses Core Data to store 6 attributes for each entry as well as an image. I have several users asking for a feature where they can print out what they've entered. I can export the core data entries to a .csv file, but what about the images? cvs isn't pretty for the common user. They'd have to pull it into a spreadsheet app (if they have one) and play around with it to make it usable. But there's no way to export images into a .csv file.
What I'd really like is a way to push a button and have the app generate a report or a .pdf or something that they can email to themselves, or pull out of iTunes and it'll be formatted in rows with the entries, attributes and the images.
Any ideas? Can anyone point me to something that I can pass my core data attributes (6 text strings and an image) and output them to a pretty .pdf or webpage?
For this requirement, it should be fairly easy to create your own extremely simple HTML templating method.
Pick one sample entity and create a HTML page that formats it the way you want. Replace the actual data from the entity with placeholder text strings that you can search for at run time. Copy this template into your project. When the user presses the button, open the template, merge in the actual data, and save the result as a new HTML file or mail message.
If you want something more flexible, try searching GitHub for "HTML templating" or look at http://mattgemmell.com/2008/05/20/mgtemplateengine-templates-with-cocoa/
I've been researching the best way to implement an application for my brother's business, and have been pretty stumped in terms of how to structure my application. The application will be run on iPad 2's deployed in the field, sometimes without readily available network access (due to spotty cell coverage in the area).
Here is the abstract on what it needs to do:
1) Load a template PDF file (its a contract to sign up for what is basically cable service) that has editable fields, such as:
a) Name b) Street address c) Dates
2) be able to collect a drawn signature (very similar to any credit card app, such as Square, etc), which is then overlaid onto the PDF.
3) Save the PDF, containing drawn signature and other edited fields, as a new file. Then, upload it to a backend server, using the name of the individual and date/time as meta data for sorting into specific folders.
Without this third aspect, an employee would have to spend 30 minutes to 2 hours a day categorizing all of the app submissions, so step number 3 is a pretty important aspect to the development, even though most of the work is outside the realm of objective C. Still, i need to send the PDF file off with as much information attached to it as I can...
I'd appreciate any guidance related to the best course of action in developing this. Are there any open source applications that you guys know of that I can reference to? I have searched Apple's Developer member center and Google to no avail.
How could i implement iText properly here? Is that even the best option?? It does digital signatures as opposed to those drawn with UI Kit...
Sounds like you should have a web service with a database for storing the meta information and the path to the generated PDF with the signature and other entries.
Your app would essentially generate the PDF, make a web service call and insert information such as the client's name, date/time, whatever else you want, and then the name or path of the PDF file. The PDF file would subsequently be uploaded to a designated location with a unique file name to prevent overwriting another PDF. You could formulate the name of the file off of the corresponding Key/Id of the record in the database or you could use a GUID as the filename and for good measure concatenate the EPOCH timestamp when the file was generated. Both approaches should guarantee filename uniqueness. Another possible file name scheme Device UUID+epoch timestamp, many options available.
If you have to actually edit the PDFs, it sounds like a pretty hard requirement. Another approach would be to show the user what they need to see (ie what they have to sign) and then generate the PDF with the signature and fields populated. Since you want to upload it anyway you would probably save yourself headaches if you offload this from the iPad and do it using a remote server (as Chris suggested) generating the PDF as you need it. I've been involved in helping out an iPad app development doing property inspections - it used Docmosis to do the document generation in preview and then in submitted forms. Hope that helps even though it's a few months down the track.
I have a MVC 3 application with Razor. The form is data driven and has a series of testboxes and radio buttons and a file upload control. The textboxes and radiobuttons reside in first form and the upload control is in its own form. If the file is uploaded first then everything is fine. But if say the user fills in the form with the textboxes and radio buttons and then browse's to the file to attach and clicks attach (a submit button) within the 2nd form, the whole page is posted back and all the controls loses their values and its not user intutive. As I am trying to do the file upload and uploading the file on the server as a separate task on the form, I am not able to find any examples on the net for such a scenrio. All I find is people doing form elemnets and file uploads in one subit action. My requirement is such that the file upload is kept seperate so that users can attach files and also remove files which are attached, so only when they are happy do they submit the form. Any pointers welcome.
Here's an approach you could try and which seems adapted to your scenario:
Use AJAX (or Flash/Silverlight/HTML5) in order to upload the file to avoid page reloads. There are many plugins and possibilities out there: plupload, uploadify, jquery form, ..., just pick one that suits you.
When the user uploads the file store it on the server on some temporary location and return an unique id so that later you could fetch this file.
On the client use the id to inject it into a hidden field on the first form (the one that contains all the textboxes and radios).
When the user submits the first form the id of uploaded file will be sent to the server and you will be able to fetch the file that was uploaded.
This approach could also allow you to upload multiple files. Just play with jQuery and manipulate the array of hidden fields (add, remove, ...).
I have an ASP.NET MVC page with multiple file uploads. After a failed post, all the file upload boxes are blanked out. I don't want the user to need to reselect all the uploaded files. Is there a way I can preserve the values in these fields if other fields fail to validate on Post?
I could do the uploads via AJAX, but this would be more complex as I'd need to ensure they were cleaned up if the user decided not to submit the form in the end.
You need to write your upload view so that you can pass default values to the text boxes.
When your user submits the file upload from your upload view, you will have all of the values for the text boxes in your controller method. Then, when your post fails, you can simply pass the values back to your upload view to populate the text boxes, rinse and repeat.
Actually, FireFox does preserve value. But you can't preserve it (set on server) according to http://www.cs.tut.fi/~jkorpela/forms/file.html#value. So I think your best way is AJAX. If you can actually clear the value.
Also, not sure if this will help, but try http://jquery.malsup.com/form/ which does file upload in iframe.
Or let user choose a better browser ;-)