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

Tags: Adobe LiveCycle

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.

  • I can't move my documents in folders - I drag them on the record, but then nothing happens

    I can't move my documents in folders - I drag them on the record, but when I communicated nothing has changed and that they remain in the form of separate documents - can anyone help?

    Hi fulham404,

    I understand that you can not copy the files to a folder. I'm not sure where the destination is, but I would recommend that you look at the permissions for your destination file. As long as you are authorized, you should be good to go.

    Set permissions for the items on your Mac OS X El Capitan:
    https://support.Apple.com/kb/PH21997

    Let me know if it helps. If it is not the case, give a little more detail as to where you copy your files.

    Nice day

  • I have several documents waiting to print, but my printer no longer works. I got a new but is there a way to move the documents to the new?

    I have several documents waiting to print, but my printer no longer works. I got a new but is there a way to move the documents to the new?

    Hello

    What do you mean by "is there a way to move documents to the new?"

    What is the brand and model of your printer?

    Have you successfully installed the new printer?

    I wolud suggest you follow the method below and check if it helps.

    Try to follow the link below and check if it helps.

     
    Add or remove a printer
     
     
    Find and install printer drivers
     
     
    Print a test page
     
     
    After you follow the steps in the link given above try to print the document in which you need.
     
     
     
    I hope this helps.
  • How to move the documents in a print to another printer

    I printed accidentally a few documents on a printer at home and I'm at work.  I would like to move the documents located in the Quebec City of HP to a printer here at work.  Anyone know how I can do?  Thank you!

    N ° you must cancel printing and start over.

  • Does anyone know how to use the movement of scroller with the function of the fluid width?

    Hi all

    Does anyone know how to use the movement of scroller with the function of the fluid width?

    Thanks, Federico

    This feature is not yet implemented.

  • Move my documents on a second HDD internal?

    I would like to move documents, pictures, music, video files from the C: drive to a second hard drive internal, D: drive.  Basically, moving libraries folder.  My drive start without data on them.  And my Window 7 Pro 64-bit operating system.

    The libraries are not records as such - they are just shortcuts - a view of folders.

    Create new folders (My Documents, videos, photos etc etc) on the D drive, then right-click on each old file (NOT in library view), select Properties, and on the location tab, click on move and select the new folder as the destination.

    If you find my answer helpful, please click the button "Vote as helpful"! Thank you! My Blog

  • What happened to the move to stop in 14 function?

    The function stop movement was one of the reasons I used elements of Prime Minister. Why did take it away? If I know when I bought 14, I would have stayed with 11!

    You are right. Stop motion capture was discontinued in version 12, when Adobe has also stopped the capture on tape function.

  • Why I can not move the document?

    Hello. Behind the borders of the document workspace is very comfortable! So you can see how the change of the borders of the image. BUT! You can not always use it. When the image is full-size, I can't move at its borders. When I opened the image in a separate window and resize it, I can move image to its borders. How can I change this?

    In order to scroll beyond the outline of the image in a floating window, turn on the new module option.

  • How can I move a document to the cloud on my device?

    I can't figure out how to move a doc recently converted to PDF from the cloud on my device. Any help?

    Hello

    Currently, Acrobat Reader mobile applications (for iOS, Android, Windows Phone) do not provide an option to download documents from cloud to your device.

    If you are using Acrobat Reader for iOS, you can try the following workaround.

    How can I download document of cloud at the local level to access offline on iPad?

    Sorry for the inconvenience.

  • 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.

  • Capture documents missing OCR functions

    Hi all

    I use a valid license that allows the functions of document Capture.

    I try to configure 'Area putting into evidence and OCR' in "Area Editor", but the button "OCR" is not displayed next to the box 'create' or other place that I can find.

    Administration guide says "OCR is only enabled if your organization licensed OCR Option." If the OCR is available, the OCR button is active in the toolbar of the Editor area", but in my case the button does not appear.

    Someone at - it an idea?

    Thanks in advance.

    Carlos Pereira.

    It seems that the license of the OCR is not active. Here are some steps to take that will probably solve the problem:

    (1.) be sure your settings of the License Manager (System Menu - select License Manager Configuration), that OCR is selected.

    2.) runs almost anything to Capture of Document Oracle 10.1.3.4.0, you must explicitly enable the option "Use OCR license" in order to benefit from this feature. This by selecting 'Settings' option in the menu "System" - and by checking the box "use OCR license. You will then return to the Oracle Document Capture for the change to take effect.

  • How to move the documents to icloud to mac

    Recently, I decided to use icloud for storing my documents. I now discover is therefore more a folder for Documents on my Mac. The favorite of Documents is also missing from my Finder with no option to add back. The only option and something that I see in the Finder's Documents in iCloud. I want to stop using icloud for storing my documents. How to return all documents on my Mac? I tried to create a "Documents" folder under my user, but he comes back and says that it already exists. I can't find. Help!

    Similar situation with my father.  He did not know that it turned on syncing iCloud and after disabled it, discovered that his office was empty (the Documents probably too, but it wasn't in the concerned e-mail message, I received this morning).

    This seems to be the opposite of what one should expect; When turning off this feature, you should be at least the option to restore your files in the desktop and Documents folders.

    I do "remote support" for an octogenarian who is not very comfortable to make changes to his computer.  If all goes well, there is a simple solution that I can talk to him through.

  • How can I move a document from adobe to wordpad

    I have a document in adobe and I want to change it how to do this

    Mithilesh Kadam's right.  You can use the free utilities or sites online to convert PDFs.

    Utilities

    http://PDFCore.com/

    http://www.WinSite.com/convert/convert+PDF+utility/

    Online

    http://www.freepdfconvert.com/

    https://www.pdftoword.com/

    http://www.convertpdftoword.NET/

  • How to view the contents of the c drive since it is almost full despite the movement of documents, etc. on the D drive

    I moved the documents, pictures, music etc all of drive D and removed all of the excess programs. Despite this C is always showing almost complete. How to see the content?

    I moved the documents, pictures, music etc all of drive D and removed all of the excess programs. Despite this C is always showing almost complete. How to see the content?

    Buna,

    See if this little program will help you to tell you what is causing this lack of space for you problem

    http://www.Jam-software.com/treesize_free/

    Revedere.

Maybe you are looking for

  • BIOS update failed, 2000 with AMD E-300 HP

    I have a laptop of HP 2000 Specifications of the PC: CPU: AMD E-300 Graphics card: AMD Radeon HD 6310 graphics Operating system: Windows 64-bit 8.1 Product name: HP 2000 Notebook PC Product number: C2M21UA #ABA The version of the BIOS: Insyde F.61 Wh

  • Satellite L670-143 white and flashing screen

    Hello My laptop screen gets white and flashes after a few minutes working on it. A year ago was just from time to time. But lately is just every 10 minutes.So, I turn to get it back again. I hope someone can help. Thank you.

  • Where's my button change?

    No changes does not cut, copy them, paste them all gone.

  • STRUCTURE CRITICIZES CORRUPTION

    I just bought this computer from Best Buy 4 days office.  She had some glitchy parts him then I have updated to 8.1 Windows who has solved the problems of glitch.  However, now I get a blue screen with the critical Structure Corruption error about ev

  • error code 0 x 80070052 when I plug a flashdrive

    Original title: I get the error code 0 x 80070052 when I plug a flash drive to download the music to half way through the total I want to load I get the error code 0 x 80070052 when I plug a flash drive to download the music to half way through the t