Acrobat scripting object this.hostContainer is undefined when pdf is in Air

Hi,
I'm attempting to use the Adobe Acrobat hostContainer object
to create a simple interface to allow my Adobe Air application to
move between pages of an embedded pdf doc. However the output I get
indicates that the hostContainer object is undefined. The script
works correctly when the pdf is embedded in a stand-alone html
file, but not in Air.
I have Adobe Acrobat 9.0 and Adobe Reader 9.0 installed. It
does not seem to be an issue with on machines with Adobe 8.0.
My code in the document javascripts of the pdf is as follows:
this.disclosed = true;
if(this.external && this.hostContainer){
try{
this.hostContainer.messageHandler={
myDoc:this,
onDisclose:function(){return true;},
onMessage:function(stringArray){
var cmd=stringArray[0];
try{
if(cmd=="nextPage" &&
this.myDoc.pageNum<this.myDoc.numPages){ this.myDoc.pageNum++;
}else if(cmd=="previousPage" && this.myDoc.pageNum>0){
this.myDoc.pageNum--;
}catch(e){
this.hostContainer.postMessage(
["error thrown in onMessage:",e.message]);
onError:function(e){
this.hostContainer.postMessage(["onError: ",e.message]);
}catch(e){
this.hostContainer.postMessage(["Error thrown in
setup:",e.message]);
}else{
app.alert("unable to set up hostContainer:
this.hostContainer="
+this.hostContainer+" this.external="+this.external);
The output is that the pdf displays correctly then the alert
box pops up with [...]this.hostContainer=undefined
this.external=true.
If anyone has seen this issue or has any ideas it would be
much appreciated.
I've also posted about this problem in the Acrobat Scripting
forum with no solution as yet.
Thanks,
Simon Kelly

It seems that this issue was registered one month ago into the bug tracking system:
http://bugs.adobe.com/jira/browse/FB-16281?page=com.atlassian.jira.plugin.system.issuetabp anels:comment-tabpanel
Any update / workaround / planning so far ?
The only solution I found is to use version 8.1.3 of the reader.
Thanks,
Philippe

Similar Messages

  • This.hostContainer is undefined when pdf is in air

    Hi,<br />I'm attempting to use the hostContainer object to create a simple interface to allow my Adobe Air application to move between pages of an embedded pdf doc. However the output I get indicates that the  hostContainer object is undefined. The script works correctly when the pdf is embedded in a stand-alone html file, but not in Air.<br /><br />My code in the document javascripts of the pdf is as follows:<br /><br />this.disclosed = true;<br />if(this.external && this.hostContainer){ <br />  try{<br />    this.hostContainer.messageHandler={<br />     myDoc:this,<br />     onDisclose:function(){return true;},<br />     onMessage:function(stringArray){<br />       var cmd=stringArray[0];<br />        try{<br />               if(cmd=="nextPage" && this.myDoc.pageNum<this.myDoc.numPages){<br />                   this.myDoc.pageNum++;<br />               }else if(cmd=="previousPage" && this.myDoc.pageNum>0){<br />                   this.myDoc.pageNum--;<br />               }<br />             }catch(e){<br />               this.hostContainer.postMessage(<br />                   ["error thrown in onMessage:",e.message]);<br />             }<br />         },<br />         onError:function(e){<br />             this.hostContainer.postMessage(["onError: ",e.message]);<br />         }<br />    }<br />  }catch(e){<br />    this.hostContainer.postMessage(["Error thrown in setup:",e.message]);<br />  }<br />}else{<br />    app.alert("unable to set up hostContainer: this.hostContainer="<br />        +this.hostContainer+" this.external="+this.external);<br />}<br /><br />The output is that the pdf displays correctly then the alert box pops up with [...]this.hostContainer=undefined this.external=true.<br /><br />If anyone can shed some light here I would be most grateful.<br /><br />Thanks,<br />Simon Kelly

    It seems that this issue was registered one month ago into the bug tracking system:
    http://bugs.adobe.com/jira/browse/FB-16281?page=com.atlassian.jira.plugin.system.issuetabp anels:comment-tabpanel
    Any update / workaround / planning so far ?
    The only solution I found is to use version 8.1.3 of the reader.
    Thanks,
    Philippe

  • Acrobat Script Object

    Hello,
    I have xdp forms dedicated for WF in the Livecycle Workflow server.
    The user has only a dynamic PDF format.
    In my forms, I have some scripts that use the Acrobat objects scripts:
    -XMLData.parse
    -XMLData.applyXpath
    Since they are not XFA objects scripts, I cannot play them at the server.
    Is it possible to execute them at client-side only based on the Acrobat Reader?
    Or another solution that does not use the Reader Extensions?
    Thanks in advance for your feedbacks.
    Best Regards,
    tina

    Hi all,
    Thank you for your first answers.
    I uploaded my forms in the Workflows with which they are supposed to work with.
    What is strange, is that the scripts with XMLData.parse and XMLData.applyXpath do not work in the workflow context.
    neither client-side or server-side.
    I mean when I test my forms standalone via the Form Designer PDF preview (with Acrobat Pro and Acrobat Reader),
    the execution of the scripts works.
    But when I access the form via the Form Manager to start a workfow:
    the scripts are not done.
    Is it normal that these 2 functions, do not work in Workflow context but work in a form standalone?
    Thank you for your help,
    Best Regards
    Tina

  • Acrobat 8.1.4 Launches but crashes when .pdf is opened

    Warning comes on "Sorry for inconvenience..." stays open for 30 seconds then crashes.  When I look into warning details it mentions acrobatfnp.dll.
    I'm running XP serice pack 3.  Any ideas folks?
    Jays42

    Your welcome.
    Another tip:
    If you have more than one version of acrobat  6,7,8, 9 ...
    use same procedure ask I outlined above.
    Now open the latest verion of acrobat you have loaded.
    Now have it reinsall the PDF printer as outlined above.
    Now an version of Acrobat can use any newer version of the Adobe PDF Printer, but will only use the features built into that version of Acrobat. Any newer features in the PDFversion simply will not be used.
    Having more than one copy of the Adobe PDF Printer can cause Strange problems.
    This only applies to Mac version of Acrobat. Because Mac's install each newer version into a new Directory. Last information I heard you can not have more than one version of Acrobat due to Registration keys.

  • Acrobat 7.0 Pro on Vista freezes when PDF from Multiple

    I try to create a PDF from multiple files and Acrobat just sits there looking stupid. I've checked for updates - Fully updated. It's from my CS2 Premium Professional edition. I have it installed on a Dell e1705 with Vista Home. Dual Processor, but still a 32 bit system. 2GB of ram and a 256 memory card.
    I look at the Task manager and the program is using about 22mb of memory. After I select the create PDF form multiple files the program stops like it is about to do something. Vista doesn't register the program as not responding so it's doing something. The CPU usage is at about 50% and stays that way for at least 15 minutes. I just got tired of waiting and closed it in the task manager.
    How do I fix this?

    It is interesting that you say it is an Adobe bug (or at least that is the implication I got). Part of the problem with VISTA has been that there are a lot of programs that do not work. That is also why many businesses and individuals are still using XP and refused to upgrade. VISTA has a service pack out, but I hear it still has lots of problem. MS has fixed VISTA where there own software was concerned, such as putting the help system back in that they had removed. I am not trying to say that VISTA is not the way to go, but that the blame for things not working should not be put on other software developers.
    The $1500 must be for CS, since an upgrade to AA8 from AA7 is only $159. In today's market, AA7 is actually an old man with AA8 being out for quite a while. Six months ago you could still get XP Pro for about $190. I understand it is now almost $800, but I really don't track the prices. I am getting a new machine with VISTA on it in a week or two and plan to look at it a bit (called give it a chance). However, I fully expect to remove VISTA and install XP Pro. To me, that cost is a lot better than upgrading all of my software because of the changes in Windows.
    So which system has the bug, Adobe or VISTA. I think you will find a lot of folks who say it is VISTA (that is not to say that Adobe doesn't have some issues also). Hope you get your system working satisfactorily.

  • This.hostContainer problem

    I don't understand why if(this.external && this.hostContainer) returns true when my PDF is embedded in an HTML document, but if I change the file to an HTA (trusted) document, this.external is still true, but this.hostContainer returns undefined.  Since an HTA is just a trusted web page running on IE, why doesn't the hostContainer property work?  Is there a workaround?
    Thanks,
    Scott

    No, it does work inside an HTML document as the undefined evaluates to false.  If I change the HTML page into an HTA page, this.hostContainer has no properties and is undefined when it should not be.

  • Acrobat 8 Pro - White haze layer over all pdfs

    Hi,
    I have Acrobat 8 Pro. When I open a PDF it has a white semi-transparent layer that covers the PDF. The PDF opens normally at first, all the images show up and it looks right and then a white layer covers everything making it kind of hazy. All the PDFs look correct on my co-workers computers, all running Acrobat 8 Pro as well. For some reason my Acrobat is displaying this layer. All my PDFs print normally when I send the files to press. They look normal on other peoples computers, so what setting do I need to enable / disable to stop viewing this transparent haze layer????
    Any help would be great! Thanks.

    First I would try Detect and Repair on the help menu.
    Then I would try to uninstall and reinstall to begin with.

  • Acrobat standard 9.0 error while enabling commets option using Java script object

    I'm using the below java script code in my VB 6.0 application for enabling commets options in the PDF file
    Dim oJSO As Object
    Set oJSO = mPDDoc.GetJSObject
    oJSO.Collab.showAnnotToolsWhenNoCollab = True
    It is working fine till Acrobat 8.0. Now I'm trying with Acrobat 9.0 standard edition, it is throwing scripting error 'An unhandled Win32 exception occured in Acrobat.exe[308].
    Can anyone suggest the way to enable 'comment' options in Acrobat Standard 9.0 using Java Script Object?
    Thanks

    I get much the same problem with VB6, Acrobat 9 Pro and WinXP SP3. When I single step the line:
    oJSO.Collab.showAnnotToolsWhenNoCollab = True
    in debug I go to the error handler for my Sub. Inspecting the VB Err object has Number = -2147417851 and Description = "Automation error
    The server threw an exception." I get a Microsoft crash notice about Acrobat a short while later.
    I've experimented with the JavaScript debugger in Acrobat and you can execute Collab.showAnnotToolsWhenNoCollab = True and reference the value of Collab.showAnnotToolsWhenNoCollab in the console. The problem appears only when accessing Acrobat Javascript through the Interapplication Communication API.
    If anyone can help it would be appreciated. I tried Adobe's Acrobat support and they were no help at all.

  • Internet Explorer 11: Script Error - An error has occurred in the script on this page? Line: 9, Char: 6, Error: 'animationScript' is undefined ...

    Using Internet Explorer 11:
    Suddenly, about two days ago, I started getting a Script Error message from almost every page I visit on Internet Explorer 11 and now it has affected my printing while in my Outlook/Hotmail account?  What is an absolute fix for this irritating
    Script Error message? I have to use Firefox to get by this problem which I do not much care for. What can I do to resolve this problem ASAP?
    Here is one full Script Error Message
    "An error has occurred in the script on this page.
    Line:     9
    Char:    6
    Error:  'animationScript' is undefined
    URL:   
    https://sc.imp.live.com/content/dam/imp/surfaces/mail_signin/3/mai/EN-CA
    Do you want to continue running scripts on this page?
               Yes    No
    Can someone please, please help me.  I have tried many things - doing a Restore, running Microsoft Safety Scanner.  Checking my Tools>Internet Options.  Running FixMeStick.  Nothing works to fix this problem.  Please what is the
    correct answer to this problem.  I have had to switch temporarily to Firefox to get by this Script Error Message.
    - thanks - needhelpnowbfm

    Windows version is...?
    What pages are giving you problems? [post links to same]
    Are you getting the script errors only when attempting to print or...?
    Has your printer's manufacturer confirmed that your currently installed printer software is IE11-compatible (yet)?
    ~Robear Dyer (PA Bear) MS MVP-Windows Client since 2002 Disclaimer: MS MVPs neither represent nor work for Microsoft

  • Script Objects Disappearing when 2 or more XDP's are stitched together

    We use Adobe Form Server.
    We would like to use Script Objects in our forms. Unfortunately, when we stitch two or more forms together, only the first script objects [contained in the first form] remain. The other script objects [in each additional form] fall off.
    The script objects are unique to the form and are named differently (ie. "GlobalFunctions_8190" vs "GlobalFunctions_200878").
    How can we correct this? Is it how the Form Server was set up?
    Please help.

    Just in playing with it, I added an extra ${endif} at the end of the network section and the error went away.   Since I only have one network connection, I don't know if it breaks something else or not.

  • Whenever I use facebook I'm getting this error message [Java Script Application] Error: options is undefined whenever I click on a link. What can I do to fix this problem? Easy step by step instructions please.

    When I use facebook, I keep getting this message [Java Script Application] Error: options is undefined whenever I try to return something, click on a link, or message, open a game, etc. ... I have Windows 7, addons of greasemonkey and better facebook (which seems to have disappeared)
    == URL of affected sites ==
    http://www.facebook.com/reqs.php#!/?ref=home

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    You have to close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • Script Object when rendering to HTML

    Hi,
    I am developing a form that requires the same script to be reused many times. This form is going to be rendered out to HTML through Workflow, and I'm not sure how to access a script object when rendering to HTML. The root of my form is MISForm so I tried this:
    MISForm.variables.getXML.getXMLDoc("http://lcwftest:8080/services/getEmployeeInfo?method=s ynchronousInvoke&empnum="+this.rawValue);
    getXML being the script object and getXMLDoc being the function. But this returns MisForm is not defined.
    I also tried a reference straight to the object
    getXML.getXMLDoc("http://lcwftest:8080/services/getEmployeeInfo?method=synchronousInvoke&e mpnum="+this.rawValue);
    but that also returned "is not defined"
    How do I reference the script object.

    I believe it gets something like
    xfa.resolveNode("MISForm").getXML.getXMLDoc...
    It also depends on if your script object is located in the root or if it is located within your page if you understand what I am trying to say. With pdf you can have a global script and reference it on each page but with html I would be more than happy if you find a solution on it... you have to have the script object on each page.

  • I upgraded to Firefox 4. Whenever I click on the firefox icon, msg appears - "ug-in object: TypeError: id] is undefined". Only when I click OK will Firefox open up and then work as per normal. How do I get rid of error msg.

    I use an iMac OS X 10.6.7. After I upgraded to Firefox 4, this problem occurs.
    Whenever I click on Firefox icon, message appears - "ug-in object: TypeError: id] is undefined". Only after I click "OK" in the error message, does Firefox open it and I can use it to browse as per normal.
    I notice it took a long time to open up some websites.

    That indicates that you are using an add-on that is not compatible with Firefox 4. For details of how to troubleshoot this to find out what one is causing the problem see https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • When printing I get notation:"An error has occurred in the script on this page"

    when printing I get notation:"An error has occurred in the script on this page", error 1791-Char 1- error invalid argument-Code 01-Can print Word, but not Web pages. Have Windows 7, Home and Internet Explore 10. Please help

    Sorry that you are having a problem with the script error. 
    Try to clear your CACHE and COOKIES on your internet. 
    Are you able to print from another program, such as Firefox, Google chrome, etc?
    Let me know if it prints. 
    **Click the KUDOS star on the left to say 'Thanks'**
    Please mark a reply "ACCEPTED AS SOLUTION" if it solved your problem, so others can find it.

  • So I  downloaded acrobat XI Standard from the Adobe website, when I go to install it, it says "Adobe XI Pro" at the top left corner. Can anyone shed some light on this for me? I have a volume license for XI Std. so I would like to use the Std. version.

    So I  downloaded acrobat XI Standard from the Adobe website, when I go to install it, it says "Adobe XI Pro" at the top left corner. Can anyone shed some light on this for me? I have a volume license for XI Std. so I would like to use the Std. version.

    login and download your software from the adobe volume licensing website, Customer resources | Adobe Buying Programs

Maybe you are looking for