App.openDoc error in browser

I have created a javascript that I use to add links to a pdf that opens another pdf file. The script works fine in Acrobat and Reader, but not when the pdf is displayed through a web site using Internet Explorer. I set the disclosed attribute and have gone over the reference and forums. I attached the code, below. Does anybody have any ideas? Thank you.
app.addMenuItem( { cName: "LinkBatch",
cUser: "Process Multiple Links ...",
cParent: "Document",
cEnable: "event.rc = (event.target != null);",
cExec: "LinkBatch();" });
function LinkBatch()
console.show();
app.trustedFunction(UpdLinks("12", "a3.cl.1_fac_7.pdf", this));
function UpdLinks(lnam, lloc, doc)
app.beginPriv();
try
console.println("processing " + lnam);
doc.removeField(lnam);
for (var p = 0; p < doc.numPages; p++)
var numWords = doc.getPageNumWords(p);
for (var i=0; i<numWords; i++)
var ckWord = doc.getPageNthWord(p, i, true);
if (ckWord == lnam)
var q = doc.getPageNthWordQuads(p, i);
m = (new Matrix2D).fromRotated(doc,p);
mInv = m.invert()
r = mInv.transform(q)
r=r.toString()
r = r.split(",");
l = doc.addLink(p, [r[4], r[5], r[2], r[3]]);
l.borderColor = color.blue
l.borderWidth = 1
l.setAction("app.openDoc('" + lloc + "')", doc);
catch (e) { app.alert(e) };
app.endPriv();

Have you looked at the contents of the URI address for the link?
Is the URI address available to the user on the web?
Have you carefully read the JS Api Example 5 for the "app.openDoc()" method?
Example 5 (Acrobat 7.0)
Open a file from a WebDAV server. The app.openDoc method requires the path to the file to be escaped.
var myURL = encodeURI("http://www.example.com/My Folder/ComDoc.pdf");
app.openDoc({cPath: myURL, cFS: "CHTTP" });

Similar Messages

  • Problem with checking file existence by using app.openDoc

    Hi Folks,
    I have to create a script for a big project with many PDF's. (Just like Ingrimm - it's the same company http://forums.adobe.com/thread/747022?tstart=0) This PDF's are made of scanned images. I need to rename the files to names that are extracted from within the file. This is working without problems.
    Now there could be the case, that a filename exists already. I don't want the files to be overwritten, so the idea is, that already existing filenames are saved as filename_1, filename_2, etc... (Before I merged them, but this isn't what is wanted.)
    For this reason I need to use app.openDoc to check, if a file exists. Yesterday my script worked fine, but after starting it today, I discovered that it started again to overwrite files which are already existing.
    I added an app.alert to my catch method to see what error is thrown. The message is: 'NotAllowedError: Security settings prevent access to this property or method.'.
    After using google, I found out, that Acrobat is not finding any files. But I checked and there are files which should be doubled.
    I have no idea how to fix that problem. Anybody here who can help me?
    Regards,
    Steffi
    * regular expression for search
    var idNumber = /08\d\d\d\d\-\d\d\d\-\d\d\d\d\d-\d\d\d/g;
    * if possible this function extracts the searched number as string
    * @param rematch string which should be searched in document
    * @return null if rematch is not found or string if rematch is found
    function ExtractFromDocument(reMatch) {
      try {
             var Out = new Object();
             for (var i = 0; i < 1; i++)
              numWords = this.getPageNumWords(i);
              var PageText = "";
              for (var j = 0; j < 30;j++) {
                  var word = this.getPageNthWord(i,j,false);
                  PageText += word;
              var strMatches = PageText.match(reMatch);
              if (strMatches == null) continue;
          return strMatches;
      } catch(e)
          app.alert("Processing error: "+e)
    * tries to load given filename (extracted number)
    * @param filename string of file which should be checked
    * @param n number to iterate while checking for files
    * @return true if file exists or false if not
    function checkIfFileExists(filename, n) {
        var existingDoc = false;
        try {
            if( n == 0) {
                var checkDoc = app.openDoc({cPath : "../GAG-out/"+filename+"-001.pdf"});
            } else { 
                var checkDoc = app.openDoc({cPath : "../GAG-out/"+filename+"-001_"+n+".pdf"});
            checkDoc.closeDoc();
            existingDoc = true;
        } catch (e) {  
             app.alert("Processing error: "+e)
        if( existingDoc == true ) {
            n = n+1;
            n = checkIfFileExists(filename, n);
        return n;
    var filename = ExtractFromDocument(idNumber);
    if(filename == null || filename == undefined) {
      filename = Math.round(Math.random()*999999999999);
      this.extractPages({nEnd:(this.numPages-1), cPath : "../GAG-out/n_"+filename+".pdf"});
    } else {
        fileExistence = checkIfFileExists(filename, 0);
        if(fileExistence != 0) {
            this.extractPages({nEnd:(this.numPages-1), cPath : "../GAG-out/"+filename+"-001_"+fileExistence+".pdf"}); 
        } else {
            this.extractPages({nEnd:(this.numPages-1), cPath : "../GAG-out/"+filename+"-001.pdf"});

    Sorry, I marked it as bold text but unfortunately it happens to be unformatted
    It's the app.openDoc within my function checlIfFileExists:
    try {
            if( n == 0) {
               var checkDoc = app.openDoc({cPath :  "../GAG-out/"+filename+"-001.pdf"});
            } else  { 
               var checkDoc = app.openDoc({cPath :  "../GAG-out/"+filename+"-001_"+n+".pdf"});
             checkDoc.closeDoc();
            existingDoc = true;
         } catch (e) {  
             app.alert("Processing  error: "+e)

  • App.openDoc works in Acrobat, not in Reader

    In a folder-level script I'm using app.openDoc to open an existing PDF and extract an icon from it. The following code works in Acrobat 11 but in Reader X I get a NotAllowedError: Security settings prevent access to this property or method error.
    this.disclosed = true;
    myIcon = app.trustedFunction(function (oArgs) {
         app.beginPriv();
         var pluginPath = app.getPath({ cCategory: "app", cFolder: "javascript" });
         var myDoc = app.openDoc({ cPath: pluginPath + "/MyImages.pdf", bHidden: true });     // <----- error happens on this line
         var oIcon = util.iconStreamFromIcon(myDoc.getIcon("myIcon"));
         app.endPriv();
         return oIcon;
    The MyImages.pdf exists in the same Javascripts folder as the javascript file. I created MyImages.pdf manually via the console and set disclosed=true before saving it.
    I've also tried modifying the call to app.openDoc to set oDoc:this (as recommended in other discussions) but that only caused the same NotAllowedError in both Acrobat and Reader.
    Any ideas?

    It gets called from the top level of the javascript file. Here's an example -- the exact contents of my javascript file -- where I simply load the icon and display the width in a pop up alert. If I open a PDF from the file system then this generates the same NotAllowedError during the call to app.openDoc(). But, if I launch Reader and wait before opening the PDF, the code runs fine and the correct icon width gets alerted to me.
    var myIcon = app.trustedFunction(function () {
          app.beginPriv();
         var pluginPath = app.getPath({ cCategory: "app", cFolder: "javascript" });
         var myDoc = app.openDoc({ cPath: pluginPath + "/MyImages.pdf", bHidden: true });     // <----- error happens on this line
         var oIcon = util.iconStreamFromIcon(myDoc.getIcon("myIcon"));
          myDoc.closeDoc(true);
          app.endPriv();
         return oIcon;
    app.alert(myIcon.width);

  • Using app.openDoc with LC field as path

    Using LC ES2, Acrobat X.
    I was hoping someone might be able to point me in the right direction.  Synopsis:  I have a LC form that I use to import parent/child XML data. This form is a report, but it is basically a summary of a group of PDFs that I send off to my clients (on CD).  Each child record has a field containing the name of its corresponding PDF file.  I have been trying my best to make a link that will open the child file in a new Acrobat window.  I've used app.openDoc, but cannot seem to pass my field into the cPath. I've even tried using the "address" of the field containing the path. Example:
    app.openDoc({cPath:TextField1.rawvalue,oDoc: this});
    I've tried the device independent paths as well as just "filename.pdf", where both source and targets were in the same folder.
    I thought one of my attempts was going to work, but I got the "NotAllowedError: Security settings prevent access to this property or method." message in the debugger.
    This brings me to disclosed=true.  Is is still the case that all of the target PDFs that I am linking to need to have this property set?  Or, am I missing something alltogether here?

    Sorry, I marked it as bold text but unfortunately it happens to be unformatted
    It's the app.openDoc within my function checlIfFileExists:
    try {
            if( n == 0) {
               var checkDoc = app.openDoc({cPath :  "../GAG-out/"+filename+"-001.pdf"});
            } else  { 
               var checkDoc = app.openDoc({cPath :  "../GAG-out/"+filename+"-001_"+n+".pdf"});
             checkDoc.closeDoc();
            existingDoc = true;
         } catch (e) {  
             app.alert("Processing  error: "+e)

  • App.openDoc unpredictable results

    Hi
    I'm trying to create a simple button that opens a PDF attachment (one of several). I use the following code:
    app.openDoc("my.pdf");
    This worked for one PDF but not others, all of which I have created in the same way. I tried inserting this.disclosed = true in the attachment doc scripts, (and tried app.this.disclosed). But this makes no difference. Strangely, I found that opening the attached file from the Attachments panel, running the PDF optimiser on it as far as saving, and saving the file in a new location then cancelling the optimiser, caused the attached files to load once I returned to the main PDF. However, on saving and closing the main PDF and reopening it, I'm back to square one, but no files open now, not even the original attachment. And now I can't use the optimiser workaround to make the others work. I've tried creating new files from scratch and reading the Acrobat scripting resources, but can find nothing to help me.
    Many thanks
    Kev

    Hi
    I think I've solved it.
    This works:
    this.exportDataObject({ cName: "Untitled Object 3", nLaunch: 2 });
    Attachments made via the UI are automatically given the names "Untitled Object"; "Untitled Object 1"; and so on. As long as the attachment list is not re-sorted, these names match the order in the attachment list, which is the order in which the files were attached.
    This script helped me see in the JS debugger what attachment names were in use:
    var d = this.dataObjects;
    for (var i = 0; i < d.length; i++)
    console.println("Data Object[" + i + "]=" + d[i].name);
    However, I'm not sure how to work out which is which if you have multiple attachments that have been re-sorted other than by trial and error.
    Thanks for the help that pointed me to this solution.
    Kevin

  • App.openDoc issue

    In prior versions of Acrobat, calling "app.openDoc({cPath:pathToPDF, bHidden:false})" would open the desired document in Acrobat with all tools available.  However, in Acrobat X, the first time I call this method Acrobat opens with a menu bar, but only a subset of the tools.  Form tools are completely unavailable and can't be accessed unless I close Acrobat and re-open the document manually.  The second time I call the method Acrobat opens with no menu bar at all.  I don't understand why the behavior is different from one call to another or why the tools are limited.  Is there a work-around for this problem?  Also, I noticed the same behavior when launching documents inside a browser window.  Any insight is appreciated.

    That sounded like a reasonable assumption, however in Read mode you have no tool/menu bars.  When the document opens, I actually have a menu bar (the first time I call the method), but "Tools" is missing and can't be added back.  I can press control+H to enter and exit reading mode, but the Tools are still not available.

  • Scrabble app network error

    For over a month the Scrabble app will not load - says Network Error connecting to Facebook but IS connected. Have deleted and reloaded app countless times, refreshed browser, reset iPad - no joy. Help!

    Yatzpye wrote:
    For over a month
    the Scrabble app will not load - says Network Error connecting to Facebook
    but IS connected.
    Have deleted and reloaded app countless times, refreshed browser, reset iPad - no joy. Help!
    You have given several clues...
    What event preceded the issue? Update? Add App(s)? anything.
    This is not an Apple issue - squarely the bailiwick of the developer
    I'll take your word that you are able to use FaceBook normally, but the in App connection is likely different server(s)
    This tells us:
    Not necessarily the App
    Not necessarily  the browser
    Not necessarily the iPad
    That really leaves the Scrabble.app and/or its communication with its server
    Contact Electronic Arts' SCRABBLE Free Support (from the iTunes App Store page > https://itunes.apple.com/us/app/scrabble-free/id501724085?mt=8 )
    However, that link seems to be to an erroneous Help page. Try this one > http://help.ea.com/en/search/?q=Scrabble+iOS and if still no joy use the big [Contact Us ] button at the bottom of the page (it seems to be smart enough to log the page you are 'contacting from)
    ÇÇÇ

  • More about app.openDoc

    Hi,
    being a bit further with my work on app.openDoc thanks to the help of this forum, I'm a bit puzzled about the following problem:
    var mainDoc = app.openDoc(mainDocPath);
    //var mainDoc = app.openDoc("/C/myDoc.pdf");
    app.alert(mainDoc);
    In this example "mainDocPath" is a valid path and the document opens. Anyway mainDoc is being evaluated as "undefined".
    When I use the commented line instead, the alert displays "[Doc_Object]" as I would expect.
    What is going wrong here?
    Thanks for any help.

    I have been breaking down complexity a bit further.
    Two documents: C:\Control.pdf and C:\Main.pdf.
    The control document has a document level javascript "TestCall" with content:
    function TestCall() {
        mainDoc = app.openDoc("/C/Main.pdf");
        //this.closeDoc();
    TestCall();
    The main document has a javascript "SetDisclosed" with content:
    function SetDisclosed()
        this.disclosed = true;
    When I run the control javascript while the document is open, everything is fine and it opens the main document. If the javascript runs on document initialization, I get the "NotAllowedError".
    If I change the line "mainDoc = app.openDoc("/C/Main.pdf");" to "mainDoc = trustedOpenDoc("/C/Main.pdf");", i.e. running the folder level script
    trustedOpenDoc = app.trustedFunction(
         function(pPath) {
              app.beginPriv();
              var trustedDoc = app.openDoc({
                   cPath: pPath,
                   bUseConv: true
              app.endPriv();
              return(trustedDoc);
    everything is still fine when run from the opened control document.
    When it runs at document initialization, I get an error dialog stating that an error occurred when opening the document because of an "invalid action object" (this is in german language and I don't know the exact words that it will show in an english language version).
    That can't be the intended way of functionality, can it? When reading through the forums, I get a feeling like many people do what I want to do and there is only one more little hint missing and there will be prospering landscapes for my programming efforts if this could be solved. Unfortunately I can't find the point myself and can't see sense and meaning in that ugly behaviour.
    I already had the idea that the folder level scrips might not already be loaded when the trusted function is called at document initialization and tried it in a loop with a try/catch construction, but it was never working at document initialization.
    Any more hints?

  • I upgraded from iPhone 3GS to iPhone 6.  Everything converted fine until I deleted an app in error.  When I downloaded it from iTunes, my account is no longer recognized by the app's host servers.  Can I go back and re-sync one app from my old phone?

    I upgraded from iPhone 3GS to iPhone 6.  Everything converted fine.  Yesterday I deleted an app in error.  When I downloaded the software it from iTunes ( did this many times on the old 3GS), my account is no longer recognized by the app's host servers (Playtika), even though it did after the initial conversion.  Can I go back and re-sync just one app from my old phone?  

    Try deleting what is called the iPod Photo Cache. 
    http://support.apple.com/kb/TS1314

  • Error Your browser/program is not supported by Web Dynpro

    Hi,
    1. I am getting error "Your browser/program is not supported by Web Dynpro" while executing Web dynpro java application
    2. Portal is EP 7.0 with SP15
    3. Browser is IE 8.0
    4. Which browser(s) (& sp level)  are supported by web dynpro?
    5. Is it possible to customize this error message?
    6. If so, from where (Web dynpro java application or Visual Admin) 
    7. My web dynpro application supports multiple languages.
    8. Is it possible to maintain this message in messagecomponent.xlf file
    Thanks & regards,
    Nilesh

    Hi Nilesh
    IE8 and IE7 is not supported.
    For browser/program is not supported by Web Dynpro----
    check this forums link
    /message/6416540#6416540 [original link is broken]
    /message/2842083#2842083 [original link is broken]
    Re: browser/program is not supported by Web Dynpro!
    Hope this link information will help you
    Regards
    Ruturaj

  • I can't update apps at mac app store - error saying "There was an error in the App Store. Please try again later. (100)"

    i can't update apps at mac app store - error saying "There was an error in the App Store. Please try again later. (100)"
    i tried it for weeks and months, but with no success.
    i am using macbook air mid 2011, running os x lion.

    try changing the date a month or a year ahead.. 

  • When I want to get an app, an error message comes up saying I need 3.0 software update.  How do I get my ipod updated in itunes, when itunes says my ipod is already updated?

    When I want to get an app, an error message comes up saying I need 3.0 software update.  How do I get my ipod updated in itunes, when itunes says my ipod is already updated?
    OR if I cannot update to software 3.0, how can I find apps that will work just for my ipod touch?

    It sounds like you have a 1G iPod Touch, in which case you can only upgrade to iOS version 3.1.  Here is a link to purchase the update.
    http://support.apple.com/kb/HT2052
    B-rock

  • My ipod touch is not syncing properly. I have updated the software to the latest (2.2.1) and have even resored it. Itunes says it is working and updated but will not sync and apps. Error message says that app will not sync because a newer version needed

    My ipod touch (model A1213) is not syncing properly. I have updated the software to the latest (2.2.1) and have even resored it. Itunes says it is working and updated but will not sync and apps. Error message says that app will not sync because a newer version needed.

    2.2.1 is not the latest available for any ipod touch.
    Is yours the original ipod touch?
    If so then:
    Purchasing iOS 3.1 Software Update for iPod touch (1st generation)

  • Error while running adcfgclone on APPS tier (ERROR: context creation not completed successfully)

    I am getting below error while running adcfgclone on APPS tier
    ERROR : Unable to set CLASSPATH
    /corp_ex1/DRPM/drpmcomn/clone/bin/../jlib/classes111.zip: is  missing
    First Creating a new context file for the cloned system.
    The program is going to ask you for information about the new system:
    ERROR: context creation not completed successfully.
    Please check /tmp/adcfgclone_29475.err file for errors
    i  copied classes111.zip from IAS_HOME to COMMON_TOP . Now I am getting below error
    First Creating a new context file for the cloned system.
    The program is going to ask you for information about the new system:
    ERROR: context creation not completed successfully.
    Please check /tmp/adcfgclone_30763.err file for errors

    Please post the details of the application release, database version and OS.
    ERROR: context creation not completed successfully
    This is a generic error, please check the log files for details about the error.
    Thanks,
    Hussein

  • Error while browsing RSViewer.aspx in SSRS

    Hi,
    I am getting the below error while browsing the RsViewer.aspx (Or rdl file). I have moved the rdl file from one environment (where I could browse the rdl file) to another environment. In the new environment, I am getting the  below error while browing
    the rdl file. Both environments are having the same configuration (SQL server 2008 R2 SP3).
    "Type 'System.Web.UI.WebControls.PlaceHolder' does not have a public property named 'style'  "
    Thanks in advance,
    Krishna

    Hi krish456,
    According to your description, after you move SSRS report from one server to another, you got the error message when you preview the repot: Type 'System.Web.UI.WebControls.PlaceHolder' does not have a public property named 'style'.
    As per my understanding, you are using object of System.Web.UI.WebControls.PlaceHolder while a different type was expected, this different type has style properties, which were needed for the report to run properly. It seems that you should be using System.Web.UI.WebControls.Style.
    Reference:
    PlaceHolder Class
    Style Class
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

Maybe you are looking for

  • SecurityException due to problems with realm

    Hi, we try to run our web application (developed and successfully deployed under WebLogic5.1) on the WebLogic6.0. After transforming the weblogic.properties file followed by adjusting the new config.xml and copying the necessary classes, *.jar, *.jsp

  • First record is not an IDoc control record (check file)

    Hi Experts, I try to build an interface between a non SAP system and a SAP system via IDOC. I created an .xml test file that I would like to upload now in system with program RSEINB00, but i have error First record is not an IDoc control record (plea

  • Calling oracle function defined within package from JPA

    Hi All, I am trying to call a function get_owner() defined under a package pkg_x_y. But I get an error when I do entityManager.createNativeQuery("call pkg_x_y.get_owner()"); Caused by: java.sql.SQLSyntaxErrorException: ORA-00907: missing right parent

  • Sap Abap Upgrade

    hi all i am working on SAP ABAP Upgrade and facing problem with a data type RAW which is incompatible in ECC6.0. Can anyone suggest a replacement for this data type. Thanks a lot.

  • HPdv7 Phonecall regarding windows problems, op system Windows 7

    I recievied a cann from some company claiming to be a part of the windows program telling me to check my program files, that in my email inbox, messages were coming from Facebook  that could be detrimental to my operating system.  They will first run