doc.saveAs () and function of trust

About three years ago I posted on this forum a question about creating a function of confidence to save in a specific location.  I can't find the original message.  I remember at the time, I was looking for a way to record exchange of what path of a user to the user in the user's desktop folder.  Someone came up with this:

myGetPath = {app.trustPropagatorFunction (function (v1, v2)}

app.beginPriv ();

Return app.getPath (v1, v2);

app.endPriv ();

});

myTrustedGetPath = {app.trustedFunction (function (v1, v2)}

app.beginPriv ();

Return myGetPath (v1, v2);

app.endPriv ();

});

safeSaveAs = {app.trustPropagatorFunction (function (doc, vPath)}

app.beginPriv ();

doc.saveAs({cPath:vPath});)

app.endPriv ();

});

myTrustedSaveAs = {app.trustedFunction (function (doc, vPath)}

app.beginPriv ();

safeSaveAs (doc, vPath);

app.endPriv ();

});

After reading through the API reference and this tutorial, I do not understand the difference between the function of the trust and the confidence function propagator or why I need a propagator of the trust.

What I need now, is to save to a predefined folder, so I guess I can drop the getPath part.

I think that this code was written by me...

TrustPropagatorFunction according to the API, is:

Marks a function as a propagator of the trust. Such a function is not himself trust but can inherit trust so called from a function of confidence.

If you want to use a fixed folder just hardcode in your script when you call myTrustedSaveAs. For example:

myTrustedSaveAs (this, "/ c/temp /" + this.documentFileName);

This saves the file under the same name, but in the C:\Temp\ folder.

Tags: Acrobat

Similar Questions

  • Doc, save as, and function of trust

    I read on the forum and the adobe help files. I think I'm close, but given that I have to get my IT Department to help place the js files where they need to go, I thought I would ask the forum if I'm on the right track

    I always have to make sure that the field values will not include any non-compliant characters. They are not empty like forms will come directly from our system pre-populated

    Currently these forms by e-mail automatically (while still hitting the real send button) staff when to go to print the document.  People who receive these forms are right it is a bit difficult to follow up with emails and asked that just the files save to a folder, so they can watch when they have time

    That's what I have for my job to trust propagator.  I guess that's the only js file I need that it takes over the function of trust?

    mySaveAs = app.trustPropagatorFunction (function (doc, path)
    {
    app.beginPriv ();
    doc.saveAs (path);
    app.endPriv (); })

    myTrustedSpecialTaskFunc = app.trustedFunction (function (doc, path)
    {
    Privileged and non-privileged code above

    app.beginPriv ();
    mySaveAs (doc, path);
    app.endPriv ();
    Privileged and non privileged code below});

    I got this code from the help of Adobe

    so I want to have this code in the box to print Document has

    var name = this.getField("FormValues.accountNames_0").value
    = this.getField ("FormValues.folioNumber_0") .value folio var

    myTrustedSpecialTaskFunc (this, "/ w/Public/AccountOpening /" + name + "" + folio, pdf);

    I read where to put the js file because I saw some comments on the forum when you place the js file has changed for those with Adobe X and Windows 7

    Anyone would be able to let me know if I'm on the right track before IT involved me.  I guess I could test the code on my own laptop to see if it would allow me to save the form...

    Thank you

    Read this: Ninja Acrobat: Acrobat 10.1.1 JavaScript changes

    You must manually create folders that are not present, and they must be named correctly.

    It's a good idea to use the valueAsString instead of the value property property to get the values of field, since you are using the results as a string. He will probably not make a difference here, but it's a good habit to get. You also have typo in that last line of code. It should be:

    myTrustedSpecialTaskFunc (this, "/ w/Public/AccountOpening /" + name + "" + folio + ".pdf");

    If there is a chance that they could be, it would be a good idea to make sure that these field value are not empty.

    Also, consider using a try/catch block for the call of doc.saveAs and look at the return value, so you can give users an error message more useful than what will be the value by default if something goes wrong.

    If you need assistance with this, post again.

  • Move a document to a function of trust

    [Warning: Beginner]

    I'm putting a backup on a document of livecycle button. It will create a file name based on some of the fields of the form.

    I understand that I must do it by using a function of confidence.

    The example that I found as a base has the function of trust defined as:

    var MySaveAs = app.trustedFunction (function (oDoc, cPath, cFlName)

    {

    app.beginPriv ();

    Make sure the path has trailing ' / '.

    cPath = cPath.replace(/([^\/])$ /, ' $1 / ');

    try {}

    oDoc.saveAs (cPath + cFlName);

    } catch (e) {}

    App.Alert ("error during save it");

    }

    app.endPriv ();

    });

    and the call is defined as:

    MySaveAs (this, cPath, "filename");

    The reason I think that it does not work, it's 'this' in a form static pdf is a document, and 'this' object in a form of livecycle is the current object, which in this case is a button

    ("oDoc.saveAs is not a function" is the error I get in the console).

    When you get to saveAs, oDoc is an XFA object and an xfa. The button is not as the saveAs method.

    So the question is: what should I put as the first parameter in the call which is the subject of current document, so that the confidence function gets a Doc object and not a XFAObject object? What is my problem?

    Thank you

    Jon

    You are right in your analysis that 'this' has a different value in the documents of XFA and AcroForm.

    You should be able to use

    MySaveAs(event.target,cPath, "filename");
    

    in an XFA form instead.

    For more information, take a look at the documentation.

    Hope that helps,

    Martin

  • SAVE AND EXIT THE PARTY

    Hello
    I have how I regret the update! (to 32.0.3)
    Where is my 'save and exit' (at closure) option gone?

    I followed all the advice on the forums to pick up this function... but nothing helps.

    Yes, I can get the warning that I'm closing multiple tabs. (Thanks for telling me what I know,  instead of offering something useful!)
    

    To be precise on the subject: config... browser.showQuitWarning is set to true

                                                             browser.warnonquit is true
                                                             browser.tabs.warnonclose is true
    

    And in Tools/Options/general/start "show my windows and tabs from last time is selected.

    What am I supposed to do?

    If I go back to the last version will be the OPTION (to save a session OR let it lapse) IE "SAVE and EXIT" restore?
    I have to stop in future updates

    You will get the warning that "show my windows and tabs from last time" is selected as who will restore open tabs automatically, so you will not lose them.
    To get this warning, you must select another parameter of start (home page or blank tab).

  • The doc for the function of the subset of the table shows the extensible function

    In LabView 2010 the doc for the function of the subset of the table shows that the function is expandable with indexes and multiple lengths. I can't expand the function for multiple indexes. How can I do this?

    Is the documentation for the function by mistake, or is there another function of a subset of the table somewhere that can do this?

    Subset of table details

    When wire you an array to the function, the function is automatically resized to display entries index for each dimension of the array. If wire you a table 1 d to the function, the function displays the index for an item entries. If wire you a 2D to function, the function table displays the entries index for a line and column, respectively. If wire you a 3D through the nD to the function, the function displays the index for a page entries.

  • I opened a word from Windows Mail document, changed using Word 2007, you press on save and close the document. Now I can not find where he saved.

    original title: Windows Mail ate my file

    I opened a word from Windows Mail document, changed using Word 2007, you press on save and close the document.  Now I can not find where he saved.  I tried the search function in Vista, but it can not find the file either.  I tried to re - open the file in the email, but I just get the original version.  Can anyone suggest where it might be?

    Thank you very much

    Eamonn

    Once you open a Word attachment in an email, you must save it to your HARD drive until you make changes. If you do not, the changes are lost, but the original attachment is still with the e-mail.

  • Using Simulator to save and recover memory persistent data

    Hello

    How to programmatically save and retrieve data of type string to and from the internal memory of the Simulator?  An example would help. Also, is it possible to store data even after you close the Simulator, so you might extract the next time it is opened?

    Thank you.

    You should consult the developer's Guide.  I usually download from here:

    http://docs.BlackBerry.com/en/developers/subcategories/?usertype=21&category=development+guides

    for versions of the OS, I am interested.  The chapter you want, changed its name according to the level of the operating system (at least I think there), but it's all about the data storage and it contains examples.  You will find a direct link to this chapter for the level of the OS 4.7, here:

    http://docs.BlackBerry.com/en/developers/deliverables/7693/Storing_data_509304_11.jsp

    In your case, unless you are really developing for J2ME, as your name suggests, I would use persistent store.  If you need code compatible J2ME (cross-platform), then look for RMS (MIDP-record store).

  • The icon is grayed out SAVE and SAVE AS option does not work in my Acrobat Adobe Reader ms

    The record command is grayed out when I open a .pdf document in the Acrobat Reader from Adobe viewer. I used to "save under" once opened, but now this command does not work properly, I think it happened after an updated operating system (windows 10), so I thought it was related to her, but I can tell...

    The keyboard Short-Shift-CTRL-S does not work either... but he used to work and it works with other .doc or .odt files

    The point is: why could I do save and save as when already have the open PDF (pdf viewer) before and now this button is grayed out and cannot save or save as the name more? I do nothing wrong using Acrobat Adobe Reader DC, because I do exactly the same thing about what I was doing, and it always worked, so now it's something different...

    Help, please!

    Thanks in advance!

    Thanks much Sharma Shivan!

    Magically, it worked for me, when I followed the link that you offer...!

    All the best!

  • How to disable the SAVE AS function in Adobe Acrobat

    I use Adobe Acrobat XI version, I wanted to ban the user to edit, print, save the document locally (save and save as).

    How to do? I already tried to use the [password security] and select [no] under [changes].

    I'm not which version is able to perform the DISABLE SAVE AS function.

    Kindly help.

    It is not possible to reach disabling Save/Save as menu items and buttons in PDF files permissions.

  • failure of pre-flight print saved PDF files through the "save under" function because of the current JavaScripts

    How can I disable using JavaScript in a PDF file that is saved with "Save as" option? PDF files print via postscript and distill are without JavaScript. PDF files that contain any JavaScripts fail the printing process before the flight and so we need to know how to disable all the JavaScripts in a PDF file even if Save as function is used to generate a PDF file.

    Thank you

    Peter

    Peter,

    I looked a little more on it, and regardless if you're reviewing post-processing routines or not, it seems that FM now always writes a javascript model when you use the SaveAsPDF routines. The script is actually empty, that is, it identifies the source as coming from FM, and here is the script embedded in the PDF document [he hasn't]:

    //

    FrameMaker

    //

    / * belongs to: Document-level: FrameMaker * /.

    //

    //

    It seems that your options are limited here. You cannot use the SaveAsPDF road and get rid of the script to the end of the FM of things. So you can use AcrobatPro to sanitize the document, create a script that will remove the javascript or talk to your printing provided by supplier to see if they will let the script above spend their pre-flight.

    Alternatively, use the print function to create your postscript and then distilling to create the final print-ready PDF. If you need to create a CMYK & Spot ready color output using the way of printing, then you will need to use GrafikHuset (today a freebie) PubliPDF in postscript output FM CMYK + Spot PDFs. download convert RGB:http://design.grafikhuset.dk/index.php/kontakt/downloads/grafikhuset-publi-pdf and more details available at the: http://www.grafikhuset.net/PubliPDF/

  • In our application, we RESUME Builder and after, we want to show the pdf format. and also, we want to save and send option.

    In our application, we RESUME Builder and after, we want to show the pdf format. and also, we want to save and send option.

    1. for the PDF see TCPDF

    2. for the record, see PHP insert data in MySQL

    3. to send see Basic PHP mail() code function to send e-mail from a form. InMotion Hosting

  • Save and save as options are greyed out

    I have an Adobe X Standard installation. An external source is sending in PDFs that is marked as secure. However, according to the creator of these documents, edition only has been locked down, not save or save as feature. When I opened the document, all the editing features, as well as save and save as grayed out.

    It is a new installation of Adobe X. These documents could already be saved using the same version of Adobe, but that the machine had to be reinstalled due to the instability of the OS. After you have reinstalled Windows 7 Adobe X, then update to 10.1.13, these functions are now gone. I have no idea why. Anyone know what could be causing this? Yet once, I checked with the original creation that backup should not be disabled.

    There is no security setting that locks the Save/Save as.

    Save is grayed out when a file has not changed, which is normal. SAVE AS should not be dimmed at all. Don't know why that should happen.

  • Can a Flash SWF embedded save and get a variable with the drive?

    My SWF content contains text in different languages.  The user selects a language and it appears.

    Is there a way to store this setting locally so that the correct language is displayed when the pdf file is reopened?

    I only need a two-letter string, such as "EN", "FR", "ZH", etc., and the SWF file takes care of the rest.

    I tried calling multimedia_saveSettingsString of SWF Actionscript, and I tried to set a global variable in Acrobat and local setPersistent using Actionscript and .js files. It works in Acrobat, but not the reader on a users system.

    I also tried to use a separate pdf form to store a global variable and then tried to get this variable using the SWF Actionscript.

    Could it be a problem with Acrobat properties or security settings?

    I'm not a virtuoso, would help the sample scripts.

    (Windows 7; ActionScript 3; Acrobat 9 and XI are available; Adobe Reader 9 is installed base, but I may be able to move to a more recent version of the player)

    I asked a similar question in the Acrobat Javascript community, but didn't get any response. I have here reformulated with additional details

    Thank you.

    Here's my example section linking to the Save and Load buttons. evalText, infoText and replyText are the three fields TextArea.

    Note that it is important to send a string and returns an object and cast it to a string. EI.call () has no idea what is sent to JavaScript.

    // button handlers
    butSave.addEventListener(MouseEvent.CLICK, doSave);
    
    function doSave(e:MouseEvent):void {
        var rtn:Object = ExternalInterface.call("multimedia_saveSettingsString",evalText.text);
        if (rtn == null) {
            infoText.appendText("Save: REPLY = null");
        } else if (rtn.toString() == "") {
            infoText.appendText("Save: REPLY = empty string");
        } else replyText.appendText("Save: reply = " + rtn.toString());
    }
    
    butLoad.addEventListener(MouseEvent.CLICK, doLoad);
    
    function doLoad(e:MouseEvent):void {
        var rtn:Object = ExternalInterface.call("multimedia_loadSettingsString");
        if (rtn == null) {
            infoText.appendText("Load: REPLY = null");
        } else if (rtn.toString() == "") {
            aT(infoText,"Load: REPLY = empty string");
        } else replyText.appendText("Load: reply = " + rtn.toString());
    }
    
  • Select the text block to get the content, save and close Windows - Java -.

    Hi guys!

    I made some scripts for Photoshop and now I'm doing something for InDesign, but this one is Kind ' more difficult.

    Let me explain it to you:

    I this 'model' document, it is a file where I have all positions and points for "merge data" do his work. And he does it perfectly, I can create all the fine merged documents, the solution that im working for is to get one of the fields that the "merge data" is completed to be the file name, and then save the file and close it.

    This text box is going to be the name of my file that has a special paragraph Style which is unique on the document, I don't know if it's useful.

    Oh sure, once the work is done by the fusion of data where the script should start now I have something like 15 (do not forget that it is a random number, depends on how many references I have in my Data Source) ready documents save and close.

    I have yet to get started, looked for examples, but nothing came to my mind, any help?

    Thanks guys and I ask you to apologize for grammar mistakes, I'm Brazilian.

    CyA!

    And he crashed right into the first record where I messed up it?

    I thought I was pretty clear when I said:

    I didn't notice you had wrapped all in a while loop. Who's going to make the problem worse. Which does not seem that this would cause a problem?

    Why did you do that? I told you to use:

    var i, name, doc;
    for (i=0; i   doc = app.documents[i];

    And you changed anything else that I not tell you to do:

    while (app.documents.length) {
      doc = app.documents[0];
      var i, Ref, doc;
      for (i=app.documents.length-1; i>=0; i--) {
        doc = app.documents[i];

    It is the cause of some, but not all of your problems. Why did you do that?

    In all cases, your entire script should look like this (decrement loop):

    var i, Ref, doc,
        Pasta = Folder.selectDialog("Selecione a pasta de destino dos arquivos.");
    if (Pasta == null) { exit(); }
    if (app.documents.length == 0) { exit(); }
    
    for (i=app.documents.length-1; i>=0; i--) {
        doc = app.documents[i];
        Ref = doc.textFrames.itemByName("Modelo").contents;
        app.activeDocument.save(new File(Pasta.fsName+"/"+Ref+".indd"));
        app.activeDocument.close();
    }
    

    Or, as this (operation on the active document):

    var i, Ref, doc,
        Pasta = Folder.selectDialog("Selecione a pasta de destino dos arquivos.");
    if (Pasta == null) { exit(); }
    if (app.documents.length == 0) { exit(); }
    
    while (app.documents.length) {
        doc = app.documents[0];
        Ref = doc.textFrames.itemByName("Modelo").contents;
        app.activeDocument.save(new File(Pasta.fsName+"/"+Ref+".indd"));
        app.activeDocument.close();
    }
    

    While we are here, please note that the use of "exit()" may be unreliable, especially as scripts get fat. You will probably find it best to use the "return", although it has different semantics.

  • Doc.saveAs () method to get an error message

    Hi all

    I want to save a pdf file under a range of png with the saveAs() method files.

    this.saveAs ({cPath: "/ E/temp/temp.png", cConvID: "com.adobe.Acrobat.png"});

    I have run this script and choose a pdf file to process.

    But get an error like this,

    ---------------------------------------------

    UnsupportedValueError: The value is not supported. = > Parameter cConvID.
    Undefined Doc.saveAs:1:Batch: Exec

    It seems that something wrong with the cConvID parameter. com.adobe.Acrobat.png is in the cConvID of Acrobat Javascript API Docs lists, why it could report error message?

    ENV: Windows/Acrobat 9.0 Pro

    Think in advance.

    Kind regards

    -gavin

    It should be "com.adobe.acrobat.png", not "com.adobe.Acrobat.png".

    JavaScript is case sensitive...

Maybe you are looking for

  • Try to use my BT headset but "detection of service failed.

    I try to use my BT (official Sony PS3 earpiece/headset bluetooth) headset for my PC microphone. I bought a bluetooth dongle that came with the battery of Toshiba BT on the installation CD. I have installed the battery, put my helmet pairing mode and

  • Mouse Microsoft 3500, scroll button not working not

    Microsoft 3500 wireless mouse.  The scrolling stops when I reached the top of the page, the page jerks up and down when I do this.  Could be the wheel is defective, but I don't know how to fix, or maybe I just need to clean it.  This is a recent prob

  • MD3000i seems to be only using 1 controller

    We had some problems lately with the disk performance in our VMware cluster. Our facility is: 3 of Dell R610 running ESXi 5.1 2 Juniper with 3 gigabit switches VLAN (1 for management, 2 for iSCSI) 1 double Dell MD3000i controller After troubleshootin

  • Speed of network problem

    I have an interesting question. We have improved some client desktop of windows XP for the new desktop win 7. the server is 2008 r2.  file transfers are really slow. they work with files are TIFF which are 30-80 MB in size.  the network is 1 GB We ha

  • Printing using Apple Airprint

    I wanted to post a video on using Apple's Airprint.   This video gives step by step instructions Airprint.