Date field in Acrobat 9

Hi All,
I am a user (not a proficient user, just Joe Bloggs).  We have a system on site which currently works really well for our online documents, that puts on a 30 days tag at the bottom of PDF documents, displayed on screen and when printed.  Until now, we have used Acrobat 6 to put this onto documents, but now I have updated to acrobat 9, and am having trouble with the script.  It runs, but does not put anything onto the documents.
I have tried to play with the code, but I am not a proficient user, and am crying for help!
All I need is to modify this code to display on docs created in 9, and I can roll out any changes to the other tags (3 days, 7 days) etc.
Our IT dept developed the code, but now they cant help!
If anyone could help me it would be great!
Thanks
Alex
// Confirm that the user would like to add tags to ALL open documents
var nButton = app.alert({
cMsg: "This will add Tags to ALL open documents.  Do you want to continue?",
cTitle: "Confirm Action",
nIcon: 2, nType: 2
if ( nButton == 3 ) return;
//Prompt user for a copy #
//var strCopyNum = app.response({cQuestion: "Please enter the copy number.",
//     cTitle: "Copy Number",
//     cDefault: "1",
//     cLabel: "Copy Number:"
//Verify that the user has not cancelled.
//if (strCopyNum == null)
// app.alert("You have cancelled the process.\r\nNo Tags have been added.");
// return;
//For all pages of every open document, insert a text box with the desired copy #
var d = app.activeDocs;
for (var j=0; j < d.length; j++) {
  for (var i = 0; i < d[j].numPages; i++)
   // get the crop box for the page
   var aRect = d[j].getPageBox("Media", i);
   var width = aRect[2] - aRect[0];
   var height = aRect[1] - aRect[3];
   // create the form fields for all pages
   var fieldPos = [width-415, 10, width-20, 30];
   //var label = "patheonWatermarkTag_" + i;
   var label = "todaysDate";
   var f = d[j].addField(label, "text", i, fieldPos);
   f.textSize = 14;
   f.textColor = color.black;
   f.fillColor = color.transparent;
   f.textFont = font.Times;
   f.borderStyle = border.s;
   f.strokeColor = color.transparent;
   f.readonly = true;
   f.value= "Electronic Copy";
for (var j=0; j < d.length; j++) {
for (var i = 0; i < d[j].numPages; i++){
d[j].addScript("My Code", "var bAlreadyOpened;\nfunction docOpened(){\nif(bAlreadyOpened != 'true'){\nvar d = new Date();\nvar sDate = util.printd('dd/mmm/yyyy', d);\nthis.getField('todaysDate').value = 'Valid for 30 days from: ' + sDate;\nbAlreadyOpened = 'true';}\nelse\n{\n}\n}\ndocOpened();\n");
//REMOVE TAGS FUNCTION
function removeTags4()
// Confirm that the user would like to add tags to ALL open documents
var nButton = app.alert({
cMsg: "This will remove Tags from ALL open documents.  Do you want to continue?",
cTitle: "Confirm Action",
nIcon: 2, nType: 2
if ( nButton == 3 ) return;
//For all pages of every open document, insert a text box with the desired copy #
var d = app.activeDocs;
for (var j=0; j < d.length; j++) {
  for (var i = 0; i < d[j].numPages; i++)
   //var label = "patheonWatermarkTag_" + i;
   var label = "todaysDate";
   d[j].removeField(label);
//HIDE TAGS FUNCTION
function hideTags4()
// Confirm that the user would like to add tags to ALL open documents
var nButton = app.alert({
cMsg: "This will hide Tags from ALL open documents.  Do you want to continue?",
cTitle: "Confirm Action",
nIcon: 2, nType: 2
if ( nButton == 3 ) return;
//For all pages of every open document, insert a text box with the desired copy #
var d = app.activeDocs;
for (var j=0; j < d.length; j++) {
  for (var i = 0; i < d[j].numPages; i++)
   //var label = "patheonWatermarkTag_" + i;
   var label = "todaysDate";
   var gf = d[j].getField(label);
   if (gf == null)
    app.alert("There are no TAGS in the document:\r\n" + d[j].documentFileName + "\r\n\r\nThe 'Hide Tags (Printable)' action has been terminated.");
    return;
   } else {
       d[j].getField(label).display = display.noView;
//SHOW TAGS FUNCTION
function showTags4()
// Confirm that the user would like to add tags to ALL open documents
var nButton = app.alert({
cMsg: "This will show Tags from ALL open documents.  Do you want to continue?",
cTitle: "Confirm Action",
nIcon: 2, nType: 2
if ( nButton == 3 ) return;
//For all pages of every open document, insert a text box with the desired copy #
var d = app.activeDocs;
for (var j=0; j < d.length; j++) {
  for (var i = 0; i < d[j].numPages; i++)
   //var label = "patheonWatermarkTag_" + i;
   var label = "todaysDate";
   var gf = d[j].getField(label);
   if (gf == null)
    app.alert("There are no TAGS in the document:\r\n" + d[j].documentFileName + "\r\n\r\nThe 'Show Tags' action has been terminated.");
    return;
   } else {
       d[j].getField(label).display = display.visible;
//CREATE MENU TREE
// Add a new Sub Menu under the File Menu
app.addSubMenu({
     cName: "KHK_:JSTags4",
     cUser: "Valid 30 Days",
     cParent: "Document",
     nPos: -1,
// Add Tags Menu Item
app.addMenuItem({
     cName: "KHK_:JSAddTags4",
     cUser: "Add Tags",
     cParent: "KHK_:JSTags4",
     cExec: "addTags4()",
     cEnable: "event.rc = (event.target != null);",
     nPos: 0,
// Remove Tags Menu Item
app.addMenuItem({
     cName: "KHK_:JSRemoveTags4",
     cUser: "Remove Tags",
     cParent: "KHK_:JSTags4",
     cExec: "removeTags4()",
     cEnable: "event.rc = (event.target != null);",
     nPos: 1,
// Hide Tags Menu Item
app.addMenuItem({
     cName: "KHK_:JSHideTags4",
     cUser: "Hide Tags (Printable)",
     cParent: "KHK_:JSTags4",
     cExec: "hideTags4()",
     cEnable: "event.rc = (event.target != null);",
     nPos: 1,
// Show Tags Menu Item
app.addMenuItem({
     cName: "KHK_:JSShowTags4",
     cUser: "Show Tags",
     cParent: "KHK_:JSTags4",
     cExec: "showTags4()",
     cEnable: "event.rc = (event.target != null);",
     nPos: 1,

I thank you for your input!
When trying to turn on the debugger, I found a nice little check box that said
"Enable menu items javascript execution priveleges"
I checked that... and Tah-Dah!
Magic

Similar Messages

  • I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically. Can some one out there help me?

    I am working in Adobe Acrobat 9 Pro and just created a pdf form from a MS Word document. I need to find out how to have a date field in my form which will update automatically.

    Update automatically under which circumstances, exactly?

  • Acrobat Pro 9.0 date fields

    hi, I am having trouble in date fields in a form I developed in Designer (Acrobat Pro 9.0).  I have two problems.  1.  I have a date field for DOB (Date of Birth).  When any dates are clicked or entered with a year of 1929 or earlier, Adobe converts it to 2029 and so on.  So I cannot enter in anyone over 80 years old.  Not good.  How do I fix this?  2.  When I get out of my Adobe Pro and check out my form myself I am able to use the cool feature where you click on the white part in between the arrows in a date drop down box and I can easily get to early 1900's years.  When I have distributed my form those users don't seem to have that feature.  The top of their date drop down box is blue.  how do I get theirs to work like mine?
    Thanks in advance!

    Post your problems in the forum for LiveCycle Designer.

  • How does one strip out all Live Cycle data from a PDF and rebuild the form fields in Acrobat?

    Someone in a different department built a bunch of forms in Live Cycle. We now need to make minor edits to these forms but we all have Macs and can't use Live Cycle. Currently our only option to change a date and a name on each form  is to buy a new Windows workstation, buy a copy of Live Cycle and train someone for it.
    I understand the Live Cycle technology and Acrobat technology for forms are somehow different but there must be a way to just strip out all the Live Cycle form programming so that I just have the bare PDF with the text and layout.  Then make the text edits and rebuild the form fields in Acrobat.

    It depends on your PDF. Is the PDF a static XFA or a dynamic XFA?
    You can check to see if the PDF is static/dynamic by clicking File=>Save As, and it should say static or dynamic PDF as file type.
    iText will work with Static XFA forms created in LiveCycle. Dynamic XFA forms are not supported.
    You can also submit XML data to a server side script and parse the XML data using C# system.xml.xmlreader.
    Another tool that may speed the development of the project is:
    http://www.fdftoolkit.net/
    Note: FDFToolkit.net utilizes iText Technologies.

  • How to find and replace data in form fields in acrobat xi, its not allowing to do so while trying, a

    how to find and replace data in form fields in acrobat xi, its not allowing to do so while trying, asking for adobe livecycle to get installed. please help.

    Easiest way to do it is the following:
    - Open the PDF file in Acrobat.
    - Go to Tools - Forms - More Form Options - Export Data.
    - Save the form data as an XML file somewhere on your system.
    - Open XML the file in a plain-text editor (I recommend Notepad++).
    - Let's say you want to replace all the years in the dates from "2013" to "2014". Do a global Search&Replace of "2013-" to "2014-" (I added the dash just to make sure that only date fields are edited).
    - Save the XML file (maybe under a new name).
    - Go back to the PDF file, and now go to Tools - Forms - More Form Options - Import Data.
    - Select the edited XML file and import it.
    - Done!

  • Can Acrobat auto populate a date field upon digital signature of a form?

    We use several fillable forms with digital ID signature fields.  A business rule requires a date field next to the signature field.  Is it possible to define the date field to auto populate once the user signs the form?  I can't check this in Acrobat since I only have the reader.

    Hi,
    The short answer is yes, but of course you'll need to get Acrobat to edit the PDF file.
    Generically, here is what  you are looking to do:
    Open the Digital Signature Properties dialog
    Select the Signed tab
    Select the This script executes when the field is signed radio button
    Click the Edit button
    Add the code snippet below to the JavaScript editor
    Click the OK button on the JavaScript editor
    Click the Close button on the Digital Signature Properties dialog
    // JavaScript code to add the date at signing time
        var currentTime = new Date()
        var month = currentTime.getMonth() + 1
        var day = currentTime.getDate()
        var year = currentTime.getFullYear()
        var signingTime = day +"/"+month+"/"+year  //Modify into your preferred format
        var f = this.getField("Text1");  //Modify the field name as necessary
        f.value = signingTime;
    Good luck,
    Steve

  • Date Field in Adobe Acrobat X

    I have a form that users fill in. One of the fields on this form is a date. Through the properties I have set the date format of dd/mm/yyyy. What I was hoping to be able to do next is, get it to auto populate. So when the field onFocus it executes something similar to the now() you can use in MS Access etc.
    Is there a way of getting it to add the system date automatically if so, how?
    Many thanks in anticipation of a speedy helpful response
    Kindest Regards
    Toni

    Do you want  the date fields to populate when the form is opened or from a user entry?
    You can get the system date object with the script "new Date()". You format the date object with the "util.printd()" method. So if you want to populate a field, "StartDate" when the PDF is opened, you can use a document level script or page open script of:
    // get the current date's date object
    var oDate = new Date();
    // set the field value
    this.getField("StartDate").value = util.printd("mm/dd/yyyy", oDate);
    Once you have the date object you can increment the date object using the "getDate()" and "setDate()" methods.
    var oDate = new Date();
    // set the field value
    this.getField("StartDate").value = util.printd("mm/dd/yyyy", oDate);
    // next day
    oDate.setDate(oDate.getDate() + 1);
    // format and set vlaue
    this.getField("StartDatePlus1").value = util.printd("mm/dd/yyyy", oDate);
    // next day
    oDate.setDate(oDate.getDate() + 1);
    // format and set vlaue
    this.getField("StartDatePlus2").value = util.printd("mm/dd/yyyy", oDate);

  • Problem with Buttons/Form Fields in Acrobat PDF when created in InDesign CS4

    So I have been working for quite some time on an interactive form for an internal client at my job. It has two major components, one is the side bar navigation, which I created using buttons in InDesign which link to bookmarks in the document. The second aspect is that I also created "check boxes" accoring to this video: http://www.adobe.com/designcenter/cs4/articles/lrvid4434_ds.html
    I have two major issues:
    1. Whenever I try to convert my boxes to form fields in Acrobat it will not recognize them unless I save out 4 pages at a time (rather than the whole document).
    2. I then have to combine the document and get multiple sets of bookmarks, and some bookamrks are corrupted (not working properly). Even when I try to convert the whole document some of the buttons are corrupted.
    UGH tired of this project, I am really bastardizing the whole thing to get it done, but want to figure out the problem as this is an ongoing document that we will be using over and over again in future years.
    I am attaching the pdf file--this is a pieced together one (saved out 4 pages at a time) (which I did do some fixes to to get buttons to go to proper locations) and the original indesign file (partial file due to size).
    PLEASE OH PLEASE HELP ME!

    Acrobat's Form Wizard is good but not perfect when creating form data from a PDF. I have never encountered Acrobat not able to finish the process of creating all form fields, but have encountered very slugish performance afterwards when there was a lot of forms, buttons, and other elements within the pages. And I would say, from your attached PDF, it is pretty heavy with content. I am going to suggest an idea, but I have not tested this to see if it would work.
    In InDesign, create a layer for your navigation tabs, and a layer for your text with the check boxes. Create two PDFs from ID, one PDF with just your-nav tabs, the second with just your text with check boxes. In Acrobat, perform the Form Wizard on the second PDF and see if this will finish, the idea here is to reduce the cllutter for the Form Wizard to finish. If it does, you can merge the first PDF as a layer with the second to have a completed document. Again, I have not tested this theory.

  • How do you print the entire contents from a data field?

    I have a simple Acrobat form that was sent to me and one of the data fields employs a scroll bar because it contains more text than the field can hold. How do I print my document so that it prints everything in that field, not just was is visible?
    Thanks

    I'm not sure you can do this with a standard Adobe Acrobat form. If the form is created with Acrobat Designer (Windows, not Mac product) there is the possibility to have the field grow in size. Designer based forms can be used on a Mac, but cannot  be created under the Mac OS (virtualization excluded).

  • How can I populate a date field when document is signed?

    I have 4 digital signature fields in a PDF form.  Next to each signature field is a date field (m/d/yyyy format).  I would like it so when the user signs the signature box that the date field next to it populates with todays date, then changes to read only (so it cannot be altered).
    In Adobe Acrobat Pro 9 I have this form and it has the following fields
    Signature1
    Signature2
    Signature3
    Signature4
    DateField1
    DateField2
    DateField3
    DateField4
    The Signature fields trigger a Topaz.GemSignPlus driver where the end user will be signing on an electronic signature pad.
    How can I use Javascript to detect when one of those Signature fields is populated and then fill in the date to the approrpiate date field?  I tried creating boolean variables initialized as false for each sig field.  Then when the signature is done I try to change it to true, but for whatever reason my javascript detecting the value doesn't do anything.
    I've searched the net endlessly for this solution.  I can't believe I'm having such a hard time finding an answer.  I mean how many places do you go where they ask you to "Sign and date here".  Every signature based document I've ever seen also requires a date.
    Anyway here's what I have.  In Document JavaScript functions I have a script name called populate date:
    function populatedate()
    var bSignature1 = new Boolean();
    var bSignature2 = new Boolean();
    var bSignature3 = new Boolean();
    var bSignature4 = new Boolean();
    if (bSignature1) {
        DateField1.value = util.printd ("m/d/yyyy", new Date());
    if (bSignature2) {
        DateField2.value = util.printd ("m/d/yyyy", new Date());
    if (bSignature3) {
        DateField3.value = util.printd ("m/d/yyyy", new Date());
    if (bSignature4) {
        DateField4.value = util.printd ("m/d/yyyy", new Date());
    In each signature field I have under the Signed tab "This script executes when field is signed:
    var bSignature1 = new Boolean(true);
    I'm trying to change it to true see.  My thinking is if its true than DateField1.value should print the m/d/yyyy in it from the built in Date() function.
    But maybe I am not getting this context correct.  I am new to Javascript in Adobe.

    It's quite a round-about script... Why not simply use the signature signing script to set the value of the date field? The correct syntax for that is:
    this.getField("DateField1").value = util.printd ("m/d/yyyy", new Date());

  • Click event to add (or subtract) a day to a date field

    I have a form that is giving me a little trouble. I want to be able to input a start date in one field, then input a number of days in another field, and then have it calculate a date that is that number of days away from the start date. The form is actually working ok for the most part, but there are a couple of issues I'm having.
    1. The end date is not calculating immediately upon exiting the number of days field. You have to tab all the way back to the start date and only when you exit that field does it calculate the end date. I need it to calculate when you exit the number of days field.
    2. I have added a little (+) and (-) button to be able to increase or decrease the date by one day. This works, but the problem is, I want to do this in the background. Meaning, I want the calculated date to change, but the # of days field to not change.
    So say I enter 12/1/2010 in the start date. Then I enter 1 in the # of days field. When I tab to the Calculated date field, it should immediately change to 12/2/2010. Then, if I click (+), the Calculated date field should go up to 12/3/2010, but the # of days field should stay at 1.
    I've uploaded a sample of what I have figured out so far here:
    https://acrobat.com/#d=v4c4KKdj0hesicxO8yO1pw
    Thanks so much for any help I can get on this!
    Jo

    I think this is what you are after. I moved the logic to the calculate event of the target date and added a numeric field to hold the result of adding/subtracting (called 'delta').
    // form1.#subform[0].date2::calculate - (FormCalc, client)
    var date1 = Date2Num(date1.formattedValue,"MM/DD/YYYY")
    $.rawValue = Num2Date(date1+days+delta,"MM/DD/YYYY")
    You could make 'delta' hidden.
    Steve

  • Adding Barcode field in Acrobat X

    When I try to add a barcode field in Acrobat X I get the following message
    A Barcode Field encodes data that end-users type into a fillable PDF form. Use of this type of field for paper forms processing requires Adobe's Barcoded Paper Forms Solution (separate license required).
    Where do you go to purchase this liscense? I can't seem to find it on the webpage.

    It is required if you want the bar code field to work with Adobe Reader (Win/Mac). If all of your users will have Acrobat, it's not needed. The license can be purchased along with LiveCycle Reader Extensions (http://www.adobe.com/sea/products/server/readerextensions/), which is also available from datalogics.com (I couldn't get to their web site today, but look here: http://www.linkedin.com/company/datalogics/adobe-pdf-java-toolkit-1006340/product?trk=biz_ product)
    If you go through Adobe, you'll have to talk to a sales rep about pricing.

  • How do I auto fill a date field for an Adobe form?

    Hi. I am new to Acrobat. I would like to have Acrobat auto fill today's date in a date field when I open an acrobat form. I check the forum help and it indicated that I associate this javascript text to the field:
    var f = this.getField("Today"); if (f.valueAsString=="") f.value = util.printd("mm/dd/yyyy", new Date());
    However, when I try it out, nothing happens.
    Any clue as to what I am doing wrong?
    - Michael

    Hi M. Krebs,
    Is there a text field in the PDF labeled "Today" and set as a date field? And does the Date Options format set for the field match what is in the JavaScript (mm/dd/yyyy)?
    Best,
    Sara

  • Dropdown date fields?

    Hi Folks, I'm new to Acrobat, and am trying to do a favour for a friend by making a fillable .pdf. I'm using Windows 7, and using Acrobat 9 Pro Extended.
    There's quite a few date fields. I'd like a dropdown for them, where the used can scroll and click on a date. This seems like a ridiculously common thing. Is it an available 'thing' on Acrobat? Where would I find it?
    It seems like a common enough requirement for forms that it would be something preset and 'plonkable'.
    With thanks,
    Sandi

    Do you mean that you want a drop down that contains all the dates between
    date X and date Y? I haven't seen such a thing before, but it can be
    scripted.
    Or do you mean that you want to use a set of drop-downs to specify the
    date, like one for the day, one for the month and one for the year? That's
    more common, but if you want to prevent the user from entering invalid
    dates it also requires some scripting.
    There's also a date picker widget that you can integrate into your form,
    like this one: http://www.formrouter.com/tools/index.html

  • How do I set blank data to date field in pdf form ?

    Dear Sir,
    I made PDF form by Acrobat X on Windows PC and then,
    read the pdf form by acrobat reader on iPad.
    Date field  is included in the form.
    The Acrobat version is 10.1.6 .
    The acrobat reader version is 10.5.0 .
    First, I put the wrong date data to the date field.
    So, I tried to clear the date field.
    I want to put the blank data to the date, but I think
    there are no way to put the blank data on iPad
    I would like to know how to reset the date data.
    If that helps, I tried to the same thing on Android.
    I could put blank data to the date field by BS key.
    Sincerely,
    PV NEXT CO., LTD.
    Kiyonobu Matsuo
    PVネクスト株式会社

    Here is how to clear the Date field on the Ipad.
    NOTE: In order for this to work that has to be another TEXT field in the PDF to get the keyboard to pop-up.
    Click on Text field (this is to get the regular keyboard on screen)
    Click on Date field (date spinner control will show up)
    Click on SAME DATE field (spinner control will disapper)
    Click on "Reset Field" on top of keyboard (date field will now be empty)
    Click any where on PDF that is not another Date field (keyboard will disappear and date field will be empty)
    Bingo! your free and clear.

Maybe you are looking for

  • Just got a new mac mini and I can't figure out how to authorize it. Help!

    Just got a new mac mini and cannot figure out how to authorize it.  Help! m

  • Outlook asking for username and password, but only for some users

    Hello, I'm in an Exchange Server 2013 client environment, two CAS servers and two Mailbox. Some users are having trouble in Outlook 2007 and 2012, which is directly requesting the user name and password, not all, just some. The Active Directory is ok

  • Office 2007 Outlook

    I have created my Outlook InBox view in a certain manner: date; from; subject; attachment etc. Without user action, my view changes. I reported this to our IT team who replied that it is not something they could fix. I have a hard time believing this

  • Unable to syncy two iphones wirelessly

    I have been trying to set up my wifes home iphone and her work iphone to both sync wirelessly with my itunes/computer.  The first phone that I set up her home phone worked perfectly, within a few seconds it pops up as a syncing item within itunes.  W

  • Two Usages for External Backup Drive?

    Hello, I am Steven and new to Time Machine I have purchased a 320 GB Maxtor external hard drive as my backup disk But I also want to use that external drive to store movies and music from my other computer (PC desktop); just wondering if that's feasi