How to launch pdf javascript controls in java

Hello,
Here is my problem.
We have a pdf (acroform) with controls in javascript on many fields.
We have an xml with data to fill in the acroform.
We made a java program, with the iText lib, to fill the pdf acroform with the xml. It's working fine, except that the javascript control are not launched. So if there is a problem in the xml, the pdf is wronlgy filled in.
Is there a way, to launch the javascript controls in java? What library to use??
Thank you, (sorry if my english is not good).

Yes, it's server-side pb. The thing is, I don't really know what technology / library we can use to deal with this problem.
If you have any idea that coul guide me...

Similar Messages

  • How to manipulate a javascript object in java?

    Hi, I am fiddling with the java scripting interface. As I understand the rhino engine is packaged with the jdk but what I don't understand is how does one reconcile the objects one gets from their engine (e.g. sun.org.mozilla.javascript.internal.ScriptableObject) versus the ones in the rhino api (e.g. org.mozilla.javascript.ScriptableObject)?
    Is the one in the jdk heavily modified or wrappered up to suit their javax.scripting interface?
    More specifically, how do I manipulate javascript objects from java?
    e.g. suppose I have this java code:
    ScriptEngineManager mgr = new ScriptEngineManager();
    ScriptEngine js = mgr.getEngineByName("js");
    jsEngine.eval("var foo = { x : 1, y : 'hello', z : false };");
    Object o = jsEngine.get("foo");Now o is instanceof sun.org.mozilla.javascript.internal.NativeObject, which is a subclass of a bunch of other classes in the s.o.m.j.i namespace. Being internal I can't use these directly.
    Looking at the Rhino API obviously you normally get a org.mozilla.javascript.ScriptableObject and can call the .get() .getIds() methods. But I don't know how to translate the objects I am getting in my actual java code which uses the jdk engine into org.mozilla.javascript objects.
    Is this even possible? Am I misunderstanding something completely? Should I just be using the rhino js jar and not the javax.scripting interface? If so, for what reason is the javax.scripting interface implemented?

    Assuming that you DO want a deep copy, begin with a constructor that takes another hand.
    public Hand( Hand h ) { ...Then for each instance variable, within that constructor:
    this.instVar0 = h.instVar0;
    this.instVar1 = h.instVar1;
    . . .And last, for every reference, make sure there is a constructor (or copy method for arrays) that itself makes a deep copy:
    this.ref0 = new Ref0Type( h.ref0 );

  • How to launch many instances of Sun Java ME Platform SDK 3.0 emulator ?

    Hi all,
    I want to launch two instances of the emulator , how to achieve that ?
    Thank you very much indeed

    Hello,
    Unfortunately it is not possible. We will think about it for next release. Java ME SDK is not supposed to offer full IDE functionality (e.g. changing editor colors), that's why some features are missing. For full IDE support use NetBeans IDE with Mobility support.

  • How to access a javascript variable from Java?

    Here is my code:
    function validateLoginForm() {
        var username = document.getElementById('un');
        setCookie('un', username, 3650);
        //etc.
    <%   
        HttpSession httpSession = request.getSession();
        httpSession.setMaxInactiveInterval(30 * 60); //30 minutes
        httpSession.setAttribute("un", username); //!prob here - cannot resolve 'username'
    %>
    }...but how do I access the javascript variable 'username' from the Java code?
    Thanks,
    James

    The only way to pass values between JavaScript and JSP is through cookies. It sucks, I know, but right now that is the only option.
    You already are creating a cookie in JavaScript. So go ahead and read it in Java:
    Cookie[] cookies = request.getCookies();
    for(int i = 0; i < cookies.length; i++) {
        Cookie c = cookies;
    if (c.getName().equals("un")) {
    // Do what you need here.

  • How to launch MS Word application using java

    HI:
    I'm developing a project using java, but we need to launch Microsoft Word into java based GUI(like Jpanel, or Frame, things like that), could anyone be so kind that give some hints on how to do it?
    thanks!

    I would be pleasantly shocked to find out this is possible. Well, let me retract that. You might, just very, very maybe, be able to use a combination of Windows API and Word's API (either DDE or OLE or ActiveX) to interact with Word. This will involve using a lot of native methods, javah and pre-compiled DLL's written in C or C++.
    But I think you will be completely stuck trying to get the UI to switch to a JPanel. Microsoft would have to have a version of Word independent of the UI (in effect, have designed Word to have a pluggable user interface). They may have done this, but I have never heard of a project where someone successfully swapped out Word's user interface with a custom Swing one.
    - Saish
    "My karma ran over your dogma." - Anon

  • How to  print pdf file by using java print API ? I am trying with this code

    import java.io.FileInputStream;
    import java.io.InputStream;
    import javax.print.Doc;
    import javax.print.DocFlavor;
    import javax.print.DocPrintJob;
    import javax.print.PrintException;
    import javax.print.PrintService;
    import javax.print.PrintServiceLookup;
    import javax.print.SimpleDoc;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.print.attribute.PrintRequestAttributeSet;
    import javax.print.attribute.standard.Copies;
    import javax.print.attribute.standard.MediaSizeName;
    public class PDFPrint {
    static public void print(InputStream inputStream, PrintService printService) throws PrintException {
    Doc doc = new SimpleDoc(inputStream, DocFlavor.INPUT_STREAM.AUTOSENSE, null);
    PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
    attributes.add(MediaSizeName.ISO_A4);
    attributes.add(new Copies(1));
    print(doc, attributes, printService);
    }//print()
    static public void print(Doc doc, PrintRequestAttributeSet attributes, PrintService printService) throws PrintException {
    if (printService == null) {
    printService = PrintServiceLookup.lookupDefaultPrintService();
    System.out.println("The Printer Name is :"+printService.getName());
    DocPrintJob docPrintJob = printService.createPrintJob();
    System.out.println("Before Print Start()");
    docPrintJob.print(doc, attributes);
    }//print()
    public static void main(String args[])
    PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
    String file="c:/BackUp/file.pdf";
    FileInputStream fis=new FileInputStream(file);
    System.out.println("Before Print() called ..");
    print(fis,defaultPrintService);
    System.out.println("After Printing....");
    I am using this code to print pdf file. But when I try this one automatically the printer starting with print ascii codes with infinite loop.
    I am using jdk1.4,Acrobat 8.0, Windows environment.
    Can u help me in this regard'
    Thank u
    grani

    import java.io.FileInputStream;
    import java.io.InputStream;
    import javax.print.Doc;
    import javax.print.DocFlavor;
    import javax.print.DocPrintJob;
    import javax.print.PrintException;
    import javax.print.PrintService;
    import javax.print.PrintServiceLookup;
    import javax.print.SimpleDoc;
    import javax.print.attribute.HashPrintRequestAttributeSet;
    import javax.print.attribute.PrintRequestAttributeSet;
    import javax.print.attribute.standard.Copies;
    import javax.print.attribute.standard.MediaSizeName;
    public class PDFPrint {
    static public void print(InputStream inputStream, PrintService printService) throws PrintException {
    Doc doc = new SimpleDoc(inputStream, DocFlavor.INPUT_STREAM.AUTOSENSE, null);
    PrintRequestAttributeSet attributes = new HashPrintRequestAttributeSet();
    attributes.add(MediaSizeName.ISO_A4);
    attributes.add(new Copies(1));
    print(doc, attributes, printService);
    }//print()
    static public void print(Doc doc, PrintRequestAttributeSet attributes, PrintService printService) throws PrintException {
    if (printService == null) {
    printService = PrintServiceLookup.lookupDefaultPrintService();
    System.out.println("The Printer Name is :"+printService.getName());
    DocPrintJob docPrintJob = printService.createPrintJob();
    System.out.println("Before Print Start()");
    docPrintJob.print(doc, attributes);
    }//print()
    public static void main(String args[])
    PrintService defaultPrintService = PrintServiceLookup.lookupDefaultPrintService();
    String file="c:/BackUp/file.pdf";
    FileInputStream fis=new FileInputStream(file);
    System.out.println("Before Print() called ..");
    print(fis,defaultPrintService);
    System.out.println("After Printing....");
    I am using this code to print pdf file. But when I try this one automatically the printer starting with print ascii codes with infinite loop.
    I am using jdk1.4,Acrobat 8.0, Windows environment.
    Can u help me in this regard'
    Thank u
    grani

  • How to launch an Internet navigator with Java

    In my java interface I would like to make a button which, when we clicked it, launch an internet navigator.
    Is there a function which allows that?
    Is this function platform-dependant?

    hi,
    if you mean in windows you could detect if it is NT (NT meaning NT, 2000 and XP) or not (98, 95, ME):
    try {
         Properties systemProps = System.getProperties();
         String osVersion = systemProps.getProperty("os.name");
             if (osVersion.equals("Windows 98"))     {               
              Runtime.getRuntime().exec("start helpFiles/help.html");
         else {
              Runtime.getRuntime().exec("cmd.exe /c start helpFiles/help.html");
    }catch(IOException err) {
         JOptionPane.showMessageDialog((Component)e.getSource(), "Help File Not Found!", "ERROR!", JOptionPane.ERROR_MESSAGE, new ImageIcon("questionmark.gif"));
    }

  • How to create pdf files dynamically using Java

    I am new to java world. I got a task of generating dynamic pdf files using Java. I have tried with some third party APIs for generating pdf. But most of them are not so feasable. I am looking for source code for one such APIs so that I can build my custom requirements over it.
    Thanks

    I am new to java world. I got a task of generating
    dynamic pdf files using Java. I have tried with some
    third party APIs for generating pdf. But most of
    them are not so feasable. Which ones? What was wrong with them?
    I am looking for source
    code for one such APIs so that I can build my custom
    requirements over it.What are your exact requirement?

  • How to launch PDF in Acrobat from AIR app?

    I'm porting an AS3 app to AIR -- one of the requirements is that an external PDF file be launched with Acrobat -
    I know that  AIR can display PDFs internally, but it's too late to change project specs. 
    I was using fscommand and a .bat file (this will be run on Windows), but that won't work under AIR.
    I am currently using navigateToURL() and using the AIR-resolved url -- this opens the PDF in a browser -- I'd like to have it open in Acrobat.
    Thanks for any help -- this is critical to finishing project.

    This won't work on files in the application directory?   It's not working for me --  The PDF is bundled into the AIR app --
    See http://stackoverflow.com/questions/4050898/openwithdefaultapplication-fails-on-files-in-ap plication-folder

  • How to launch my RESTful TEST with JAVA EE application in NetBeans 6.5

    Hi, I want to TEST my RESTful WebService in my JAVA Enterprise Application.
    I have a bit database in my EJB Module. Resuming, I have two modules (EJB + WAR) and Enterprise Application (JAVA EE that contains the before modules). Appears two kind of errors:
    1) When I only deploy JAVA Enterprise Project an then I run my TEST Restful, appears an error that says: "Another module has been deployed" . This error is about JAVA Enterprise Application has been deploy before.
    2) If I only deploy TEST Restful, this doesn't find Facaderemote class of my EJB Module, because WAR Project hasn't the EJB references.
    Thanks a lot.

    VM7, welcome to the forum. Please don't post in threads that are long dead and don't hijack other threads. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    I'm locking this thread now.
    db

  • How to launch a browser from a java/MAC application

    I know, this topic has been brought up over, and over, however I couldn't find info regarding MAC environments. I don't have any former experience with MAC, but now I'm getting desperate for a solution. I need to be able to launch the default browser showing a certain URL on MAC/OS. Any clue would be appreciated.
    thanks,
    m. berdan

    I wrote libraies that will do this:
    http://ostermiller.org/utils/Browser.html
    I also keep a list of other resources to help you out:
    http://dmoz.org/Bookmarks/D/deadsea/Java_Help/Web_Browser/
    Stephen

  • Create PDF Application Form Using Java

    Hi
    can Any one help me regarding how to create PDF Application from using java . That application should be doing the action events also.
    Message was edited by:
    helloshiva

    Check these pdf libraries:
    http://www.java-tips.org/java-libraries/pdf-library/

  • Replace VBX Control with Java Bean

    Hi All,
    While compiling 6i forms in 10g I got this error of VBX Control (Obsolete)
    The document says replace it with JavaBeans.
    I don’t know how to replace a VBS Control with Java Bean but this is what I did, I selected the item type as Bean Area.
    But the item do have a trigger
    begin
    control_lib.when_tab_changed(:control.tab_ctl)
    end
    The Package CONTROL_LIB is coded as below.
    Will this code work, technically I think yes, but its always better to ask experts before I move this to test...
    package body control_lib is
    g_tab_id number := 0
    procedure when_tab_changed
    (p_tab_id number) is
    l_err_txt varchar2(255);
    begin
    if :system.block_status != 'QUERY' then
    if not good_quiet_post(l_err_txt) then
    raise form_trigger_failure;
    end if
    end if
    if p_tab_id = 0 then
    rpt_ln_lib.new_tab;
    elsif p_tab_id = 1 then
    stat_lib.new_tab;
    elsif p_tab_id = 2 then
    per_acc_rl_lib.new_tab;
    end if
    g_tab_id := p_tab_id
    exception
    when form_trigger_failure then
    :control.tab_ctl := g_tab_id
    synchronize
    end when_tab_changed
    Thanks to all.
    Habeeb

    A Java bean is another technology than VBX control.
    If some document says: Replace it with java bean it certainly means to use a similar java bean with a similar functionality.
    I do not know a java bean, which runs VBX controls.
    So you surely have to look at what yout VBX does an than to look after a proper java bean (or to write an own one).

  • Calling javascript method from java

    Hi this is sri,
    I have one doubt on Java Applets "how to call the javascript method from java Applet".Can u give me the complete sample code for one program(both java applet file and html file also)because i can easily understand the programming flow.
    Thanks ,
    Srilekha.

    It's an extremely important skill to learn how to search the web. Not only will it increase your research and development talents, it will also save you from asking questions that have already been answered numerous times before. By doing a little research before you ask a question, you'll show that you're willing to work and learn without needing to have your hand held the entire time; a quality that is seemingly rare but much appreciated by the volunteers who are willing to help you.
    If you've done the research, found nothing useful, and decide to post your question, it's a great idea to tell us that you've already searched (and what methodologies you used to do your research). That way, we don't refer you back to something you've already seen.
    To get you started, here's a link...
    http://www.google.com/search?q=call+java+from+javascript

  • How to Launch an Integration Builder under two different java versions

    How to Launch an Integration Builder under two different java versions     1
    1. Situation     2
    2. How To Do     2
    2.1 jre preparation     2
    2.2 Put them into the system     2
    2.3 Execute a Java Web Start under jre 1.4.x version     3
    2.4 Change Java Runtime Versions     3
    2.5 Launch an Integration Builder     6
    1. Situation
    OS: windows 2000 pro – English
    Java version: jdk 1.5.x was already installed. (It’s not permitted to change.)
    I don’t have any authorization to install any software on the PC.
    But I need to use an Integration Builder.
    I already knew URLs of an Integration Builder (http://<hostname>:50000/rep/start/repository.jnlp).
    2. How To Do
    At this moment, an Integration Builder (XI 3.0) can be launch under jre 1.4.x environment (on windows).
    2.1 jre preparation
    I download j2re-1_4_2_10-windows-i586-p.exe from http://java.sun.com/j2se/1.4.2/download.html
    I installed it on my home PC and copied all files from C:\Program Files\Java\ j2re1.4.2_10\ into my USB.
    2.2 Put them into the system
    I pasted j2re1.4.2_10 folder from my USB into the windows 2000 pro system.
    Finally, I could list up all of javaws.exe under this system.
    c:\j2re1.4.2_10\javaws\javaws.exe
    c:\Program Files\Java\jdk1.5.0_05\bin\javaws.exe
    c:\Program Files\Java\jdk1.5.0_05\jre\bin\javaws.exe
    c:\Program Files\Java\jre1.5.0_05\bin\javaws.exe
    2.3 Execute a Java Web Start under jre 1.4.x version
    I executed c:\j2re1.4.2_10\javaws\javaws.exe .
    2.4 Change Java Runtime Versions
    Go to File-> Preferences -> Java
    As you can see, it indicates 1.5 version.
    Click [FIND] button.
    Click [NEXT] button.
    Click the j2re1.4.2_10 folder.
    Click [NEXT] button.
    A JRE Finder is able to find javaw.exe automatically. Or you can indicate C:\j2re1.4.2_10\bin\javaw.exe directly.
    Click [NEXT] button.
    Finally, there are two Java Runtime Versions. Now you need to uncheck the Enabled column of 1.5 version and check 1.4 version.
    Click [OK] button.
    Well, in the General tab, I selected None for Proxies.
    2.5 Launch an Integration Builder
    In the Location field, I typed the URL of an Integration Builder jnlp.
    http://<hostname>:50000/rep/start/repository.jnlp
    SAP Integration Builder comes up inside Applications area.
    Select it and click [Start] button.
    If you click Environment-> Integration Builder (Configuration), you can launch Integration Builder: Configuration.
    [PDF file location] with screenshots
    http://SDN.mobilian.org/SDN/How2LaunchIB.rar
    ===================Advertisement==========================
    How do you search SDN?
    What about [<b>SDN Search Widget</b>]?
    SDN Search Widget
    =========================================================

    I am not getting anywhere with deploying my application or
    applet.
    I have set up my bc4j project. It contains all my VO info,
    links, application module. (proj a)
    I then have another project with DbInfo in it(has all my rowset
    info), Multiple Frames, and my Applet.java file.
    Actually I have an Applet.java file and a Application.java file
    because I was seeing if both/either worked. Anyway they seem the
    same, except for that extra window that comes up when you run the
    applet.
    I follow the steps in the oracle directions (from earlier post).
    And all seems ok. But at ---->
    [*] Select the subdirectory under myhtml where your applet's HTML
    file
    is located, and enter the directory path of the 'staging'
    directory you
    created in step 3 above, if different from the default.</li>
    [*]Select the HTML files that JDeveloper created to run your
    applet.</li>
    [*]Select all of the Java source files in your project that make
    up the
    applet.</li>
    I have no HTML file associated with my applet, at least that I
    know of.
    So do I need to create one, or should it of been done
    automatically.
    Also, I trying to figure out what will be the best way to deploy
    my project. Applet or stand alone application is what my first
    choices have been so far. I have read that there is some issues
    with applets being served from a different server than the
    database. So a stand alone application was my front runner, but
    I haven't gotten either way to work yet.

Maybe you are looking for