Skip navigation
Home/Support/

Forums

1 2 3 Previous Next 28780 Views 149 Replies Latest reply: Dec 9, 2011 5:17 AM by hilljensen RSS
User 1 posts since
Aug 30, 2006
Currently Being Moderated

Aug 30, 2006 11:52 AM

Print File Name with pdf Document

In order to have an audit trail / track a document, I want to print the file name as a header or footer when printing the documents. How can this be done?
  • User 7 posts since
    Nov 9, 2006
    Currently Being Moderated
    1. Nov 9, 2006 10:14 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    I have exactly the same question; it's unimaginable that this can't be done.
  • User 160 posts since
    Oct 30, 2003
    Currently Being Moderated
    2. Nov 9, 2006 10:41 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    you can do it with a JavaScript.
  • User 2,088 posts since
    Nov 10, 2006
    Currently Being Moderated
    3. Nov 13, 2006 6:15 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Add some JavaScript to your document as a "Will print" event.

    Details in the Acrobat JavaScript Guide.

    Leonard
  • User 7 posts since
    Nov 9, 2006
    Currently Being Moderated
    4. Nov 13, 2006 9:26 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Ok, thanks, but I don't know JavaScript, and even if I did your answer suggests that it needs to be done de novo for each document for which you need this information. We create many documents each day from a web-based banking application, and it would be great if Acrobat would simply handle this. I'm amazed Adobe hasn't built this in.

    If I've misunderstood the custom nature of your solution, please let me know. And if you'd care to toss in some JavaScript, great!

    :)

    Thanks.
  • User 2,088 posts since
    Nov 10, 2006
    Currently Being Moderated
    5. Nov 13, 2006 11:46 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    I read your question as how to do that for a particular document - so yes, the embedded JavaScript would need to be included in that document. You could certainly have this done on the server as well, as part of your creation process.

    As to have Acrobat do this - although Acrobat itself doesn't include this functionality - I believe there are some 3rd party plugins for Acrobat that can add this.

    Leonard
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    6. Nov 13, 2006 2:13 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Attached a simple JS that will do it. Copy it into Notepad and save it in your Acrobat \Javascript folder. Next time you start Acrobat you will a have menuitem "Print with Footer" direct above Print.

    It put the values into fields at the footer. That may took some time. Then it displays the print-dialog and finaly you can choose if you want to remove the fields or not.

    Enjoy, Reinhard

    PrintWithFooter.js
    -------------------------------

    app.addMenuItem({cName:"Print with Footer", cParent:"File", nPos:20, cExec:"PrtFooter();"});

    //Print bookmarked Pages
    function PrtFooter()
    {

    for (var p = 0; p < this.numPages; p++)

    {

    var fd = this.addField("Date", "text", p, [10,10, 300,28]);
    fd.textSize=8; fd.value = "Date: " + util.printd("yyyy/mmm/dd", new Date()) + " (" + this.path +")"

    var fp = this.addField(String("page"+p+1), "text", p, [330,10,280,28]);

    fp.textSize=8; fp.value = "Page: " + String(p+1)+ "/" + this.numPages;

    }

    app.execMenuItem("Print");

    var OK = app.alert("Delete Date / Filename?",2,2);

    if (OK == 4) {

    var x = removeField("Date");

    for (var p = 0; p < this.numPages; p++)

    {

    var x = removeField(String("page"+p+1));

    } }

    }
  • User 7 posts since
    Nov 9, 2006
    Currently Being Moderated
    7. Nov 13, 2006 6:30 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Thank you Reinhard! You were kind to do this; but if I may ask a favor, can I get a version that just prints the date and the file name? I don't need the file path, since it's very long anyway.

    Also, this script crashes when one chooses the "yes" option on the remove dialog.

    Many thanks
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    8. Nov 15, 2006 2:55 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Attached an updated Script. It gives you a menu for Set/Remove Footer. Then you can Set - Print - Remove.

    HTH, Reinhard

    PrintWithFooter.js
    -------------------------------

    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 Page ", cParent: "Footer", cExec: "SetFooter(2)"});
    app.addMenuItem({ cName: "Set Both", cParent: "Footer", cExec: "SetFooter(3)"});

    app.addMenuItem({ cName: "-------------------------------", cParent: "Footer",cExec: "{}"});

    app.addMenuItem({ cName: "Remove Date Time (Filename)", cParent: "Footer", cExec: "RemoveFooter(1)"});
    app.addMenuItem({ cName: "Remove Page", cParent: "Footer", cExec: "RemoveFooter(2)"});
    app.addMenuItem({ cName: "Remove Both", cParent: "Footer", cExec: "RemoveFooter(3)"});

    function SetFooter(ARG)
    {
    var re = /.*\/|\.pdf$/ig;
    var FileNM = this.path.replace(re,"")+".pdf";
    var Path = this.path;
    var AcDate = new Date();
    for (var p = 0; p < this.numPages; p++)

    {

    if (ARG==1 || ARG==3) {var fd = this.addField("xftDate", "text", p, [30,15, 290,30]);

    fd.textSize=6; fd.value = util.printd("yyyy/mmm/dd, HH:MM", AcDate) + " (" + FileNM +")"; }

    if (ARG==2 || ARG==3){var fp = this.addField(String("xftPage"+p+1), "text", p, [350,15,300,30]);

    fp.textSize=6; fp.value = "Page: " + String(p+1)+ "/" + this.numPages; }

    } }

    function RemoveFooter(ARG)
    {

    if (ARG==1 || ARG==3) {var x = this.removeField("xftDate");}

    if (ARG==2 || ARG==3) {for (var p = 0; p < this.numPages; p++)

    {

    var x = this.removeField(String("xftPage"+p+1)); }

    } }
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    9. Nov 16, 2006 6:17 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    OK! Did a little bit more so it is usable for myself.

    Now you can choose if you want to have the "Date Time (Filename" footer want to have left, center, or right aligned.

    The code has been updated:
    - now it really cnter the boxes page for page.
    - the first box (Date ...) uses the total width of the page. So it also useable if you want to have a selfmade footer note, something like "First Draft from ....". You have only to edit one box on one page, then it will be displayed on all pages.

    - if you want to remove you can use allways "Remove both". It's only work a little bit longer in bigg files.

    br, Reinhard

    PS to other scripters: If someone has time he may improve the script.
    The general settings could be done on a extra page (like general Dateformat, general Texthigh, ..... Then this can saved in global.js. So all the user defined settings are stored and retrieveable. That would Adobe save work. Adobe should set up a "Acrobat Scripts & Scraps" forum, where (freetime-)scripter can publish and discuss scripts.

    Edit: ... and where it is also possible to publish scripts without to have to format by yourselft, so that it is readable!

    SetRemoveFooter.js (<-Save in folder ...\javascript)

    -----------------------------------------------


    // SetRemoveFooter

    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 ", cParent: "Footer", cExec: "SetFooter(4)"});

    app.addMenuItem({ cName: "Set Both", cParent: "Footer", cExec: "SetFooter(5)"});


    app.addMenuItem({ cName: "-------------------------------", cParent: "Footer",cExec: "{}"});


    app.addMenuItem({ cName: "Remove Both", cParent: "Footer", cExec: "RemoveFooter(5)"});

    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==5)

    {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)

    {var bStart=(TotWidth/2)-(Box2Width/2)

    var bEnd=((TotWidth/2)+(Box2Width/2))

    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==5) {var x = this.removeField("xftDate");}

    if (ARG==2 || ARG==5) {for (var p = 0; p < this.numPages; p++)

    {

    var x = this.removeField(String("xftPage"+p+1)); }

    } }
  • User 7 posts since
    Nov 9, 2006
    Currently Being Moderated
    10. Nov 16, 2006 11:01 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Hi Reinhard,

    Thanks for working on this. However, this script does not work, because the "Set/Remove Footer" submenu does not appear in my File menu (the previous version worked fine). I have carefully copied and pasted your script into a new .js file in the \javascripts folder. What could I be doing wrong?

    Jeff
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    11. Nov 16, 2006 2:33 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    I've edited above script and now it should work.

    br, Reinhard
  • User 7 posts since
    Nov 9, 2006
    Currently Being Moderated
    12. Nov 16, 2006 4:09 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Thanks. Can you post it?

    Regards

    Jeff
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    13. Nov 17, 2006 1:34 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    I think there is no need. I copied it out and in and it works fine for me (AAr5).

    However you may state where to sent to and you will get it.

    br, Reinhard
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    14. Nov 17, 2006 1:20 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Just remembered to some Webspace I have. You can download from:

    http://www.Refob.de/downloads/acrobat/SetRemoveFooter.js

    HTH Reinhard
  • User 7 posts since
    Nov 9, 2006
    Currently Being Moderated
    15. Nov 17, 2006 1:30 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Hello Reinhard,

    The script you modified on 16 Nov does not appear in the forum posting, so I cannot copy and paste it. However, if you can email it to me at **** I would very much appreciate it.

    Thanks and regards,

    Jeff
  • ~graffiti Contributor 6,813 posts since
    Jul 28, 2006
    Currently Being Moderated
    16. Nov 17, 2006 1:31 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Jeffrey,

    Click the "Show all messages" link towards the top of the thread and you'll see his post.
  • User 1 posts since
    Mar 9, 2007
    Currently Being Moderated
    17. Mar 9, 2007 6:26 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Reinhard, I love this Javascript for printing the file name as a footer on Acrobat documents; however, I DO need the whole path name as well as the file name to print on my documents...how do I fix this script so that this will happen? Thanks
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    18. Mar 11, 2007 12:39 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    In the line:

    fd.value = util.printd(AcDateFormat, AcDate) + " (" + FileNM +")";

    replace FileNM with Path.

    Best regards, Reinhard
  • User 4 posts since
    Jan 27, 2005
    Currently Being Moderated
    19. Mar 13, 2007 6:12 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    This is fantastic...just what I was look for!...I just need to add a line of text stating the document will expire after so many days and the date and time to be ...mm/dd/yyyy and standard time not military time. What do I need to add and/or change to achieve this?
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    20. Mar 14, 2007 6:02 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    1.)Dateformat
    Change the line:
    var AcDateFormat = "yyyy/mmm/dd HH:MM"
    to your needs, like:
    var AcDateFormat = "mm/dd/yyyy"

    For more Date formats have a look at the JavaScript help file:
    http://www.adobe.com/devnet/acrobat/pdfs/js_api_reference.pdf#page=716

    2.)document will expire
    A simple solution would be (see "answer #8"):
    - the first box (Date ...) uses the total width of the page. So it also useable if you want to have a selfmade footer note, something like "First Draft from ....". You have only to edit one box on one page, then it will be displayed on all pages.

    Another solution would be to set up an extra field (box) for that.

    HTH, Reinhard
  • User 4 posts since
    Jan 27, 2005
    Currently Being Moderated
    21. Mar 14, 2007 7:11 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Reinhard,

    I have altered your code a bit for my specific needs...I need the month/day/time, then document name on the left hand side of the footer, the page of pages in the center...which you have...but then also...on the right hand side of the page, I need it jus plain text where I can type in a message....the code that you've written is a fantastic start...I jus need to figure out how to get that last part in there..and im fairly new to all this...plus..I don't know if removing stuff, I've messed up the other code...seems functional when I test it, but it maybe a bit sloppy after me messing with it!...how do I add that last piece of code? Thanks for your help!!

    app.addSubMenu({ cName: "Footer",cUser: "Test", cParent: "File", nPos: 20 });

    app.addMenuItem({ cName: "Set", cParent: "Footer", cExec: "SetFooter(9)"});

    app.addMenuItem({ cName: "-------------------------------", cParent: "Footer",cExec: "{}"});

    app.addMenuItem({ cName: "Remove", cParent: "Footer", cExec: "RemoveFooter(9)"});

    //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 = "mm/dd/yyyy 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==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==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==9) {var x = this.removeField("xftDate");}
    if (ARG==9)
    { for (var p = 0; p < this.numPages; p++)
    {var x = this.removeField(String("xftPage"+p+1)); }
    }
    }
  • User 1 posts since
    Jul 10, 2006
    Currently Being Moderated
    22. Mar 14, 2007 7:36 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Hi

    I've been struggling to create an excel document which needs to go out with a header in the form of our company logo. As Excel has very limited layout capabilities, is it possible to use your script to add a header which just includes a (positioned) logo to an excel file being printed to PDF?

    Thanks
  • P. Allan User 41 posts since
    Apr 28, 2004
    Currently Being Moderated
    23. Mar 14, 2007 8:17 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Fantastic with the JS.

    Thanks to Reinhard and You all.

    I'm a 100% novice in this.

    But the

    var re = /.*\/|\.pdf$/ig;
    var FileNM = this.path.replace(re,"")+".pdf";
    var Path = this.path;

    doesn't seem to work by me. The filename is always "NaN.pdf".

    However - after a look in the js api documentation, I changed the 3 lines to just

    var FileNM =this.documentFileName

    It seems to work. Am I missing something?
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    24. Mar 14, 2007 1:21 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    @esma
    You should open your own topic. It's a total different technic (watermarks or ..)

    @allan
    "Am I missing something?"
    No. I use AAv5. "documentFilename" was introduced in later versions. Also the regular expression I used I took only because I just worked with that and was to lazy to look for "stringMid, stringInStr ..." in a JS-handbook.

    Best regards, Reinhard
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    25. Mar 14, 2007 3:26 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    @bjames

    A quick solution.
    Under: "if (ARG==3){ fd.alignment="right" };"
    Insert:
    var fr = this.addField("xftRem", "text", p, [30+TotWidth/2,15, TotWidth-30,30]);

    fr.textSize=6;fr.alignment="right";


    If you choose "Set Both" an extra field will be added to the right side of every page. This you can edit on one page for every page.

    If you want to remove it via Menuitem, then
    Under: "if (ARG<=3 || ARG==9) {var x = this.removeField("xftDate");}"
    Insert:
    if (ARG<=3 || ARG==9) {var x = this.removeField("xftRem");}

    HTH, Reinhard
  • User 4 posts since
    Jan 27, 2005
    Currently Being Moderated
    26. Mar 15, 2007 2:29 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Reinhard,

    Thank you so much for your help. I just have one question. You have the code written above so that you may type the footnote or message on the bottom of the page in acrobat. I would like to put the text or message in the JavaScript. That way when you SETBOTH, it adds everything to the bottom and that's it. So my question is, how do I put that information in the code? and secondly where? Thanks again for your help.
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    27. Mar 16, 2007 4:20 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Add:
    fr.value = "My Text";

    to:
    fr.textSize=6; fr.alignment="right";

    e.g
    fr.textSize=6; fr.alignment="right"; fr.value = "My Text";

    HTH, Reinhard
  • User 2 posts since
    Apr 16, 2007
    Currently Being Moderated
    28. Apr 16, 2007 1:16 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    I got the "Set/Remove Footer" thing to show up above print setup under the file drop-down, but when I click on any of the options it says, "an internal error occurred"

    Is this because I have Vista? any advice?

    thanks for your help
  • User 1 posts since
    Apr 16, 2007
    Currently Being Moderated
    29. Apr 16, 2007 1:46 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    30. Apr 17, 2007 3:49 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    "Is this because I have Vista? any advice?"

    I don't know. Which Acrobat version?
    You may test the pure script (without app.addMeuitem) in the JS-Console.

    best regards, Reinhard
  • User 2 posts since
    Apr 16, 2007
    Currently Being Moderated
    31. Apr 17, 2007 7:16 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    tried taking out app.addMeuitem and i'm still getting the same thing

    i'm using adobe 7.0

    thanks a lot for your help though
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    32. Apr 18, 2007 4:33 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    I work with WinXP and furtheron with Acrobat v5. From the answer from @P.Allan I can see that it should work also with higher Acrobat versions.

    Perhaps someone else can confirm that ist works / works not with vista and with which Acrobat Version.

    Good luck, Reinhard
  • User 1 posts since
    Jul 24, 2007
    Currently Being Moderated
    33. Jul 24, 2007 9:45 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    This is great!

    Works with Acrobat 8.0

    those having trouble, make sure to save the .js file to the appropriate \program files\adobe\acrobat "X"\javascript folder.

    Questions:

    A. I am a novice at javascripting. what changes to the script need to be made to move this from footer to header?

    B. How to I make it so that this script is available to the Batch Processing in Acrobat?

    thanks in advance
  • User 1 posts since
    Aug 23, 2007
    Currently Being Moderated
    34. Aug 23, 2007 8:31 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    I have the same problem that Eli had with version 7.0. I've tried two versions of the JS above (PrintWithFooter.js) and (SetRemoveFooter.js), and I have the two sub-menus under the File menu, but "internal errors" every time I try to use them.

    Has anyone had any success with 7.0?

    Thanks,

    M
  • User 2 posts since
    Aug 27, 2007
    Currently Being Moderated
    35. Aug 27, 2007 8:02 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Yes, I have used this script with professional 7.0 without problem. I did download from the site provided.
  • User 2 posts since
    Aug 27, 2007
    Currently Being Moderated
    36. Aug 27, 2007 8:03 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Can any help me with changing the color of the font this script puts in the footer?

    It comes in black and the pdfs I am printing are already dark colors.

    best regards,
    DB
  • User 1 posts since
    Oct 17, 2007
    Currently Being Moderated
    37. Oct 17, 2007 2:07 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    This works great putting the filename to the Header was
    Just wondering if there is a way to change the font.
    fd.textsize changes the size of the font
    Why doesn't fd.textfont="Broadway" change the font.
    I Need it to printout a specila type of font is it possible
  • GKaiseril Contributor 3,198 posts since
    Jul 31, 2006
    Currently Being Moderated
    38. Oct 17, 2007 2:26 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    You are creating a form field and can only use the fonts available to the form field. More information about the use of arbitrary fonts is contained in the Acrobat JavaScript Scripting Reference.
  • User 1 posts since
    Jan 17, 2008
    Currently Being Moderated
    39. Jan 17, 2008 11:21 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    How can I insert the filename into the header?
  • User 1 posts since
    Jun 6, 2008
    Currently Being Moderated
    40. Jun 6, 2008 9:32 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    How can I just add a footer to odd or even pages only? Here is my code below!

    app.addMenuItem({cName:"Training Guide - Insert Footer", cParent:"Document", nPos:3, cExec:"PrtFooter();"});


    function PrtFooter()
    {
    var re = /.*\/|\.pdf$/ig;
    var FileNM = this.path.replace(re,"")+"";
    for (var p = 3; p < this.numPages; p++)
    {
    var fd = this.addField("Date", "text", p, [520,45, 670,5]);
    fd.textSize=9; fd.readonly=true; fd.value = "" + util.printd("mm/dd/yyyy", new Date())
    var fd = this.addField("File", "text", p, [43,45, 250,5]);
    fd.textSize=9; fd.readonly=true; fd.value = "" + util.printd("", new Date()) + FileNM
    var fp = this.addField(String("page"+p+1), "text", p, [280,45,335,5]);
    fp.textSize=9; fp.readonly=true; fp.value = "Page " + String(p+1)+ " of " + this.numPages;
    }
    }
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    41. Jun 8, 2008 3:06 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Write:

    var p=p+1

    at the end of the for loop.

    HTH, Reinhard
  • User 1 posts since
    Jun 11, 2008
    Currently Being Moderated
    42. Jun 11, 2008 2:26 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Hi !!

    I'll ask to help me.
    I search a solution to print a document pdf.
    I want to print a pdf's file and close acrobat reader.

    Witch the command line, I can open file and print the file. But I can't close the api acrobat reader.

    Anyone could say me if there are a solution. Witch a command line or a javascript program or other.

    Thanks to your help
  • User 2 posts since
    Jun 25, 2008
    Currently Being Moderated
    43. Jun 25, 2008 9:05 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    I'm having the same problem with the "internal error" message. I am using Reader 8 and have saved the "txt" file created in Notepad to "program files->adobe->Redaer 8.0->Reader->Javascripts". I am using Windows XP.
    The Set/Remove Footer option is showing in the "File Menu" in Reader 8.0. However, the internal error occurs whenever i try to click on it.
    Any help would definitely be appreciated.
    Thanks!
  • Bernd Alheit Star 7,338 posts since
    Aug 11, 2002
    Currently Being Moderated
    44. Jun 25, 2008 9:12 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    You can use this JavaScript code only with Adobe Acrobat, not Adobe Reader.
  • User 2 posts since
    Jun 25, 2008
    Currently Being Moderated
    45. Jun 25, 2008 10:21 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Thanks for the quick response! Do you happen to know if there is anyway to provide the footer info in Adobe Reader?
  • John T Smith Star 12,453 posts since
    Oct 26, 2006
    Currently Being Moderated
    46. Jun 25, 2008 10:51 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    You might also ask in the Reader forum, since it is a different product

    http://www.adobeforums.com/webx?13@@.3bbf42f7
  • GKaiseril Contributor 3,198 posts since
    Jul 31, 2006
    Currently Being Moderated
    47. Jun 25, 2008 11:06 AM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    One can use JavaScript in Reader, but JavaScript can only be added and edited in Acrobat. There are also many JavaScript methods that can not be done in Reader.

    It is certainly possible to use Acrobat to add a field in the footer area, add a "Will Print" action to fill the form field with the file name to the field. Because the field already exist, there is no need to perform this action in Reader. And the "Will Print" insertion of the file name by JavaScript will work in Reader. In fact the Acrobat JavaScript includes information as to which JavaScript object, properties, and methods are available for use in Reader to help form developers know what can be done by an end user with Reader.

    addWaterMarkFromFile is available to JavaScript in Acrobat but is not available to Reader when using JavaScript or not.

    Of course the above assumes one has access to the Professional version of Acrobat and can edit the PDF.
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    48. Jun 25, 2008 3:12 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    If you have only the Reader you can use a freeware like this:

    http://www.becyhome.de/download_ger.htm#becypdfasm

    Not perfect, but it works and for batch processing (merge, split, bookmarks) much easyer to use as Acrobat.

    HTH, Reinhard
  • ReinhardF User 214 posts since
    Aug 11, 2002
    Currently Being Moderated
    49. Jun 25, 2008 3:17 PM (in response to (Lloyd_G_Guenther))
    Re: Print File Name with pdf Document
    Oh,
    took the german link
    here the english one.

    http://www.becyhome.de/download_eng.htm#becypdfasm

    Best regards, Reinhard
1 2 3 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)