Javascript to print print date and time on scanned documents

I'm using the following code to print a message, time/date stamp, and expiry date along the right hand side of printed documents. It works fine on word docs that were printed to pdf, but when a document it scanned, it mysteriously prints the the correct line of text, but also prints an additional, identical line perpendicular to the original line.
Any help would be most appreciated!
// Add field to each page of form
var inch = 72;
for (var p = 0; p < this.numPages ; p++) {
// create rectangle quads for field
var aRect = this.getPageBox( {nPage: p} );
aRect[0] = 540.0;
aRect[1] = 0.0;
aRect[2] = 576.0;
aRect[3] = 792;
var f = this.addField("PrintField" + p, "text", p, aRect)
f.delay = false;
f.print = true;
f.hidden = true;
f.delay = false;
f.rotation = 90;
f.textSize = 10;
f.textFont = font.HelvB;
f.textColor = color.red;
f.alignment = "center";
f.readonly = true;
f.value = "";
var myWillPrintScript =
'for (var p = 0; p < this.numPages ; p++) { ' +
'var f = this.getField("PrintField" + p); '
+ 'f.hidden = false; '
+ 'var d = new Date(); '
+ 'var expiryd = new Date(); '
+ 'var ThursdayArray = new Array(7); '
+ 'ThursdayArray[0] = 4; '
+ 'ThursdayArray[1] = 3; '
+ 'ThursdayArray[2] = 2; '
+ 'ThursdayArray[3] = 1; '
+ 'ThursdayArray[4] = 0; '
+ 'ThursdayArray[5] = 6; '
+ 'ThursdayArray[6] = 5; '
+ 'var currentday = 0;'
+ 'currentday = d.getDay(); '
+ 'expiryd.setDate(expiryd.getDate() + ThursdayArray[currentday]);'
+ 'f.value = "This is an unofficial copy of a controlled document. Print date/time: " + util.printd("dd mmm yyyy HH:MM ", d) + " Expires: "+ util.printd("dd mmm yyyy ", expiryd) + " 23:59 EST.";'
+ '}'
var myDidPrintScript =
'this.resetForm();'
+ 'this.dirty = false;'
// Now set the scripts to execute on the Will/Did Print events.
this.setAction("WillPrint", myWillPrintScript);
this.setAction("DidPrint", myDidPrintScript);

Very unusual, Here are some more questions to help nail down the issue.
Are both date text lines in form fields? What are the form field names? i.e. is this an exact copy of the existing form field? What are the settings that differentiate the two fields, i.e. Rotation, etc.?
Could the script be somehow getting run twice?
On another note, why are you naming all of the fields differently. It looks like they all get the same info. If this is true then you could simplify the script by making them all the same name. You would not need the loop to apply the date text.
Thom Parker
The source for PDF Scripting Info
www.pdfScripting.com
The Acrobat JavaScript Reference, Use it Early and Often
http://www.adobe.com/devnet/acrobat/

Similar Messages

  • Printing date and time in all pages

    hi frds
    i wants to display or print system date and time in every pages can anyone give me coding .
    by
    Pari Vendhan.R

    Hi Pari,
    Please write the system date and time in TOP-OF-PAGE event so that it will be printed in each page of output.
    Example:
    report zdatetime
    line-count 60.
    START-OF-SELECTION.
    *-- write your code here
    TOP-OF-PAGE:
    write: 'Date: ', sy-datum.
    write: / ' Time: ', sy-uzeit.
    In top of page write other details along with date and time. Here in the above declaration after each 60 lines a  new page will be triggered and TOP-OF-PAGE will be called for each page before first write statement.
    Regards,
    Yellappa.

  • Printing Date and time format LR 1.3.1

    I am trying to print photos with date and time information underneath. Choosing "Photo Info" then "Date" allows me access to everything I need, but in the wrong format. The time is showing up as military (24 hr) format and I cannot find where to change this anywhere in Lightroom. Thank you for helping me with this simple question.

    ruminant wrote:
    The computer is about 18 months old, used every day, usually plugged into mains. Does it still seem likely that the pram battery needs replacing? If so, will it be affecting other things too?
    The PRAM battery normally lasts substantially more than 18 months. If you have extended, Applecare, warranty, have Apple look at it. Otherwise, you can either try to change it yourself or have some service shop do it for you. Take a look [righ here|http://www.powerbookmedic.com/Take-Apart-Repair-Manuals-p-1-c-258.html] for more info.
    Besides losing the date and time, other parameters such as the volume, brightness, etc., will also reset to default due to PRAM failure.

  • Reseting the date and time on photosmart 5510

    Having replaced the internal battery,the date and time on scanned items to memory card is giving 1st january 2001.how can i reset this.

    Hey @dube55,
    I am aware that your Photosmart model does not have a fax. Because I do not have a Photosmart 5510 here and have no access to the Embedded Web Server I gave you the generic tab options. My apologies for the confusion.
    The Date and Time option under the Embedded Web Server for your printer should be located under Settings or Tools. It may be under a sub-menu on the left hand side, such as System or Preferences. Feel free to click on the options to explore what you are able to alter on your machine.
    If you still do not see a Date and Time option we will need to run a Power Reset on the printer. Doing so should prompt you to enter the date and time when reconfiguring your printer. If this fails, we may need to run a Factory Restore.
    How to Perform a Hard Reset:
    Turn your printer ON
    With the printer ON disconnect the power cable from the rear of the printer for 30 seconds
    Plug the power cable back in
    The printer should start back up on its own
    Once the printer returns to the ready state, try another scan to verify if the time and date stamp is correct
    Should the issue persist, please proceed with the reset below.
    How to Restore Factory Defaults:
    Turn your printer ON
    Touch the right arrow button until you see Setup (wrench)
    Touch the Setup button
    Select Tools
    Select Restore Factory Defaults
    Choose Yes
    Once the Restore is complete your printer should start back up and may prompt you to enter the date and time.
    Please let me know if these steps work for you. Best of luck!
    X-23
    I work on behalf of HP
    Please click "Accept as Solution" if you feel my post solved your issue, it will help others find the solution.
    Click the "Kudos, Thumbs Up" on the right to say "Thanks" for helping!

  • Created date and time

    Hi experts,
                      How can i view the created Time & date of a sales order and its invoice.And also the changed time and date.
    Many Thanks In advance.
    Abhishek

    Hi,
    Goto the T.Code "SE11/SE16".
    Enter the table name as "VBAK".
    Enter your sales order number into the field "VBELN" and then Execute.
    Get the Created date from the field "ERDAT" and time from the field "ERZET".
    Next for getting the creation date and time for Billing document,goto the table "VBRK".
    Pass the billing document number.Execute.
    Get the Created date from the field "ERDAT" and time from the field "ERZET".
    For getting the changed details,there are different ways.
    One such easiest way is goto the T.Code "VA03",Enter your order number.
    Click on Environment-->Changes.
    Select "Overview" and "Additional Info".
    Execute.
    Select your entry and click on choose.
    Here you will get the date and time.
    The similar thing is for billing document changes also use teh T.Code "VF03".
    Or one more way is pass the Order number preceeded by two 0's into the field "Object Id" in the table "CDPOS" and then execute.
    Get teh Changenr.
    Pass the same to "CDHDR" table to get the UDATE and UTIME.
    Regards,
    Krishna.

  • How can I remove all or part of the information in headers and footers? For example, date and time of printing.

    I cannot find where I can suppress the printing of the date and time of printing or if I want a header and/or footer at all.

    If using the traditional menus, in the File menu select Page Setup
    If using the orange Firefox button, click on it, then select Print and then Page Setup
    Once you have the page Setup dialog displayed, go to the "Margins & Header/Footer" tab. You need to change all of the options for header and footer to "--blank--"

  • How can I put current date and time in Photo Info (Print module)?

    I often use the Photo Info option in the Print Module to caption my proofs with File Number plus the date and time the print is made.  This allows me to match up the print to the History state for the image, so I know which print version I'm looking at.  I've always wanted to get Lightroom to automatically enter the date and time the print is made.  It obviously knows this info, since it stamps the History state with date and time.  Currently I have to modify my caption manually with Custom text each time I make a print.  This is a major PITA.  Has anyone figured out how to get Lightroom to do this?

    There is a Date/Time title in the titles browser, does just what it says...

  • How can I print the date and time in a photo from iPhoto

    How can I print the date and time in a photo from iPhoto

    You want to print them on their own? Can't be done. WIth the photo? Install this
    http://www.iborderfx.com/iborderfx/

  • Printing the date and time on a photo

    The date and time that the photo was taken showes up but how do I get it to print on my photos?

    You can print the date just below the photo on a printout by using 'Contact Sheet' option while printing the photo through Photoshop Album Starter Edition.

  • HT1454 how do I print off my text messages to include date and time received I have an iphone 3G

    Hi   I have an iphone 3G and need to know how to print off some of my text messages including the date and time.   Does anyone know how I do this?

    Yeah Dave is right, thats a good idea.
    We could also cry to apple at www.apple.com/feedback
    Many people seem to want this feature including myself....Sometimes. I can live without it but sometimes I find myself search for the specific time I sent a specific message and cannot find it.

  • Printing current date and time on each page

    I'm often printing several versions of a document (e.g. a paper in progress). To keep track of the printouts I would like to print the date and time of printing onto each page, regardless of which application I'm using (although it would be okay if it works for PDF files only, if it happens automatically). I have seen Windows printer drivers including this feature, but haven't found any settings here (e.g., Canon iR3225) nor any hidden-CUPS-feature-I-could-activate-in-the-config-file.
    Any ideas? Some sort of preprocessing I could inject into cups?

    I agree with Greg. I had a quick look through the cups settings and could not see what you want. The closest thing would be a cover page, which you can also do via the standard print dialog.
    And checking the iR32xx series printer driver on Windows 7, there is no feature to print the date/time within the driver. So as Greg has mentioned your reference to Windows having this feature must be via an application rather than a driver setting.

  • I have an Iphone 4S and I would like to print my text messages, including the thread and the Imessage date and time stamps.  How would I do this?

    I have an Iphone 4S and I would like to print my text messages, including the thread and the Imessage date and time stamps.  How would I do this?

    settings - message - imessage - OFF

  • How to Change date and time on my printer

    I want to know how to change the date and time on my printer.

    annazmussaqib,
    OK, now enter the following command in the administrative user’s Terminal window:
    sudo date -n 122921502013
    When it asks you for a password, enter your administrative user’s password; it will not show the password as you type it.
    After you enter that command, enter this command again:
    date
    It should show a date and time that is close enough to the actual date and time that you should be able to go into the Date & Time pane of System Preferences without it hanging.

  • Date selection will not print properly when using Microsoft Date and Time Picker Control 6.0 in Excel 2010

    I have created a field input worksheet in which the user identifies start and end dates for training sessions, using the Date and Time Picker Active X Control.  It works fine on-screen, but when the worksheets are printed, the dates that were selected
    using the date picker calendar print out in an unreadable, huge font.  The large font also appears in the print preview mode.  I've tried modifying various properties in design mode, but nothing that I have tried will correct the problem. 
    Any ideas?

    The DTPicker seems to have some bugs in it when used on a worksheet. I have overcome the above by setting the size properties to the same size as a cell and the Linked cell property to the
    cell under the DTPicker. (Even setting the Linked cell had problems with an error message referring to the Check box property to be set to true so I just set it to true and inserted the linked cell and set the checkbox property back to
    false.)
    Then the VBA code below that Hides the DTPicker after a date is selected and unhides the DTPicker when the linked cell with the date is selected. The code is for 2 DTPickers so you will need to edit to suit your requirements.
    Caveat: If the DTPicker is visible then you can't hide it by selecting the same date again. If this occurs then it is a multi step operation. First select another date and the DTPicker will hide, then click on another cell then back on the cell with
    the date to unhide the DTPicker and then select the correct date.
    Hope it helps and feel free to get back to me with any questions etc.
    Private Sub DTPicker1_Change()
        Me.DTPicker1.Visible = False
    End Sub
    Private Sub DTPicker2_Change()
        Me.DTPicker2.Visible = False
    End Sub
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        Select Case Target.Address
            Case "$E$5"     'This is the linked cell for DTPicker1
                Me.DTPicker1.Visible = True
            Case "$E$13"    'This is the linked cell for DTPicker2
                Me.DTPicker2.Visible = True
        End Select
    End Sub
    Regards, OssieMac

  • Officejet Pro 8620 cannot print without page number, date and time stamps

    I have just bought this printer and spent a few days trying to get to grips with it. I managed to solve one problem when I could not access the printing preferences by reinstalling the driver.  I cannot remove the print page number and date and time stamps from a print. Please help!        

    I have managed to solve this by changing page settings. These were oddly reset when the printer was installed.

Maybe you are looking for

  • CRM(TPM): Promotion status to released -- update to which R/3 table?

    Hello experts, we have a CRM (with TPM) 5.2 and a connected R/3 (4.6c). The saved promotion (CRM) triggers an entering of a rebate agreement on R/3 side. If I set the promotion status to "released", where can I see this on R/3 side?? Entry in which D

  • Reader fails to open mail attachment when filename contains non-us characters

    Tested reader with 2 identical pdf attachments in email (same pdf, different filename). If filename contains, in this case, scandinavian characters like ä or ö (auml or ouml), reader flags error "The file path is not valid". This is a serious error,

  • How can I make a member of one class accessible from another class?

    I thought by making a data member protected it was available to all members of the package, but the compiler is giving me an error. If I put the class name dot the data object it thinks it is a function and gives an error.

  • UseBean and Class Not Found

              I am using Weblogic 5.1 on a Win2000 System.           If I try to use the useBean tag in a JSP I get an ClassNotFoundException when           the JSP is parsed. If I load the object with a simple session.getAttribute() call           it wo

  • IPhone 5 16GB BLACK RESTORE ERROR (-1) HELP

    2 Days ago my iphone turned off unexpectedly. When I opened it it appeared a iTunes logo and a conector logo. Then i tried to restore it from iTunes and everytime I try to it gives the (-1) error. Please help me I'm getting frustrated.