• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

trying to populate PDF form fields with JavaScript

 
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Can you shoot lasers out of your eyes? Don't look at this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic