These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Javascript Compatibility between PDF and HTML

leithfx
Registered: Dec 6 2007
Posts: 28

Hi guys,

I am creating PDF forms which i would like to have rendered as either PDF or HTML. I have some pretty complex javascript in my form already, and as it stands lets just suffice to say that it breaks in many different ways when I render as HTML.

One of the major premises of my pdf "application" is hiding and showing pages based on how the user interacts with the form. What I need to know is, what is the proper way to script in LiveCycle so that my javascript will work when rendering in HTML?

I tried xfa.resolveNode("whatever").presence = "hidden"; to no avail. Also, xfa.host.whatever.presence = "hidden";

Is there a reference document that could help me syntactically fix my code so that HTML pages will have working javascript?

Thanks,
Andrew

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Forget it, the JavaScript is not compatible, the dynamic forms format is not compatible, etc. You need completely different code for each. You'd have to write different functions for everything and then call the correct one based on the format. But I don't event know if this would work.

If you really need this, then it's better to develop each separately.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

leithfx
Registered: Dec 6 2007
Posts: 28
Wow. Why do they offer to render it in HTML then anyway? Only for simple forms?

I managed to do what I needed by sticking to the xfa.host family of functions, but you're right, it was very limited, and it came down to many workarounds to get things to work. I was going into using Livecycle under the impression it could handle the work of making my form both PDF and HTML, but I guess i was wrong.

Oh well, just another item on the list of the many shortcomings I've come across using this product.

Andrew