• Post Reply Bookmark Topic Watch Topic
  • New Topic

trying to populate PDF form fields with JavaScript  RSS feed

Stephen Huey
Ranch Hand
Posts: 618
  • Mark post as helpful
  • send pies
  • 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:


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 ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!