How to load doc-level JavaScript via FDF

I apologize if this question is answered elsewhere on the forum -- I've spent a fair amount of time searching through the forum and other resources brought up in response to Google searches, all without a solid result; therefore I'm hoping that someone in the forum can help out.
I've got several dozen PDF forms that all use the same core set of JavaScript functions to perform various validation and formatting processes. So far, I've loaded this library as a document-level script in each PDF and then loaded the PDFs to the server.
When a user requests to view their specific document, the link that they click actually generates an FDF file that is sent to their browser. The FDF causes the target PDF to be loaded in the browser, into which the FDF data is loaded. A page load Script executes the do_DocLoad function, which sets up the document for initial user use (populates combo boxes, etc.) The user then can interact with the form in various ways and then, optionally, submit the data back to the server for processing. The library functions are referenced in various field formatting or validation calls, as well as by the Submit button that I've got on the form that performs a final field validation prior to submission. So far, this process works very well.
The issue is that every time a change, even a minor one, is needed in any of the core set of library functions, we have to open each and every PDF to apply the change, then save it and upload the entire batch to the server. Because of the significant amount of time that this can take (which will increase as the PDF library grows), I'd like to instead load the JavaScript functions in the FDF.
The ideal would be a method to allow the FDF to cause Acrobat to load the script from a file on the server, similar to how the PDF is called. Because I don't know if that would even work, I'm looking at having the ASPX page that processes the FDF, merging the user's data into the FDF format before serving it to the browser also merge in the script and serve it all up piping hot for the user's enjoyment (or so we hope). I've tinkered with the FDF, adding a /JavaScript section at the end of the FDF as follows:
    << /V (~data_client_name~)/T (client_name)>>
    << /V (~data_client_address~)/T (client_address)>>]
    /F (~data_FileName~)/ID [ <  blah blah ><  blah blah >]
    /JavaScript << /Doc 2 0 R >>
  >>
>>
endobj
2 0 obj [ (DocScript1) 3 0 R ] endobj
3 0 obj <<>>
stream
** script goes here **
endstream
endobj
trailer << /Root 1 0 R >>
%%EOF
In the section where ** script goes here ** I have attempted to paste the script library, without success. This library consists of several different JavaScript functions.
In testing, the above didn't work, unfortunately. :-( I got all kinds of wierd data in the form fields that are processed by the functions that I was trying to load - the page open calls didn't return any errors, which was good, but the fields formatted by the initial setup method were all messed up. I'm looking for any pointers/tips on what I might be doing wrong. Are there special characters that I need to escape/avoid in sending JavaScript this way (I'm using regular expression pattern matching and other code within the script which contain some special characters such as /, \, ^, etc.). Is there a limit to the size of the data that I can stream in this way? Is it as simple as loading my script /Before instead of /Doc? Anything else that I might try?
Thanks in advance for any assistance that can be given! Every time that I get to go back and spend a couple of hours updating the core library in all of these PDFs is time that I'd rather be spending doing other things. Thanks again!

This sounds very intriguing and not at all along the lines of what I was thinking of. I'm glad to have the forums to be able to get different perspectives on
things like this!
I have a couple of additional questions on this. I like #3 but, not having done it before, I'm curious as to how to get it to work.
I presume that I would create a new batch process in Acrobat (I am running Acrobat Pro 9) and then on each document processed, do the following:
1. Import a PDF page (from a specified file that has the document-level scripts included.
2. Delete the page just-added
3. Save
4. Repeat, all docs specified.
Now questions:
1. I don't understand how the document scripts will be "left behind" when doing this.
2. Do I need to delete the existing document script(s) before doing this, or will they automagically be overwritten?
3. Are there any steps between the insert and the delete that I need to do?
Finally, just to add another twist, have you seen this work with PDFs that are secured (we apply a password to protect the documents from alteration, with the exception of filling out form fields)?
So far, in testing, the best method appears to be to store the PDFs separate in an un-secured format (it simply won't work if they're secured -- at least, I haven't gotten it to work yet -- I could probably do it interactively, but who wants to type the goofy password 500 times). I have a separate dummy PDF (1 page with just some explanation text if someone opens it and document-level scripts included) also stored in the folder. Then, run the batch process to do the insert, delete, then apply security on all docs in the folder. So far, so good. The only part that doesn't seem to be working is that the document-level scripts on the dummy PDF don't get left behind after the insert/delete. I removed the doc-level scripts on the original PDFs so that I could more easily verify that the ones from the dummy PDF get "left behind". I'm sure that I'm missing something simple here -- If you can help close that final gap, I'd greatly appreciate it!

Similar Messages

  • Error Running Doc-Level JavaScript from VBS

    I have the document level javascript function in my PDF document "FillForm()", (see code below).  When I run my VBS code, (see code below) I get the error:  "Run-time Error '438': Object doesn't support this property or method." on the "jso.FillForm" line.  I can execute 'jso.console.Show' without a problem.  What am I doing wrong?  (Oh, and it has to be a document level funtion, and not a folder level function.  And once I get this working, I'll be passing parameters.  I'm using a stripped down function just to get this to work).
    DOCUMENT JAVASCRIPT
    //<Document-Level>
    //<ACRO_source>FillForm</ACRO_source>
    //<ACRO_script>
    /*********** belongs to: Document-Level:FillForm ***********/
    function FillForm()
    var textHolder;
    textHolder = this.getField("dorReturnAddress");
    textHolder.value = "dorReturnAddress";
    textHolder = this.getField("attn");
    textHolder.value = "attn";
    //</ACRO_script>
    //</Document-Level>
    VBS CODE
      Dim wAcro As Acrobat.AcroApp
      Dim dAcro As Acrobat.AcroPDDoc
      Dim jso As Object
      Set wAcro = CreateObject("AcroExch.App")
      wAcro.Show
      Set dAcro = CreateObject("AcroExch.PDDoc")
      dAcro.Open (ThisDocument.Path & "\" & "Worksheet - Template.pdf")
      Set jso = dAcro.GetJSObject
      jso.FillForm
    - Thanks in Advance!

    You can use the function ExecuteThisJavascript. Read more here:
    http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=16431

  • How to load a class dynamically (via reflection) in a jsf-component

    Hi all,
    I am writing my own jsf component and I would like to do it generically. Therefore I have an attribute, where the developer can pass a fully qualified classname, which I want to use to instantiate. But I have a Problem with the classloaders, everytime I get a ClassNotFound-Exception during debugging.
    Does anybody know how it is possible, to to get the most parent classloader?
    Currently I am even not able to load a class, which is in the same package like all other compontent-classes.
    Thank you very much in advance
    Thomas

    Within web applications, I believe it is recommended to use Thread.getContextClassLoader(). Keep in mind that web applications require different classloader semantics than regular Java applications. The class loader which gets resources from the WAR is favored over others, even when this violates the normal class loading conventions.

  • How to load external png image via xml?

    Can anyone help me with adding a png image to a mc with an instance name.
    I only want to display a single image (no gallery)
    I would like to get the url for the image via an xml.
    Here is a copy of my current action script which has already pulled in the xml data which includes the node with the url for the photo.
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    var myXML:XML;
    var myLoader:URLLoader = new URLLoader();
    myLoader.load(new URLRequest("links.xml"));
    myLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(e:Event):void
        myXML = new XML(e.target.data);
        trace(myXML);
        menumv.carbtn.addEventListener(MouseEvent.CLICK, openCURL);
        menumv.edubtn.addEventListener(MouseEvent.CLICK, openEURL);
        menumv.psybtn.addEventListener(MouseEvent.CLICK, openPURL);
        menumv.stubtn.addEventListener(MouseEvent.CLICK, openSTURL);
        menumv.busbtn.addEventListener(MouseEvent.CLICK, openBURL);
        menumv.shabtn.addEventListener(MouseEvent.CLICK, openSURL);
        studentmv.stuname.text = myXML.student.name;
    function openCURL(e:MouseEvent):void
            navigateToURL(new URLRequest(myXML.car.url));
    function openEURL(e:MouseEvent):void
            navigateToURL(new URLRequest(myXML.edu.url));
    function openPURL(e:MouseEvent):void
            navigateToURL(new URLRequest(myXML.psy.url));
    function openSTURL(e:MouseEvent):void
            navigateToURL(new URLRequest(myXML.stu.url));
    function openBURL(e:MouseEvent):void
            navigateToURL(new URLRequest(myXML.bus.url));
    function openSURL(e:MouseEvent):void
            navigateToURL(new URLRequest(myXML.sha.url));
    And here is a copy of the node containing the url
    <menu>
        <student>
        <name>testnamehere</name>
        <photo>http://10.0.0.2/test/photos/testnamephoto.jpg</photo>
        </student>
    </menu>
    I did see this tutorial but it was for a gallery and I couldnt seem to hack and slash it to do what I want.
    http://tuts.flashmint.com/creating-a-simple-xml-gallery-in-actionscript3/
    Thanks again in advance for all the help.

    I have added that code but I think i have buggered up something else in the process.
    I get the following error
    ReferenceError: Error #1069: Property data not found on flash.display.LoaderInfo and there is no default value.
        at sdp_fla::MainTimeline/load_complete()
    Current AS
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    var myXML:XML;
    var myLoader:URLLoader = new URLLoader();
    myLoader.load(new URLRequest("links.xml"));
    myLoader.addEventListener(Event.COMPLETE, processXML);
    function processXML(e:Event):void
        myXML = new XML(e.target.data);
        trace(myXML);
        menumv.carbtn.addEventListener(MouseEvent.CLICK, openCURL);
        menumv.edubtn.addEventListener(MouseEvent.CLICK, openEURL);
        menumv.psybtn.addEventListener(MouseEvent.CLICK, openPURL);
        menumv.stubtn.addEventListener(MouseEvent.CLICK, openSTURL);
        menumv.busbtn.addEventListener(MouseEvent.CLICK, openBURL);
        menumv.shabtn.addEventListener(MouseEvent.CLICK, openSURL);
        studentmv.stuname.text = myXML.student.name;
    var _request:URLRequest = new URLRequest(myXML.student.photo);
    var _ldr = new Loader();
    studentmv.photo.addChild(_ldr);
    _ldr.load(_request);
    _ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, load_complete, false, 0, true);
    function openCURL(e:MouseEvent):void
            navigateToURL(new URLRequest(myXML.car.url));
    function openEURL(e:MouseEvent):void
            navigateToURL(new URLRequest(myXML.edu.url));
    function openPURL(e:MouseEvent):void
            navigateToURL(new URLRequest(myXML.psy.url));
    function openSTURL(e:MouseEvent):void
            navigateToURL(new URLRequest(myXML.stu.url));
    function openBURL(e:MouseEvent):void
            navigateToURL(new URLRequest(myXML.bus.url));
    function openSURL(e:MouseEvent):void
            navigateToURL(new URLRequest(myXML.sha.url));
    function load_complete(event):void
    var bitmap:Bitmap = Bitmap(event.currentTarget.data);
    bitmap.smoothing = true;
    bitmap.width = studentmv.photo.width
    bitmap.width = studentmv.photo.height
    studentmv.photo.addChild(bitmap)

  • Lenovo yoga 10" how to load docs and music

    just purchased this along with micro lead to usb. I have a click free storage HD and nothing happens when I connect it. How do I upload music and files to my Yoga? This is first time ever I used android and finding it rather strange.
    Also if poss, how do I stop it going into sleep mode so  quickly? I have ordered the keyboard44
    LENOVO 888015720 Yoga Tablet Case - Bluetooth Keyboard Cover for Blade10
    Is this going to be the only way to put stuff on my tablet via the keyboard?
    with only one micro connector, do I use this for playing an external speaker?

    After you plug the USB cable in to both the PC and tablet, pull down the tablet notifications. Look for the notification with the USB symbol beside it and select it, then choose 'Media device (MTP)'.  After that the tablet will show up in Windows Explorer like any other external drive. If you have an SD card in the tablet it will show up separately.
    To adjust the screen timeout go to Settings > Display > Sleep > select the one you want to use.
    There is a speaker jack on the right side of the tablet, directly opposit the power button.
    Note that my answers are for the B8000 Yoga 10 Tablet.

  • How to load item level and location level member in demantra

    This is in context where we are not using any integration of demantra with either Ebiz or E1 system.
    Data is present in flat file.
    As per i know, integration interface can only export the data for item level and location level but can not import data for these level.
    the second thing i know is that when we create data model then load_data.bat file should have been created in Demand Planner/Desktop directory. But this didn't got created. So i am not able to use load_data.bat file for uploading data.
    The third place ,i think is from worksheet thru edit method ( i am not sure about this).
    But i want to upload the data in bulk for item level and location level. Can it be done without any customization i.e without creating any sql loader file etc ??

    Hi Abhishek,
    The standard practice to load data for items/ locations and sales is through the DATA MODEL definition only. One should use LOAD_DATA.BAT file in normal scenario for loading data into Demantra staging tables from tEXT files.
    In case you are having trouble with loading data using LOAD_DATA.BAT file, then do the following:
    - modify your DM definition to Data tables instead of flat files
    - use SQL loader to upload data in correct format into Demantra's staging tables "T_SRC_XXX"
    - Run EBS Full Download workflow to download data into demantra's main tables.
    Integration interfaces should not be used to load basic sales data into Demantra.
    Hope this helps.
    Thanks
    Raj
    (http://oracledemantra.blogspot.com)

  • How to load second level nodes dynamically in jTree?

    Hi,
    I'm new to jTree & I want to load jTree with two levels of Hierarchy dynamically.
    First level nodes I loaded from the database directly.
    And regarding the second level nodes, I want them to be loaded only when I expand the first level nodes(on tree expansion), instead of loading it before-hand itself.
    I tried this in TreeExpansion event, but still my tree was not refreshed.
    Is there anyother way to do this .....?
    Thanks.
    G.

    Hi sangar;
    use method valueChanged() in ListSelectionEvent interface to notify tree selection change.

  • How to protect document level javascript against modification?

    Hi,
    Does Adobe Acrobat provide a possibility to password protect deactivation of the javascript code present in the pdf documentation?
    It seems that 3rd party tools, like PDFill or CutePDF can not password protect the document properly and it is trivial to deactivate the code by putting a new code inside, even if the document is master password protected agains modifications.
    Thanks for any information.

    There's nothing to protect against the determined. If you have critical security functionality, embedding it at client end is not the way forward.

  • How to load images from BLOB to javascript?

    hi, Guys:
    I need to load thumbnail images from BLOB to multiple markers' infowindow in Google map . I have implemented Google map in APEX. I load the data suchas text for every marker's infowindow from Oracle database table with PL/JSON, and infowindow works fine. Could anyone give me a suggestion or example so I know how to load images to javascript?
    Thanks a lot.
    Database: Oracle 11g R2
    APEX: APEX 4.1
    Thanks.
    Sam

    lxiscas wrote:
    hi, VC:
    Thanks for your kind reply. I need to render these images out of APEX session, actually in javascript that is related to Google map markers' infowindow.
    I checked the documents of APEX_UTIL.GET_BLOB_FILE_SRC, but my impression is I need to use it in APEX instead of javascript if my understanding is correct. I already implemented a procedure with PL/SQL to load images from a BLOB column in Oracle database. But the problem is, how can I pass it to javascript code out of APEX to javascript (I could pass text or number from APEX to javascript with PL/JSON though,But I assume that still google map will be within a valid apex session? if so you should be able to use the above api.
    Basically what this api does is generates a kind of url to each blob in the database, not sure how google api's deal with this though. Why don't you give it a try?
    The other option is to make your pl/sql procedure public and then you can generate the json to include the images urls such as:
         "employees" : [{
                   "firstName" : "John",
                   "lastName" : "Doe",
                   "imgSrc" : "http://somewhere/db_schema.your_download_proc?p_file=#ID#",
                   "firstName" : "Anna",
                   "lastName" : "Smith"
                   "imgSrc" : "http://somewhere/db_schema.your_download_proc?p_file=#ID#",
                   "firstName" : "Peter",
                   "lastName" : "Jones"
                   "imgSrc" : "http://somewhere/db_schema.your_download_proc?p_file=#ID#",
    }And then you can use this new attribute to populate the images in javascript using standard img tag
    See this tutorial http://docs.oracle.com/cd/E14373_01/appdev.32/e13363/up_dn_files.htm
    I did not find any method in PL/JSON to pass image object)? So far I only found example to load images from local files to javascript.Hmm..I don't think you should load image objects.
    Vikram

  • How to load custom root Xserve LaunchAgents on reboot

    One of our new Xserve'rs is running Snow Leopard, and I have taken the plunge and started rewriting cron jobs into launchd jobs. I have the user-level jobs running just fine, and have the username/Library/LaunchAgents/.launchd.conf successfully loading launchd jobs when the system reboots.
    Now, I have to run some launchd jobs as root (to permit rsync backup scripts to read/write user and system files with restrictive permissions). When I load the *plist files manually as root, all is good. But I haven't found out how to load root-level *plist files on reboot. I have tried putting the *plist launchd jobs in /System/Library/LaunchAgents, and I have tried putting them in the root user /var/root/Library/LaunchAgents with the accompanying .launchd.conf file.
    How do I get my launchd jobs that need to run as root to load on reboot?

    Dave,
    I am by no means an expert, but on Leopard server I have used Lingon to configure the regular script calls I needed (I had used cron jobs so had to switch when upgrading to 10.5). It has an assistant to create the plist files and knows where to put them and I believe it did for me what you are looking for.
    Cheers,
    Michael.

  • Is there a way to respond to Doc/Open events from a folder level javascript?

    I'm wondering if there's a way to respond to Doc/Open events from a folder level javascript. If not, is there a way to programatically add a Document javascript to a PDF upon/after export from InDesign?
    Thanks-
    Jeremy

    Bernd,
    Thanks for your reply. I take what you write to mean that I can add a document-level javascript manually once the PDF is exported. But this is what I'm trying to avoid.
    Ideally, I want to respond to Doc/Open events from a folder level javascript, but I'm not sure if/how I can make an event listener with Acrobat JS. If I can't do that, then I'm looking for a way to programatically add a Document level javascript upon export from InDesign - not manually within Acrobat, once the PDF is created.
    Any thoughts?

  • How to load XML File to BW Delta Queue via Webpage

    Hello altogether,
    I am trying to load an CSV file via Webpage (the Webpage have to change the csv file in a xml/soap file) into BW Delta Queue.
    Steps that I have made:
    - Create an InfoSource
    - Create an BW Data Source with Soap Connection
    - Create an initial Delta without Data Transfer
    - Create a Web Service with TC - SE37 - Utilities -> More Utilities -> Create Web Service
    If I test the Web Service with TC - Soamanager (BW 7.0), the data entered here, are transferred to the BW Delta Queue.
    If I test the function module ( TC - SE37), the data also transferred to the Delta Queue.
    Now I think, that I have an error in the html file or the html file is not conform to the wsdl document?? Or should I have to create a virtual interface, but I don't find a possibility to creat it...???
    Can you please help me????
    The coding of the WSDL Document and the Website is attached (I can also send you the coding and error message via mail, if you want). Sorry I don't know how to display here the coding. I try it with symbol "click to display the text code", but afterwards I get an error message from the website...   So let me please know your mail address and I send it via mail....
    I hope, that somebody can help me!!!!!
    Edited by: Alina99 on Sep 8, 2009 11:44 AM
    Error Message from BW:
    ...sap-env:envelope..... soap-env:body><soap-env:fault><faultcode>soap-env:Client</faultcode></faultstring xml:lang="eng">Virtual Interface Method&gt;_-BI0_-QI6AZ_XML_APPL2_RFC::urn:sap-com:document:sap:soap:functions:mc-style&lt;not supported</faultstring>.......
    Edited by: Alina99 on Sep 8, 2009 11:56 AM

    Hello,
    I have done all the necessary config in BW. However, as I mentioned earlier, we are still not up with XI so I am trying to load XML to BW delta queue.  The question still remains, how do I make make the XML file (on my desktop say) point to the BW so the InfoPackage picks up and places in the delta queue?  Even if I had XI, there has to be a way whereby BW looks for the XML file.  That is what I want to know and stuck at.
    Any detailed step by step help will be appreciated as always.
    Cheers

  • How to load BeginningBalance and movements into HFM via FDM from ERPI

    I have a file generated by ERPI with the columns of |AMOUNT|BEGIN_BALANCE_DR|BEGIN_BALANCE_CR|PERIOD_NET_DR|PERIOD_NET_CR|
    among many other columns.
    How can load them via FDM into the Custom1 dimension in HFM, which contains BeginningBalance, Additions, Disposals, etc.
    So basically I will have a trial balance, which I can compare with GL and OBI.

    Hello
    You can use the IDOC SOPGEN01 for that purpose.
    Please check transaction WE60 for IDOC documentation and there are many old threads with information about this IDOC.
    BR
    Caetano

  • How do I write a javascript code to open InDesign File, import Doc, save and export to pdf?

    How do I write a javascript code to open InDesign File, import Doc, save and export to pdf?

    Hi hasvi,
    Need Template(.indt), textframes etc for the following script:
    var myFolderInd = Folder.selectDialog();
    var myFile = myFolderInd.getFiles("*indt");
    app.open(myFile)
    var myDoc = app.activeDocument;
    var myDocName = myDoc.name;
    var mySaveFile = app.activeDocument.save(myFolderInd.fsName + "/" + myDocName.split(".indt").join(".indd"));
    var myFolderDoc = Folder.selectDialog();
    var myFile1 = myFolderDoc.getFiles("*doc");
    mySaveFile.pages[0].textFrames[0].place(File(myFile1))
    //~ mySaveFile.place(File(myFile1))
    app.activeDocument.textPreferences.smartTextReflow = true;
    var myPDFFile = new File(mySaveFile.filePath + "/" + mySaveFile.name.split(".indd").join(".pdf"))
    myDoc.exportFile(ExportFormat.PDF_TYPE, File("~/Desktop/abc.pdf"));
    alert("Process Completed")
    Regards
    Siraj

  • I have loaded windows 8.1 via bootcamp on my macbook air 11 inch how can i adjust font size etc

    I have loaded windows 8.1 via bootcamp on my macbook air 11 inch how can i adjust font size. I have to do a lot of work in office 2013 and it is very very difficult to see the screen.
    Thank you

    Microsoft store will provide a download manager (.exe) using your Product Key, which needs to be run on a PC. This manager will then let you download an ISO image to a USB and/or DVD.

Maybe you are looking for

  • Grey screen on start up

    hey guys i've got a big problem with my mac.. my mum dropped my laptop from the chair while it is opened and turned on. It hung, so i did a cold reboot by pressing the power on button.. When it started up.. it just showed a grey screen then a folder

  • Help With Api

    Hi, I have a school project to do about a digitial circuit simulator. i am done most of the parts but i am having a problem with the junit.FrameWork.assert library. The following code gives me an error near assertFalse. public void testSimpleLine() {

  • Background Image Support?

    i recently purchased a Creative Vision M (i also have a 30gb ipod video) and it allows you to select an image as your background while music is playing. i actually thought it would effect the battery life, but it really didnt. any chance apple can sh

  • CS6 update problem

    I have Photoshop CC and Photoshop CS6 running on Mavericks. CS6 will not update. How do I get CS6 to Update?

  • Is there a way to add an outline to a shape made using brush tool with Actionscript 3.0?

    I'm animating a character. I've made body parts by making a rectangle, removing the line outline, then adding extra sides by holding the Alt key and dragging out to make the shape I desire. I prefer not to make all the shapes I make into symbols beca