wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes trying to populate PDF form fields with JavaScript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "trying to populate PDF form fields with JavaScript" Watch "trying to populate PDF form fields with JavaScript" New topic
Author

trying to populate PDF form fields with JavaScript

Stephen Huey
Ranch Hand

Joined: Jul 15, 2003
Posts: 618
I've got an annoying problem. I'm a server-side Java developer, but I'm trying to work on a solution that needs to run on SalesForce.com's platform, meaning I can't access Java-based PDF-editing libraries unless I want to rely on web services, and in this particular case, it seems like overkill to run a dedicated server just for this bit of functionality. When users download a PDF, I want to fill in the text fields with information they previously entered in webpage form fields. So far, the only way I've seen to do this is to use the JavaScript that Adobe Acrobat supports to access the URL, parse URL parameters and then insert them into the PDF document using JavaScript:

http://forms.stefcameron.com/2006/10/20/using-url-requests-in-pdf-forms/

However, what if your PDF has many fields and the amount of information you need to pass to the PDF exceeds the maximum length of the URL? IE's limit seems to be 2083 characters, and even if you need browsers with higher limits, I've seen suggestions that servers and even proxies and gateways might restrict the length as well. How can you then populate the PDF fields on the client side?

I'm not sure where to begin...have any of your run into this problem? I'm wondering about using AJAX to poll the server for more data and somehow passing that to the browser window containing the PDF, but I'm not sure there's really any way to get from JavaScript functions outside the PDF to JavaScript functions inside the PDF.

Any ideas???

[ June 08, 2007: Message edited by: Stephen Huey ]

[ June 08, 2007: Message edited by: Stephen Huey ]
[ June 08, 2007: Message edited by: Bear Bibeault ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: trying to populate PDF form fields with JavaScript
 
Similar Threads
*display* passed values in webpage form
testing jsp client side validations
Showing dynamic Categories on left pane
seeking tips on posts-deployment tuning for st&p magazine
modeling a complex business form