Results 1 to 11 of 11

Thread: Need help for Acrobat Increment Java Code

  1. #1
    Join Date
    Nov 2011
    Posts
    91

    Need help for Acrobat Increment Java Code

    Hi all, I have created a form in acrobat that has basic functionality however I want a field that I named report number to increment every time the document is opened. But with this, now I am having the problem and that is, for the script to add one every time the document needs to save on opening to allow this to happen. And while making further research in this, I need some kind of folder level trusted script to allow it to save after the plus one script has run. And for that reason, I am not getting the Java code, and I came here in the hope that someone will really help me here to provide me the proper java script to get it to run the save menu item after the increment at a folder or document level. And for that the idea is not to have to hit save every time the document is opened. And also let me tell you that I don’t want to keep it as the global statement as I am trying to keep this as the java newbie. Please reply me back if anyone have the proper suggestion on this topic???

  2. #2
    Join Date
    Oct 2011
    Posts
    94

    Re: Need help for Acrobat Increment Java Code

    Ok dude, I can help you over here but can you reply me that code which you have done for the increment?? And also the name of that code??

  3. #3
    Join Date
    Nov 2011
    Posts
    91

    Re: Need help for Acrobat Increment Java Code

    Yes sure, I have recently done this with a single line of java script which i name plusone. And for that, code is as:
    Code:
    Plus One:
    // Within Document Javascripts - Plus One this.getField('ReportNumber').value++; app.execMenuItem("Save");
    Please help me in this case.

  4. #4
    Join Date
    Jul 2011
    Posts
    1,795

    Re: Need help for Acrobat Increment Java Code

    Ok for that, I will suggest you to use as:
    Code:
     
    var SaveDoc = app.trustedFunction( function(doc)
      {
      app.beginPriv();
      doc.saveAs(doc.path);
      app.endPriv();
      }
    );
     And after this, you can also cal this like: 
    SaveDoc(this);

  5. #5
    Join Date
    Jul 2011
    Posts
    1,573

    Re: Need help for Acrobat Increment Java Code

    I would like to say something to you over here and that is, PDFs use JavaScript and not the Java Language for its scripting language. And also in your case, I can say that there are so many approaches over here. And for that reason I will say you that you have to fully think on this out. And also let me tell here that if the file is opened and stored on one user system, one can include all of the script within the PDF.

  6. #6
    Join Date
    Oct 2011
    Posts
    94

    Re: Need help for Acrobat Increment Java Code

    I think that this is the local .PDF form that does not require a database back-end just a script within the from itself. And also over here in your case, I appreciate the link but I have used the global method in that article, I could not get it to work correctly in a locally stored PDF. I am telling you this because, every time I have misused my method it seems to end functionality anywhere else as this form is flattened and saved as one more PDF once completed, or flattened and e-mailed. Please can here anyone tell me the best way to move forward with the project?

  7. #7
    Join Date
    Nov 2011
    Posts
    107

    Re: Need help for Acrobat Increment Java Code

    I have seen do many of the save as scripts in the trusted context but not just a simple save. And I am not getting here that what kind of that script that have?? Can here anyone post any example to do this???? Please reply me if you are having the proper example about this.

  8. #8
    Join Date
    May 2011
    Posts
    1,127

    Re: Need help for Acrobat Increment Java Code

    Ok, here you are saying that you have seen the many examples of a trusted saveAs method. So let me tell you that in those methods the parameters passed are usually the document object and the new path as I know about this. So I agree with this that you can use any one of those methods but while doing this, over there you will need to pass "this.path" as the path parameter. I am telling this because, if you are going to pass this as path parameter then only this will act like the Save method, if you are not going to do this then at that time I am sure that you will get error over there and also you wil not perform your operation over there.

  9. #9
    Join Date
    Aug 2011
    Posts
    1,218

    Re: Need help for Acrobat Increment Java Code

    Thanks for that but after trying with this, I came to know that my all examples turn out to be wrong as in the starting when I was just tested this and at that time, it was very good working but now they all have gone wrong. Is there any change of the example???

  10. #10
    Join Date
    Nov 2011
    Posts
    91

    Re: Need help for Acrobat Increment Java Code

    Hey all thanks a lot for replying me such a great step, I have tried with this and this is really working very fine for me. I am now easily use the Acrobat Increment Java Code, and now I am not getting any problem related with this. If I will get problem then I will reply over here for the more help. Thanks again for my help.

  11. #11
    Join Date
    Oct 2011
    Posts
    94

    Re: Need help for Acrobat Increment Java Code

    Yes, me too also searching for this type of the code for the Acrobat Increment Java Code. And after coming here I came to get the code for this. And also here I can see that the users have tried with this code and also they have found that this al is working very fine for them. For that I also tried with executing the same code but I get the problem over here in my case. And the problems are that when I am trying to execute the code at that time I am getting error. Why this is happening to me?? Can here anyone please reply me for this??

Similar Threads

  1. Replies: 11
    Last Post: 13-11-2011, 03:46 PM
  2. help me to understand java code (calendar java code) ?
    By so0oma in forum Software Development
    Replies: 2
    Last Post: 10-01-2011, 12:01 AM
  3. Acrobat Error code: 1602
    By Huron in forum Windows Software
    Replies: 3
    Last Post: 13-07-2010, 11:07 PM
  4. Replies: 5
    Last Post: 13-07-2010, 01:06 AM
  5. Replies: 6
    Last Post: 16-12-2009, 06:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,505,699.21610 seconds with 17 queries