Execute Script to Read and Parse HTML

Hi Everyone,
I wanted to know if anyone on this forum had ever implemented an example of an executeScript operation that mimics what JSoup and JTidy project do?
In a nutshell, I need to get a series of pages from a webpage which is an authority for content that I need to bring within my LiveCycle Process.
These pages are statics and are tables.
I have tried playing with many of the examples found by using Googl'ing, but unfortunately, the implementation of Java in LiveCycle is somewhat limited (BeanShell 1.3.0).
Unfortunately, so is my knowledge of both Java and BeanShell.
Currently the process does not generate any errors in the server.log not does it give me an output.
I am using LiveCycle ES3 with the standard Java JRE installation.
Thanks for the help!
Here is what I started with
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
public class URLExp {
    public static void main(String[] args) {
        try {
            URL google = new URL("http://www.google.com/");
            URLConnection yc = google.openConnection();
            BufferedReader in = new BufferedReader(new InputStreamReader(yc
                    .getInputStream()));
            String inputLine;
            while ((inputLine = in.readLine()) != null) {
                System.out.println(inputLine);
                         //save the outbound map in the process variable named serverCalls
                    patExecContext.setProcessDataStringValue("/process_data/myRates", inputLine);
            in.close();
        } catch (Exception e) {
            e.printStackTrace();

Try 'getProcessDataValue'.
I did a little test with two process variables
1) xmlData - variable type 'xml'
2) xmlStr - variable type 'string'
and two services
1) Set Value
/process_data/@xmlStr <> serialize(/process_data/xmlData)
2) Custom Script
String xmlStr = patExecContext.getProcessDataValue("/process_data/xmlStr");
patExecContext.setProcessDataValue("/process_data/xmlData",xmlStr);
where the value of xmlStr was
<form1>
    <Details>
        <review_from type="VARCHAR">06292009</review_from>
        <review_to type="VARCHAR">06282010</review_to>
        <site_name type="VARCHAR">General Electric Office, Schenectady</site_name>
        <site_street type="VARCHAR">1 River Road</site_street>
    </Details>
</form1>
and the resulting value of xmlData was
<form1>
    <Details>
        <review_from type="VARCHAR">06292009</review_from>
        <review_to type="VARCHAR">06282010</review_to>
        <site_name type="VARCHAR">General Electric Office, Schenectady</site_name>
        <site_street type="VARCHAR">1 River Road</site_street>
    </Details>
</form1>
Steve

Similar Messages

  • How to read and parse a comma delimited file?  Help

    Hi, does anyone know to read and parse a comma delimited file?
    Should I use StreamTokenizer, StringTokenizer, or the oro RegEx packages?
    What is the best?
    I have a file that has several lines of data that is double-quoted and comma delimited like:
    "asdfadsf", "asdfasdfasfd", "asdfasdfasdf", "asdfasdf"
    "asdfadsf", "asdfasdfasfd", "asdfasdfasdf", "asdfasdf"
    Any help would be greatly appreciated.
    thanks,
    Spack

    import java.util.*;
    import java.io.*;
    public class ResourcePortalParser
        public ResourcePortalParser()
        public Vector tokenize() throws IOException
          File reportFile = new File("C:\\Together5.5\\myprojects\\untitled2\\accessFile.txt");
         Vector tokenVector = new Vector();
          StreamTokenizer tokenized = new StreamTokenizer(new FileReader(reportFile));
         tokenized.eolIsSignificant(true);
              while (tokenized.nextToken() != StreamTokenizer.TT_EOF)
                   switch(tokenized.ttype)
                        case StreamTokenizer.TT_WORD :
                        System.out.println("Adding token - " + tokenized.sval);
                             tokenVector.addElement(tokenized.sval);
                             break;
              return tokenVector;
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to read and parse a remote XML file with Java

    Hi.
    Using J2SE v1.4.2, I'd like to read and parse a remote file:
    http://foo.com/file.xml
    Is it possible with Java? I'd be extremely grateful if someone could provide me any webpage showing a very simple code.
    Thank you very much.

    How about the following?
         import java.io.InputStream;
         import java.net.URL;
         import javax.xml.parsers.DocumentBuilder;
         import javax.xml.parsers.DocumentBuilderFactory;
         import org.w3c.dom.Document;
         public static void main(String[] args) throws Exception {
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              DocumentBuilder db = dbf.newDocumentBuilder();
              URL url = new URL("http://foo.com/file.xml");
              InputStream inputStream = url.openStream();
              Document document = db.parse(inputStream);
              inputStream.close();
         }-Blaise

  • Read and parse XML

    Hi all,
    is there some procedure or function or whatever I can use to read and parse an XML file into Oracle?
    The XML contains 30+ Megs of data, which would represent data in 10+ tables if you would convert it into flat files.
    I know I can read the XML and save it line by line in a table, but I do not want to parse it myself. It would be cool if there was a tool or so that would read the dtd definition of the XML, then read the XML data, parse it and create temporary tables with the flat content of the xml (can you code object oriented with PL/SQL? this would even be cooler!).
    Does someone have an idea how to do that?
    Thanks,
    Steff

    Wow, I've never tried to parse an XML file quite that large
    before. Does it contain a bunch of encoded binary data, or does it
    have houndreds of thousands of xml-nodes?
    In any event, I do have one thought:
    Do you need absolutely everything in the file? If you only
    need access to a small portion of it, it would be worth your while
    to pull out only the "stuff" that you need before you parse it. You
    could use regular expressions to strip out things you don't need,
    or to pull out only the stuff you do need.
    The more you can minimize the "parse" effort the better off
    you'll be.
    Alternatively, if it's a file describing many "records" of
    the same type, it would be best if you could "chunk" the file and
    parse each record individually.

  • Creating an executable script with vi and chmod

    I have some after market packages I want to set up in my MBP Mavericks. I create a script file in iv called runada. It adds some directories to the global $PATH variable. I then change rights on the script, runada, with 'chmod a+x runada' so it becomes an execuitble. But it fails when I call runada within a shell terminal. I have seent his work in Debian I think.

    As a guess: PATH needs to be exported if you want that setting to persist after the script modifies it and exits, or you'll need to "." or "source" invoke the script.
    In any case, post a reproducer of the bash and somebody here can have a look.
    Using homebrew is another approach to rolling your own packaging (if that's where you're headed here), and there are various alternatives to that.

  • Best way to read and parse XML to multiple tables

    This is first time using XML input file for JDev ADF 10.1.3.3 application. We are trying to develop an XML API that the application will read and process. A simple XML record would have field tags for table AA which has 1 to many tags for table BB. Table BB contains 0 to many tags for tables: CC, DD, and EE. Naturnally, the database is relational and there exist Foreign Keys for the Master-Detail relationships that are represents as View Objects in the JDev application.
    What is the best way for us to design and code this API?

    Hi,
    I don't really see any better options for SharePoint. SharePoint use other production called 'Office Web App' to allow users to view/edit Microsoft Office documents (word, excel etc.). But the web version of excel doesn't support that much records as well
    as there's size limitations (probably the default max size is 10MB).
    Regarding second problem, I think you need some custom solutions (like a SharePoint timer job/webpart ) to read and present data.
    However, if you can reduce the excel file records to something near 16k (which is supported rows in web version of excel) then you can use SharePoint Excel service to refresh data automatically in the excel file in SharePoint from some external sources.
    Thanks,
    Sohel Rana
    http://ranaictiu-technicalblog.blogspot.com

  • A Script to read and copy from a Windows Mobile device

    Hey forum....
    When I dock my Windows Mobile device in a Windows 7 PC, the Windows Mobile Device Center opens and I can browse the device and copy files between it and the PC. However, I'm looking some kind of way to automate this process. All I'm really interested in
    is a single file named TEXT.TXT which is stored in the My Documents folder. Basically, I'm looking for a script that will detect the Windows device (it's USB-attached) when docked, find the file TEXT.TXT in the My Documents folder and then copy this file to
    the /Temp folder on the desktop.
    I've tried using the synchronization feature of WMDC but it copies the file to a documents folder set up for the specific device. Instead, I'm looking to find and copy the file to C:\TEMP regardless of the device.
    Thanks in advance for any help!
    Everett

    Hey forum....
    When I dock my Windows Mobile device in a Windows 7 PC, the Windows Mobile Device Center opens and I can browse the device and copy files between it and the PC. However, I'm looking some kind of way to automate this process. All I'm really interested in
    is a single file named TEXT.TXT which is stored in the My Documents folder. Basically, I'm looking for a script that will detect the Windows device (it's USB-attached) when docked, find the file TEXT.TXT in the My Documents folder and then copy this file to
    the /Temp folder on the desktop.
    I've tried using the synchronization feature of WMDC but it copies the file to a documents folder set up for the specific device. Instead, I'm looking to find and copy the file to C:\TEMP regardless of the device.
    Thanks in advance for any help!
    Everett
    Just configure the device to sync the folders you want to sync.  Start by reading the help very carefully.
    This is not a scripting question and this forum is not for end user questions.   I suggest posting in the Windows Phone forum.
    You can also sync via OneDrive over a cellular or wireless connection.
    ¯\_(ツ)_/¯

  • How get xml-data at servlet by http and parse it?

    hello! please help me who can, i have very urgent task but not much skilful to deal with work in web. is anywhere source code or similar example of task to get xml-data at servlet by http and parse it . thank you in advance

    here a basic code that reads and parses an remote xml file:
    import java.io.IOException;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.parsers.SAXParser;
    import javax.xml.parsers.SAXParserFactory;
    import org.xml.sax.Attributes;
    import org.xml.sax.SAXException;
    import org.xml.sax.helpers.DefaultHandler;
    public class SAXParserExample extends DefaultHandler {
         StringBuffer buffer;
         String urlString = "http://nds.nokia.com/uaprof/NN95_8GB-1r100.xml";
         public SAXParserExample() {
         public void runExample() {
              parseDocument();
         private void parseDocument() {
              // get a factory
              SAXParserFactory spf = SAXParserFactory.newInstance();
              try {
                   // get a new instance of parser
                   SAXParser sp = spf.newSAXParser();
                   URL url = new URL(urlString);
                   HttpURLConnection httpSource = (HttpURLConnection) url.openConnection();
                   // parse the file and also register this class for call backs
                   sp.parse(httpSource.getInputStream(), this);
              } catch (SAXException se) {
                   se.printStackTrace();
              } catch (ParserConfigurationException pce) {
                   pce.printStackTrace();
              } catch (IOException ie) {
                   ie.printStackTrace();
         // Event Handlers
         public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
              System.out.println("+++ start of element: " + qName);
              buffer = new StringBuffer();
         public void characters(char[] ch, int start, int length) throws SAXException {
              buffer.append(ch, start, length);
         public void endElement(String uri, String localName, String qName) throws SAXException {
              System.out.println(buffer.toString());
              System.out.println("+++ end of element " + qName);
         public static void main(String[] args) {
              SAXParserExample spe = new SAXParserExample();
              spe.runExample();
    }you have only to change the urlString and adapt to your needs.
    hope it helps

  • Amending script to read list of computers, run script and output to log file

    Hello all,
    I have cobbled together a script that runs and does what I want, now I would like to amend the script to read a list of computers rather than use the msg box that it is currently using for the strcomputer, if the computers doesn't respond to a ping, then
    log that, if it does continue with the script and when it is complete, log a success or failure. I have just started scripting and would really appreciate some help on this one,thanks. I created the script to fix an SCCM updates issue and failing task sequences,
    so it may prove useful to others.
    There are msg box entries that can be removed that were originally in there for the user running the script.
    'setting objects
    Dim net, objFSO, shell
    Dim objFile, strLine, intResult
    Set objnet = CreateObject("wscript.network")
    Set objFSO = CreateObject("scripting.filesystemobject")
    Set objshell = CreateObject("wscript.shell")
    strfile = "c:\wuafix\wuafix.vbs"
    strUser = "domain\user"
    strPassword = "password"
    'getting server name or IP address
    strComputer=InputBox("Enter the IP or computer name of the remote machine on which to repair the WUA agent:", "Starting WUA Fix")
    'check to see if the server can be reached
    Dim strPingResults
    Set pingExec = objshell.Exec("ping -n 3 -w 2000 " & strComputer) 'send 3 echo requests, waiting 2secs each
    strPingResults = LCase(pingExec.StdOut.ReadAll)
    If Not InStr(strPingResults, "reply from")>0 Then
    WScript.Echo strComputer & " did not respond to ping."
    WScript.Quit
    End If
    'Check if source file exists
    If Not objFSO.FileExists(strFile) Then
    WScript.Echo "The source file does not exist"
    WScript.Quit
    End If
    MsgBox "The WUA Fix is in process. Please wait.", 64, "Script Message"
    'mapping drive to remote machine
    If objFSO.DriveExists("Z:") Then
    objnet.RemoveNetworkDrive "Z:","True","True"
    End If
    objnet.MapNetworkDrive "Z:", "\\" & strComputer & "\c$", True
    'creating folder for install exe on remote machine
    If (objFSO.FolderExists("Z:\wuafix\") = False) Then
    objFSO.CreateFolder "Z:\wuafix"
    End If
    'copying vbs to remote machine
    objFSO.CopyFile strFile, "Z:\wuafix\wuafix.vbs"
    'set command line executable to run a silent install remotely
    strInstaller1 = "cscript.exe c:\wuafix\wuafix.vbs"
    'strInstaller2 = "c:\wuafix\wuafix.vbs"
    strExec = "c:\pstools\PsExec.exe "
    'objshell.Run strExec & " \\" & strComputer & strInstaller1
    On Error Resume Next
    result = objshell.Run(strExec & " \\" & strComputer & " " & strInstaller1)
    If Err.Number = 0 Then
    WScript.Echo "PSXEC Runing WUA fix remotely"
    Else MsgBox Err.Number
    MsgBox result
    End If
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colLoggedEvents = objWMIService.ExecQuery _
    ("SELECT * FROM Win32_NTLogEvent WHERE Logfile = 'Application' AND " _
    & "EventCode = '4'")
    Wscript.Echo "Event Viewer checked and Fix Applied:" & colLoggedEvents.Count
    MsgBox "Removing mapped drive Please wait.", 64, "Script Message"
    If objFSO.DriveExists("Z:") Then
    objnet.RemoveNetworkDrive "Z:","True","True"
    End If
    MsgBox "The WUA Fix has been applied.", 64, "Script Message"
    quit
    wscript.quit
    Any help appreciated and explanations on the process would be great as I would like to learn the process involved, which is difficult when working during the day.
    many thanks

    Hi Bill,
    long story short, I have approx. 2800 clients with an old entry in WMI for updates that the sccm client cannot clear or run because they do not exist anymore, so the client will not run updates or use a task sequence because of this, so my script fixes this
    and does a couple of other things, I have found another way to do this by running  a different script that uses WMI to call a cscript function that uses the wuafix.vbs that is coped to the machine, I am also changing the echo entries to output to a log
    file instead so that I can track what client has run the fix andn which ones haven't.
    If you have any suggestions then please let me know, nothing nefarious :)
    many thanks

  • Read Text from HTML-Pages and want to solve "ChangedCharSetException"

    Hello,
    I have an app that connect via threads with pages and parse them an gives me only the Text-version of a HTML-page. Works fine, but if it found a page, where the text is within images, than the whole app stopps and gave me the message:
    javax.swing.text.ChangedCharSetException
            at javax.swing.text.html.parser.DocumentParser.handleEmptyTag(DocumentParser.java:169)
            at javax.swing.text.html.parser.Parser.startTag(Parser.java:372)
            at javax.swing.text.html.parser.Parser.parseTag(Parser.java:1846)
            at javax.swing.text.html.parser.Parser.parseContent(Parser.java:1881)
            at javax.swing.text.html.parser.Parser.parse(Parser.java:2047)
            at javax.swing.text.html.parser.DocumentParser.parse(DocumentParser.java:106)
            at javax.swing.text.html.parser.ParserDelegator.parse(ParserDelegator.java:78)
            at aufruf.main(aufruf.java:33)So I tried to catch them with "getCharSetSpec()" and "keyEqualsCharSet( )" from the class "javax.swing.text.ChangedCharSetException" and hoped that this solved the problem. But still doesen't work...
    Then I looked at the web and found, that I have to add the line:
    doc.putProperty("IgnoreCharsetDirective", new Boolean(true));"doc." is a new HTML Dokument, created with the HTMLEditorKit. I do not have much knowledge about that and so I hope, that someone can explain me, how I can solve that problem, within my code.
    Here we go:
    import javax.swing.text.*;
    import java.lang.*;
    import java.util.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.text.html.*;
    import javax.swing.text.html.parser.*;
    public class myParser extends Thread
            private String name;
            public void run()
                    try
                            URL viele = new URL(name);                       // "name" ia a variable with a lot of links
                    URLConnection hs = viele.openConnection();
                    hs.connect();
                    if (hs.getContentType().startsWith("text/html"))
                            InputStream is = hs.getInputStream();
                            InputStreamReader isr = new InputStreamReader(is);
                            BufferedReader br = new BufferedReader(isr);
                            Lesen los = new Lesen();
                            ParserDelegator parser = new ParserDelegator();
                            parser.parse(br,los, false);
            catch (MalformedURLException e)
                    System.err.print("Doesn't work");
            catch (ChangedCharSetException e)
                    e.getCharSetSpec();
                    e.keyEqualsCharSet();
                    e.printStackTrace();
            catch (Exception o)
            public void vowi(String n)
                    name = n;
    }and for the case that it is important here is the class "Lesen"
    import java.net.*;
    import java.io.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import javax.swing.text.html.parser.*;
    class Lesen extends HTMLEditorKit.ParserCallback
            public void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos)
                    try
                            if ((t==HTML.Tag.P) || (t==HTML.Tag.H1) || (t==HTML.Tag.H2) || (t==HTML.Tag.H3) || (t==HTML.Tag.H4) || (t==HTML.Tag.H5) || (t==HTML.Tag.H6))
                                    System.out.println();
                    catch (Exception q)
                            System.out.println(q.getMessage());
            public void handleSimpleTag(HTML.Tag t,MutableAttributeSet a, int pos)
                    try
                            if (t==HTML.Tag.BR)
                                    System.out.println(); // Neue Zeile
                                    System.out.println();
                    catch (Exception qw)
                            System.out.println(qw.getMessage());
            public void handleText(char[] data, int pos)
                    try
                            System.out.print(data);                                           // prints the text from HTML-pages
                    catch (Exception ab)
                            System.out.println(ab.getMessage());
    }Thanks a lot for helping...
    Stephan

    parser.parse(br,los, false);
    parser.parse(br,los, true);

  • Read CLOB and parse out records

    I have a table that features an XMLTYPE column containing CLOB data with XML and HTML content in it. I'm not quite sure how I can parse out the [CDATA] section and create a unique list of IDs contained within the javascript:openLink() string. Any ideas? I've tried searching the forums for how to read a CLOB and parse out each line, but didn't find the results I was looking for.
    I've provided a sample of some of the content in this column:
    <html><![CDATA[
    <P>
    <font face="Arial" SIZE="3">
    <strong>
    <span style="FONT-FAMILY: Arial">Recruiting</span>
    </strong>
    </font>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1010)">2008 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1009)">2007 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1008)">2006 Newsletters</A>
    </P>
    ]]></html>
    I basically need to output a list of IDs:
    LinkID
    1010
    1009
    1008

    Sorry...I thought I could figure things out based on your example, but I 'm not sure if 10g supports noentityescaping clause. Do you happen to know what I would need to substitute it with? To my understanding the XMLELEMENT function takes a name for "identifier," although I'm not quite sure in this case what the identifier should be...an XML tag value?
    This is SQL I tried to run but not getting any results:
    SELECT t2.*
    FROM (SELECT pagecontent
    FROM tb_rh_page
    WHERE pageid = 1) T,
    XMLTABLE('a/@href' PASSING XMLELEMENT(noentityescaping, EXTRACTVALUE(T.pagecontent,'/p_PAGECONTENT/Controls/divTopLeft/html/text()')).EXTRACT('//a')
    COLUMNS linkid integer PATH 'ora:replace(.,"[^[:digit:]]","")') t2
    Also the HTML is a little deeper in the XML than I originally posted, so I'm not sure if I'm getting to the path correctly.
    Here's what the data looks like in the column:
    <p_PAGECONTENT>
    <PageName/>
    <Title/>
    <Roles/>
    <Controls>
    <PageTool>
    <visible>false</visible>
    </PageTool>
    <divTopLeft>
    <visible>true</visible>
    <style>font-size:larger;overflow:auto;FILTER: progid:DXImageTransform.Microsoft.Gradient(StartColorStr=#3b6f9f, EndColorStr=#e6eff6);Height:560px;background-color:#003366;border-bottom-width: 1px;border-color: #c6ddf1;border-left-width: 1px;border-right-width: 1px;border-style: Solid;border-top-width: 1px;</style>
    <html><![CDATA[
    <P>
    <font face="Arial" SIZE="3">
    <strong>
    <span style="FONT-FAMILY: Arial">Recruiting</span>
    </strong>
    </font>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1010)">2008 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(1009)">2007 Newsletters</A>
    </P>
    <P>
    <A CLASS="divHyperLink" href="javascript:openLink(2008)">2006 Newsletters</A>
    </P>
    ]]></html>
    </divTopLeft>
    <divTopRight>
    <visible>false</visible>
    <style/>
    <html><![CDATA[]]></html>
    </divTopRight>
    <divBottomLeft>
    <visible>false</visible>
    <style/>
    <html><![CDATA[]]></html>
    </divBottomLeft>
    <divBottomRight>
    <visible>false</visible>
    <style/>
    <html><![CDATA[]]></html>
    </divBottomRight>
    </Controls>
    </p_PAGECONTENT>

  • Read CSV File and parse it

    Hi.
    I have a .csv file on my filesystem.
    Could you post few code to read it from filesystem and parse every rows in it?
    Thanks a lot.

    External tables are far easier to use... e.g.
    I have a file on my server in a folder c:\mydata called test.txt which is a comma seperated file...
    1,"Fred",200
    2,"Bob",300
    3,"Jim",50As sys user:
    CREATE OR REPLACE DIRECTORY TEST_DIR AS "c:\mydata";
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser;Note: creates a directory object, pointing to a directory on the server and must exist on the server (it doesn't create the physical directory).
    As myuser:
    SQL> CREATE TABLE ext_test
      2    (id      NUMBER,
      3     empname VARCHAR2(20),
      4     rate    NUMBER)
      5  ORGANIZATION EXTERNAL
      6    (TYPE ORACLE_LOADER
      7     DEFAULT DIRECTORY TEST_DIR
      8     ACCESS PARAMETERS
      9       (RECORDS DELIMITED BY NEWLINE
    10        FIELDS TERMINATED BY ","
    11        OPTIONALLY ENCLOSED BY '"'
    12        (id,
    13         empname,
    14         rate
    15        )
    16       )
    17     LOCATION ('test.txt')
    18    );
    Table created.
    SQL> select * from ext_test;
            ID EMPNAME                    RATE
             1 Fred                        200
             2 Bob                         300
             3 Jim                          50
    SQL>
    {code}
    http://www.morganslibrary.org/reference/externaltab.html                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Can java script be executed inside Acrobat reader 7

    Hello All
    I am quire new to Acrobat. Please tell me if I can execute a java script in Acrobat reader.
    I am using itext library to add java script to a pdf and opening the pdf in reader and get the error
    NotAllowedError: Security settings prevent access to this property or method.
    Global.addWatermarkFromText:1:Document-Level:0000000000000000
    First question can I execute this javascript with Reader itself. If yes how should i get rid of this error

    The Acrobat SDK cannot be used to change the information shown for
    each method in the quick bar in the documentation. If that says the
    method does not work in Reader, then it does not work in Reader...
    I do not think there is any similar method for Reader (adding a
    watermark) - very much an Acrobat function. Unless you can pre-create
    the watermark as a form field, so you only have to change the text at
    runtime.
    Aandi Inston

  • BC won't allow me to insert code (scripts) between the /body and the /html tags.

    Hi guys,
    So I have this weird problem. I'm trying to insert some codes between the </body> and the </html> tags in the page templates. It's saving it. But if you check the page, the code is showing before the </body>, not after. Here's the code that I'm trying to insert.
    <script src="http://i.simpli.fi/dpx.js?cid=1534&action=100&segment=198566&m=1"></script>
    I have also tried adding this code by downloading the templates through ftp, adding the code, then uploading it to the server. Same thing. I even added type="text/javascript" in the code. Still no go. BC wouldn't insert it between </body> and </html>. Any ideas guys?
    - Jeff

    So an update.
    I was told by Adobe chat support to try adding the script after the body via javascript.
    So I added this before </head>
    <script type="text/javascript">
    var script = document.createElement('script');
    script.src = '//i.simpli.fi/dpx.js?cid=1534&action=100&segment=198566&m=1';
    script.type = 'text/javascript';
    $("html").append(script);
    </script>
    Still not working. Any ideas guys?

  • Web browser and script activeX controls and HTML data

    Hello,
    I'm trying to use the Microsoft Web Browser (IWebBrowser2) and Script (IScriptControl) activeX controls in Labview to evaluate and execute HTML script.  If I wire the web browser control's document object to the object input of the Script control's AddObject method, I can then evaluate/execute script such as "document.f.btnI.focus();" and such (in this case corresponding to Google's home page).  However, there are other expressions that include the "window" object that are proving much more difficult to work with.  Although I can browse the document object's parentWindow object via the property browser, if I try to access that object programatically, I get the error "Error -2147467262 occurred at No such interface supported".  I'm wondering how to include the window object for scripting.
    I'm writing a content-oriented web crawler.  I've been writing it with pretty low level TCP functions, handling 301/302 "object moved" and "<META HTTP-EQUIV="refresh" CONTENT="0; url=http://millercountyliberal.com/">" redirections manually.  But there are other automatic script-based redirections like:
    <script language="JavaScript" type="text/javascript">
    <!-- window.location="http://www.jrnl.com" -->
    </script>
    that I'm still trying to figure out how to work with.  As you can see, to work with that one manually involves the window object.  The reason that I don't just let the Web Browser object handle the redirections is because that object often throws script errors, downloads embedded graphics and other unnecessary components, can't handle some non-standard redirections, and sometimes annoyingly crashes.  Any help would be appreciated.  A code sample is attached.  The Web Browser control should already exist on your machine if you have Internet Explorer installed.  The script control may need to be registered before it can be used as follows:
    regsvr32 "c:\MyDir\XHTTP.dll"
    Thanks.
    Attachments:
    HTML Script Testing.zip ‏773 KB

    Hi Ted,
    This seems to be a problem with the way you are referencing the ActiveX properties.  I would research a little more on the API for these objects.  See http://msdn.microsoft.com/workshop/browser/webbrow​ser/reference/ifaces/iwebbrowser2/document.asp for an explanation of the IWebBrowser2 Document property.  I am suspicious of where you are typecasting the Document variant into the IHTMLDocument2 object and this is where the error is being thrown.
    A search of this error code on Google shows that this is a generic error from the ActiveX object, and not a LabVIEW error, although it is confusing since LabVIEW uses error codes in this same range.
    Hope this helps!
    Doug M
    Applications Engineer
    National Instruments
    For those unfamiliar with NBC's The Office, my icon is NOT a picture of me

Maybe you are looking for

  • Embedding HTML in Flex

    http://www.merhl.com/flex2_samples/iframe/IFrame.html here is the example I am learning. i can do right click on page to get source code. But i think i missed one called IFrame.mxml. Any one know how can i get all source code from this page? Or, anyo

  • Oracle 10g AS login

    Hi All, I am using oracle 10g.1.3.0 app server and IDE. I have a login page that has username and password for user to login in 1>what is the best way I can use in 10g for user authetication ? 2>Once user is authenticated, I have a link on page2, tha

  • System software updates possible?

    recently whwnever I try to opdate my system software from the finder the App Store app comes up. Is this the new way or .... it never says my system needs updating nor does it update my 4S, 3gs, iPad, Macbook Pro or this imac.

  • ABBA Gold Album split into 2 Albums since with 11.4(18) update

    Strange things happen, with a click on the Album (ABBA Gold latest) it split up into 2 Albums one with only the 1. Song and one with the rest. I tried to delete it locally and download from the cloud again, but when I choose to view the "music" in th

  • AirPort has to be restarted daily

    my airport extreme base station is about a year and a half old, and we just moved into a new place but have the same comcast service as we did in the old place (cable internet and digital phone run through one modem). every morning now, the computers