I'm working with Adobe CEP (it lets developers create windowed extensions for Adobe CC products). I am working on Adobe Illustrator. Is there a way to send the active document (in .ai or .pdf or .png format) in the request body of a HTTP POST request?
Method I've tried:
Save the document using 'app.activeDocument.saveAs' in the user's local folder. In the next step the user needs to add this file in a form field and submit the form. I've followed the steps for the saving process from here
In this method, the user has to do an extra step of adding the file in the form field. It'd be helpful for me if we can send the file directly from the ExtendScript file or from the JS wrapper file on click of a button
Related
We are using the default embedded chrome pdf viewer to display a pdf with form fields. User can easily fill out the form. When done we have to click the download button that allows them to download the form with or without changes.
What we would like to achieve is to have a save button in this component that would fetch the pdf with changes and upload it to the server.
We don't mind adding a library for it, currently finding it hard to find documentation and accessing anything in this embedded pdf viewer.
One thing you could do, is to add a Submit button, which does submit the data (or the form as document, under some circumstances) back to your server. In the latter case, you then could push back the filled form; in the former, you could use an utility to fill the blank form with the data and push that result.
This works as long as the form is not too intelligent (although Chromium has a relatively good PDF viewing component, which understands a bit of Acrobat JavaScript). Otherwise, you better recommend to download the blank form and have it filled out in a good PDF viewer (industry standard for macOS and Windows is Adobe Acrobat Reader). If you need to gather data in this situation, the submit function would be your choice.
what I currently have in place is a button that when clicked, sends the full form via email. The recipient of the pdf can then modify the form. I do not want that. I don't want him to be able to edit the fields afterwards. Do I need JavaSript?
Probably not.
You need to send a different PDF that isn't editable.
If you are generating the PDF using Javascript, then you should consult the docs for your library to see how to remove editable fields.
But if you created the PDF in a more traditional way, such as authoring it in a word processor and then exporting it as a PDF, then you'll need to create a second PDF that doesn't have editable fields.
It sounds like you want to send the person a "finalized" version of the form; this probably means you need to generate this second PDF on demand. That code usually lives on the web server (or in the cloud), and would be written in whatever languages your server supports. If your server is running Node, then you actually would do this with Javascript.
But if it's any other language (I've done this with PHP), you would do the work in that language and then respond with the just-generated PDF, which your web-based JS would then download.
I am AJAX call and when the server (REST service) sends the response it is actually a link to the generated file something like
/project/tmporaryFiles/file.abc
(File extension is also customized) It is just a text file. when I use $window.open then it just opens the text file in the browser and displays the text. I would like to open a saveas dialog box so that user user should be able to save the file instead of viewing it in the browser. I have tried multiple threads of stackoverflow but could not found solution. Most of the solutions are for HTML5 i.e. the download attribute in anchor, I believe this is not available in HTML4x.
One solution I am trying to find is to create a Blob with the response link but that I am unable to do.
Also note the file can be more than 100MB as well based on the data processing and input by the user.
I you want to force the download without using HTML5 download attribute, you will need to set Content-Disposition on response header.
This can be done on server side and not client.
I am working on a web application using asp.net.
One of requirements demands that I open a given pdf file containing form fields, fill the fields like checking the check boxes, selecting the values from the select inputs and entering the text in text boxes etc.
Once the fields are set then I need to submit it to server and save this as a new pdf file or update the same pdf file.
I don't have a submit button in the pdf itself. I need to submit the details to server using a button outside the pdf file.
When you have a file on a server and you serve it to a client, there are two instances of the file: one on the server and one on the client.
The end user can fill out the form on the client, but will need a button on the PDF if you want him to submit the data he entered to the server. This is explained here: Edit pdf embedded in the browser and save the pdf directly to server
Your requirement to have a button outside the PDF is in most cases impossible: it requires establishing communication between the PDF viewer and the browser. This is only possible in a very specific environment: it requires the Adobe Reader plug-in and it won't ever work on Mac. See also PDF hostContainer callback
You need to reconsider the requirement of having a button outside the PDF! I've been working on a similar project where the submit button was added to the form on-the-fly. The button was only visible on the PDF on the client. The client used that button to submit the data.
Once the data is submitted (see Edit pdf embedded in the browser and save the pdf directly to server to find out in which form the data can be transmitted), you can fill out the form on the server-side. This is explained here:
How to fill out a pdf file programatically?
Saving .xfdf as .pdf
... (this is a very common question; a simple search will reveal more answers)
The form on your server is your template. I assume that this template will be served to many different people. If that is true, then you do not want to replace that template with a form that is filled out by the previous user! (This code cause some serious privacy issues.)
If you really want to update the PDF that exists on the server (instead of creating a new copy), you might also want to read the answer to this question: How to update a PDF without creating a new PDF?
I have requirement to load one JSP/HTML5 page in UIWebView. In this page there is link for attachment and on click of that I need to open CameraRoll to select file and then upload it to server. This is same like we do attachment in email. Now problem is from Java Script how do I open CameraRoll? My main query is that is it possible to open CameraRoll from Java Script without calling Native iOS methods. Java Script to open dialog is embedded in JSP/HTML5 page.
Let me know if you find that above information is not enough so I will try to give you more detail. Ultimately I have one page in UIWebView which should work like sending some message to user with attachment from CameraRoll like we do in normal email app.
I searched a lot on net but couldnt find any help on this.
Starting in iOS6, you can access the Media Capture API which allows you to request files from the user via <input type="file" />.
Essentially, all you need to do is include an <input type="file" /> and when the user touches the input, it will open the phone's camera roll.
Once the user has selected the file, you can send the file using the POST form action or AJAX, or use the File API to manipulate the file data on the client side. Check out the HTML Media Capture specification from the W3C for more information on implemention.