HOW CAN I BATCH ADD ONLY THE FILENAME TO PDF?

I saw a long thread about adding javascript code to insert date, time and filename. but it is an old thread that i cannot comment on.
So please help me only add the filename to the footer
This is the code that was poseted by Rindhard(sp?) This code adds all three.. I only want to have the filename but everytime I try to rem out a line it doesnt work.. i do not know java script obviously
I want to add the filename in a calibri 12pt font
thanks for any help!
app.addSubMenu({ cName: "Footer",cUser: "Set/Remove Footer", cParent: "File", nPos: 20 });
app.addMenuItem({ cName: "Set Date Time (Filename)", cParent: "Footer", cExec: "SetFooter(1)"});
app.addMenuItem({ cName: " ->  Set Date .... centered", cParent: "Footer", cExec: "SetFooter(2)"});
app.addMenuItem({ cName: " ->  Set Date .... right", cParent: "Footer", cExec: "SetFooter(3)"});
app.addMenuItem({ cName: "Set Page centered", cParent: "Footer", cExec: "SetFooter(4)"});
app.addMenuItem({ cName: " -> Set Page right", cParent: "Footer", cExec: "SetFooter(5)"});
app.addMenuItem({ cName: "Set Both", cParent: "Footer", cExec: "SetFooter(9)"});
app.addMenuItem({ cName: "-------------------------------", cParent: "Footer",cExec: "{}"});
app.addMenuItem({ cName: "Remove Both", cParent: "Footer", cExec: "RemoveFooter(9)"});
app.addMenuItem({ cName: "Remove Date Time (Filename)", cParent: "Footer", cExec: "RemoveFooter(1)"});
app.addMenuItem({ cName: "Remove Page", cParent: "Footer", cExec: "RemoveFooter(4)"});
//Set/remove Footer
function SetFooter(ARG)
var re = /.*\/|\.pdf$/ig;
var FileNM = this.path.replace(re,"")+".pdf";
var Path = this.path;
var AcDate = new Date();
var AcDateFormat = "yyyy/mmm/dd  HH:MM"
var Box2Width = 50
for (var p = 0; p < this.numPages; p++)
  var aRect = this.getPageBox("Crop",p);
  var TotWidth = aRect[2] - aRect[0]
  if (ARG<=3 || ARG==9)
   { var fd = this.addField("xftDate", "text", p, [30,15, TotWidth-30-30,30]);
      fd.value =  util.printd(AcDateFormat, AcDate) + "   (" + FileNM +")";
       fd.textSize=6; fd.readonly = true;
       if (ARG==1){ fd.alignment="left" };
       if (ARG==2){ fd.alignment="center" };
       if (ARG==3){ fd.alignment="right" };
  if (ARG==4 || ARG==5 ||ARG==9)
   {  var bStart=(TotWidth/2)-(Box2Width/2)
       var bEnd=((TotWidth/2)+(Box2Width/2))
       if (ARG==5){var bStart=(TotWidth-Box2Width-30); var bEnd=(TotWidth-30);}
       var fp = this.addField(String("xftPage"+p+1), "text", p, [bStart,30,bEnd,15]);
       fp.value = "Page: " + String(p+1)+ "/" + this.numPages;
       fp.textSize=6;  fp.readonly = true;
       fp.alignment="center";
function RemoveFooter(ARG)
if (ARG<=3 || ARG==9) {var x = this.removeField("xftDate");}
if (ARG==4 || ARG==9)
   {  for (var p = 0; p < this.numPages; p++)
      {var x = this.removeField(String("xftPage"+p+1)); }

Not sure what you mean by "-30 high and -30 from the right". Isn't this supposed to be left-aligned?
Anyway, try this one:
this.addWatermarkFromText({ cText: this.documentFileName.replace(/\.pdf$/i,""), cFont: "Calibri", nFontSize: 12,
    nHorizAlign: app.constants.align.left, nVertAlign: app.constants.align.bottom, nHorizValue: 30 , nVertValue: 30});
If you want to customize it further, look up the addWatermarkFromText method in the reference files. All the parameters are specified there.

Similar Messages

  • How can I print using only the black ink cartridge?

    I have a officejet 4620 that I need to know how to set up to have the option of using the black ink cartridge only. I rarely ever use color ink and I dont want $30 worth of color ink to dwindle away while printing pages that do not need any sort of quality printing. How can I change this setting? I have a Mac and there are hardly any options when trying to print anything. 
    Thanks!

    Hello @downeyke , and welcome to the HP Forums!
    I understand you are looking into black ink options.  I would love to try and help you, but I do need a little information first. I am linking an HP Support document below that will show you how to find which version of the Mac operating system you are using.  With this information we can provide you with accurate information.
    Mac OS X: How Do I Find Which Mac OS X Version Is on My Computer?
    Please let me know what you find.  Thanks for posting on the HP Forums!
    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!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • How can I listen to only the audio part of a video?

    I have the iPod Touch 4th Gen with 6.0 software. Sometimes I prefer to listen to movies or TV Shows instead of watching them, and I want to be able to turn the screen off while the video is still playing to save battery power. I've tried turning it off to standby then double clicking home and using the multitaskbar techniques but it just won't work! Is this even possible for this kind of software?

    If you find out anything new, please tell me, thanks!

  • I am trying to add my sons email address to our family apple id but it says that it already associated with another apple id. How can i find out what the apple id is and take his email address off that one?

    I am trying to add my sons email address to our family apple id but it says that it already associated with another apple id. How can i find out what the apple id is and take his email address off that one?

    You may be able to find your Apple ID at Look up your old and forgotten Apple ID

  • TS3999 In MONTH, (PC) iCal only clearly lists 2 items a day. The 3rd item is "faded" and bottom portion cut off, w/ a "more" triangle in the lower-right corner. How can I expand (vertically) so the 3rd line posts clearly, and ONLY shows "more" if 4+ event

    In MONTH, (PC) iCal only clearly lists 2 items a day. The 3rd item is "faded" and bottom portion cut off, w/ a "more" triangle in the lower-right corner. How can I expand (vertically) so the 3rd line posts clearly, and ONLY shows "more" if 4+ events?
    Better yet... as there's a lot of "wasted" space w/ too large Month title and empty space surrounding the Month title above and too much space surrounding the month/year slider bar below, how can I minimize these to allow me more usable / valuable calendar "contents" so I don't need to waste so much time clicking "more" just to see the bottom of the truncated third event and find out there are no 4+ events posted that date?  i.e. more "user-friendly" presentation?
    Thx!
    [email protected]

    In MONTH, (PC) iCal only clearly lists 2 items a day. The 3rd item is "faded" and bottom portion cut off, w/ a "more" triangle in the lower-right corner. How can I expand (vertically) so the 3rd line posts clearly, and ONLY shows "more" if 4+ events?
    Better yet... as there's a lot of "wasted" space w/ too large Month title and empty space surrounding the Month title above and too much space surrounding the month/year slider bar below, how can I minimize these to allow me more usable / valuable calendar "contents" so I don't need to waste so much time clicking "more" just to see the bottom of the truncated third event and find out there are no 4+ events posted that date?  i.e. more "user-friendly" presentation?
    Thx!
    [email protected]

  • App store tried to update iBooks app. I can only see Newstand app on my screen and cannot get to bookstore. How can I delete and download the iBooks app again. iBook still appears in the settings menu as version 2.1   Tx iPad 2, iOS 5.0.1, iBooks 2.1

    App store tried to update iBooks app. I can only see Newstand app on my screen and cannot get to bookstore. How can I delete and download the iBooks app again. iBook still appears in the settings menu as version 2.1
    Tx
    iPad 2, iOS 5.0.1, iBooks 2.1

    Hi,
    the settings are gone, i guess. But even worse, I cannot get the iPad2 to play Full HD thru the Apple digital AV adaptor using apps that support  (and advertise this), like AVPlayer HD. This definiteley used to work before one of the last iOS upgrades. (I am now at 5.1.1).

  • How to get only the filename and extension for a text item?

    Suppose there is a non-database text item called :myfilename
    :myfilename := 'C:\SomeFolder\SomePath\myfile.doc';
    I would like to get the file name only without the full path,
    i.e. myfile.doc
    and the file extension, i.e. 'doc', 'bat', 'java', 'xhtml' etc., i.e. the last few chars from the right to the period.
    Any help is welcome.

    Thanks for the hints.
    I defined the non-database Text Item called FULLFILENAME and another two text items called FILE_NAME, FILE_EXTENSION. The following can extract the file extension,
    select substr(:FULLFILENAME,instr(:FULLFILENAME,'.')+1) into :FILE_EXTENSION from dual;
    e.g.
    :FULLFILENAME := 'C:\MyFolder\AnotherFolder\file.doc';
    FILE_EXTENSION becomes 'doc'
    but I would also like to extract only the filename without path into FILE_NAME,
    i.e. file.doc
    Please give more hints. Thanks.

  • When I use my Delete key to delete a song, I get a pop-up.  This is OK, except the Keep File button is defaulted and I cannot tab or arrow to the "Move to Trash" button, and so i need to use my mouse.  How can I do this only with keyboard?

    When using iTunes on my iMac, I use my Delete key to delete a song and I get a pop-up.  This is OK, except the Keep File button is defaulted and I cannot tab or arrow to the "Move to Trash" (or Cancel) button, and so I need to use my mouse.  How can I do this only with keyboard?

    Huh.. Interesting. I went back to check these proceedures and found there is a difference between using the return key or the space bar as the action command.
    tabbing the blue ring moves the selection and then spacebar takes that action. The return key takes action of only the blue collored button.
    .... learn somting new every day, even if it is somthing I previously forgot

  • How can I import not only apps from the old iphone to the new iphone, but also the content of the apps?

    How can I import not only apps from the old iphone to the new iphone, but also the content of the apps?

    You can sync apps as you normally would, but I do not believe this copies over app specifc data (i.e. saved game status/scores).
    You can always restore your new device with a backup from your old device.

  • HT204411 how can i get music only available in the u.s.?

    how can i get music only available in the u.s.?

    Travel to the US and supply a payment method valid there, or find another source for the music.
    (84673)

  • Just bought my new macbook air, i noticed that my version is os x 10.9 (btw its 2013 model). how can i upgrade it to the latest version? it only shows apps such as numbers etc on the software update on app store

    just bought my new macbook air, i noticed that my version is os x 10.9 (btw its 2013 model). how can i upgrade it to the latest version?(to 10.9.2 or 3?) it only shows apps such as numbers etc... of the software update on app store.

    Here is a link to download 10.9.3 Update (Combo) manually:
    http://support.apple.com/kb/DL1746.

  • HT203128 iTunes 12.1.050 - Rollback: Updated from 12.01, now I cant't change track numbers and add additional data fields. How can I roll back to the previous version? @Apple, I want a $100 gift card for the inconvenience.

    iTunes 12.1.050 - Rollback: Updated from 12.01, now I cant't change track numbers and add additional data fields. How can I roll back to the previous version? @Apple, I want a $100 gift card for the inconvenience.
    - it's all said in the title. I can't understand why the developers turn things bad ... risking loosing Apples valuable customers.
    More examples needed? (check out the communities and the reviews)
    - OSX: Maverick to Yosemite = not recommended (check it out > http://roaringapps.com/apps)
    - iPad: older versions as iPad2 should not upgrade to iOS7/8 (it's not supporting its hardware accordingly, it's designed for the latest hardware)
    - iTunes (it's possible to rollback to 10.7 - 11.4, but you need to breech OSX system security framework)
    - Pages (was a real alternative for many of us, each update reduced features and created incompatibility to older work files)
    The list could easily extend to ...

    You can offer Apple feedback here: http://www.apple.com/feedback/
    as for "
      "@Apple, I want a $100 gift card for the inconvenience"
    dream on.

  • I shot at a Live performance last weekend by using the 'capture now' button. Now, my FCP is only playing the first 6 frames - how can I access or recover the full hour I shot?

    I shot at a Live performance last weekend by using the 'capture now' button. Now, my FCP is only playing the first 6 frames - how can I access or recover the full hour I shot?

    FCP X?  Then you need to use a different forum...This is the FCP 7 and earlier forum:
    https://discussions.apple.com/community/professional_applications/final_cut_pro_ x
    FCP 7?  Did it look like it captured normally? Everything go smoothly?  Stop normal?  Did an error occur at any point?  Can you open the file in QT?
    In the future...do not rely on ONLY FCP for this task. Get a reputable recorder that can record to ProRes. AJA KiPro, KiPro Mini, Atmos Ninja, Decklink Recorder...lots of options.

  • When I attach a file to outgoing mail it shows up in the body of the e-mail. How can i make it only show up at the end or elsewhere?

    When I attach a file to outgoing mail it shows up in the body of the e-mail. How can i make it only show up at the end or elsewhere?

    Edit > Attachments > Insert Attachments at End of Message. If a new message is the active window, the option applies only to that message. If you don't have a new message open, then the option becomes Always Insert Attachments at End of Message.

  • I purchased three albums last week and only two of them were charged.   How can I make sure that the third album gets charged in a timely fashion?

    I purchased three albums last week and only two of them were charged.   How can I make sure that the third album gets charged in a timely fashion?

    Well, thanks for feeling with me, patkosanke ... AND for your wise advice.
    I did followed your advice immediately and erased all the service number as well as S/Ns.
    Can you, however, give me any "direct number" through which I can get hold of someone and request for what you're suggesting?
    I believe I had talked with the person by the name of "Charlie" (I think... I hope I'm correct...) when I was having the same problem with the last device. He was very kind and helpful, though I ended up getting the device that brought the same problem.
    Charlie told me that if I had any more problems I should call him. But I forgot to take down his direct number.
    Or maybe I should call the main office and ask for him. But my memory is questionable as to his name, and besides I don't even know his last name either. There could be more than one "Charlies" in Palm.
    So, if you could somehow email me some direct number (other than the one that keeps on hooking me up with those people in the overseas who are answering the phone only to sympathize with & apologize to me but can only issue a false hope with the SRO#. More than once I was given the promise that the supervisor would call me back within an hour or two but I ended up calling back after I had been left hanging in the air all night long.) where I can talk to someone like I did with Charlie last time who can truly carry out the promise, I would truly appreciate it, patkosanke. ^^
    Thanks
    jcinlovewpalmTX
    Post relates to: Palm TX
    Post relates to: Palm TX
    Message Edited by jcinlovewpalmTX on 03-05-2009 06:36 PM
    Message Edited by jcinlovewpalmTX on 03-05-2009 06:36 PM

Maybe you are looking for

  • Safari 5.1.7

    After reformatting my hard drive after a crash involving my hard drive's directory and migrating my backup data from my Time Machine drive in Lion 10.7.5, suddenly my Safari v. 5.1.7 won't open and crashes repeatedly. . The long crash report [below,

  • How to change IP address of a host ?

    I know that we could know the IP address of a host by using the getLocalHost class but can we change the IP address to out desired IP address. Is there any API for this.......

  • Strange problem with iPod

    Hi! Not so far I bought new iPod Classic 160BG Black. Soon, I downloaded my music library to it (30GB). I have few playlist, every playlist=one radioshow. And every playlist content few releases of the radioshow. It playing from 1 hour up to 2 hours

  • HUM 1.2 server 2008 R2 Enterprise

    Hi. Could hum 1.2 be installed on Server Windows 2008 R2 Enterprise?

  • MXF an M2T export

    Is it possible to export mxf or m2t from final cut to file. thanx