• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Locked

Print File Name with pdf Document

New Here ,
Aug 30, 2006 Aug 30, 2006

Copy link to clipboard

Copied

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?
TOPICS
Print and prepress

Views

220.8K

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
replies 161 Replies 161
New Here ,
Nov 09, 2006 Nov 09, 2006

Copy link to clipboard

Copied

I have exactly the same question; it's unimaginable that this can't be done.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 09, 2006 Nov 09, 2006

Copy link to clipboard

Copied

you can do it with a JavaScript.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

Add some JavaScript to your document as a "Will print" event.

Details in the Acrobat JavaScript Guide.

Leonard

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 13, 2006 Nov 13, 2006

Copy link to clipboard

Copied

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

} }

}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 25, 2011 May 25, 2011

Copy link to clipboard

Copied

So this works with PRO but does anyone have script that will work

with Reader?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 25, 2011 May 25, 2011

Copy link to clipboard

Copied

The code will be saved as part of the pdf file, so regardless of where you run it, Reader of Pro or Standard the code will execute. I saved the PDF in pro and all the users that read our documents use Reader to read the pdf file. Once they go to print the file the code executes.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 25, 2011 May 25, 2011

Copy link to clipboard

Copied

Is there any way to get the time printed?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 26, 2011 May 26, 2011

Copy link to clipboard

Copied

Have you tried running the code?

The 'util.printd()' is a method to format the JS data time object. What is displayed is controlled by the formatting string entries to select the elements of the date time and how to format those selected elements.

For example the above code will create the following string:

"Thursday May 26 2011 3:07 pm   (/C/Program Files/Adobe/Acrobat 8.0/Help/ENU/JS_api_reference.pdf)"

With additional programing, you can even get the timezone offset and the UTC time.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 22, 2011 Nov 22, 2011

Copy link to clipboard

Copied

Reinhard,

Greetings.  I just found your script for adding the footnote that includes the date and the file path to the page.  I also read the many subsequent posts to your code.  Can you tell me which post/code that will print the  footnote, but does not throw the warning when you press the 'Yes' button when the "Warning: JavaScript Winow Delete Date / Filename"?

Many thanks for the code and any help you can give.  I am working in Adobe Acrobat 9.4.6 if that helps?

Thanks,

Richard

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 23, 2011 Nov 23, 2011

Copy link to clipboard

Copied

Mmmh,

I'm not sure what script you used:

1. SetRemoveFooter.js ( = folder level javascript, which produce a Menuitem "Set/Remove Footer" under File) or

2. AcFooterBatch.vbs ( = VBScript which uses activeX to execute from 1. extracted footer javascript in a batch via drag and drop or commandline)

In 1. is no button, in 2. is only OK/Cancel button. For me both works without warning (AAv9.2.0). The only setting I change from standard is the presetting for javascipt (under edit). I marked the second selection (execute js via menuitem). Perhabs you test that.

best regards, Reinhard

PS: Menitems description free translated from german verrsion

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 23, 2011 Nov 23, 2011

Copy link to clipboard

Copied

Reinhard,

Greetings,  I am trying to use the script PrintWithFooter.js.  The file path I have is is so long that it is overlapping the page number.  I do not need the page number, just the file path and the date it is being printed.  Does this help?

Best Regards,

Richard

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 24, 2011 Nov 24, 2011

Copy link to clipboard

Copied

Hi,

it seems you have an older version. In the latest you can choose if you only want to print Date and filename only.

The latest version you can download from:

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

If you have the old version I assume you can delete or comment out (= write // in the front of the text) this lines:

var fp = this.addField(String("page"+p+1), "text", p, [330,10,280,28]);     //<- this set up the page number file

fp.textSize=8; fp.value = "Page: " + String(p+1)+ "/" + this.numPages;  //<- this fomat the page number field

If that not help, please copy in the js-code you work with, so also other with a more compareable working time, can give you the small changes.

best regards, Reinhard

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 27, 2011 Nov 27, 2011

Copy link to clipboard

Copied

Hi ReinhardF!

I would like to have a footer showing only this:

The full file path + date

What changes should I do in your original script which, however, works perfect in AA X.

Regards

Arne

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 28, 2011 Nov 28, 2011

Copy link to clipboard

Copied

Hi,

you can change in the script following lines:

var AcDateFormat = "yyyy/mmm/dd  HH:MM"

to

var AcDateFormat = "yyyy/mmm/dd"

and

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

to

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

best regards, Reinhard

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 28, 2011 Nov 28, 2011

Copy link to clipboard

Copied

Thanks, I have allready changed those two lines.

But I would also get rid of all lines that is about page numbers, because I will not use that.

How to change the line : fd.value = util.printd .........................

to show the full path first an then the date?

Thanks in advance!

Best regards

Arne

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 29, 2011 Nov 29, 2011

Copy link to clipboard

Copied

Change to:

fd.value =  "Path: " + Path +"  Date: " + util.printd(AcDateFormat, AcDate);

or similar, where "..." is "my Text".

HTH, Reinhard

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 29, 2011 Nov 29, 2011

Copy link to clipboard

Copied

Reinhard,

Dies ist eine sehr gute Arbeit!

I have read this thread with interest since I nioticed it today and have placed your JavaScript in my Acrobat 6.0 install folder. I have been able to make modifications to the components of the footer (date format, adding PRELIMINARY to the textstring, changing text size). It works very well and gives me a new tool for identifying preliminary versions of manuals.

Would you explain how to change the location of the footer? I would like to place it a little higher on the page. 

BTW, I noticed that Acrobat has a feature called Add Headers & Footers but it is much more time consuming to use and does not have the flexibility, ease of use, and performance of your script.

Danke,

Michael F

=======

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 29, 2011 Nov 29, 2011

Copy link to clipboard

Copied

Danke Michael,

habe einfach nicht die Zeit es mal komplett - mit mehr Optionen - zu überarbeiten.

"Would you explain how to change the location of the footer? I would like to place it a little higher on the page."

You can inrease the y-coordinates: upper left (y1) and lower right (y2):

If you want the field 10 Pts higher you can change:

var fd = this.addField("xftDate", "text", p, [30,15, TotWidth-30-30,30]);

to

var fd = this.addField("xftDate", "text", p, [30,15+10, TotWidth-30-30,30+10]);

The difference between y1 and y2 is the field hight.

The calculation for the field placing on the page start at lower left corner (= 0).

HTH, Reinhard

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 30, 2011 Nov 30, 2011

Copy link to clipboard

Copied

This goes both to ReinhardF and Michael314!

I'm a total novise as far as programming is concerned. I have ReinhardF's javascript and it works perfect i AA X.

I wonder if some of you experts could make me a Javascript that show the full file path and nothing else on the first page only of a document as a footer.

Please give me the option of choosing between left, center or right position.

Thanks!!!!

Best regards

Arne

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 30, 2011 Nov 30, 2011

Copy link to clipboard

Copied

Arne,

Reinhard did give you a hint back in post 124.

Change the fd.value statement to this:

fd.value =  "Path: " + Path;

When you open the PDF file and select any of the Set Date... commands, it will insert only the file path.

I think the pages affected are controlled by this statement but I don't know how to adjust it.

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

Yours,

Michael F

=======

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 01, 2011 Dec 01, 2011

Copy link to clipboard

Copied

"I think the pages ..." thats correct.

@ Arne

Change:

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

to

for (var p = 0; p < 1; p++)

to get it only on the first page, or:

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

to get it on all, but not on first.

The second question: "Please give me the option of choosing between left, center or right position" astonished me. It's already in the menu selection. I think at least you can test the script before asking.

best regards, Reinhard

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 01, 2011 Dec 01, 2011

Copy link to clipboard

Copied

Hi!

Sorry about that second question, it is already solved.

The last thing I 'll ask is what lines to be removed when I don't need the page numbering.

Thanks for the great effort!

Best regards

Arne

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines