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

Print File Name with pdf Document

New Here ,
Aug 30, 2006 Aug 30, 2006
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
243.5K
Translate
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 ,
Apr 17, 2007 Apr 17, 2007
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
Translate
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 ,
Apr 18, 2007 Apr 18, 2007
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
Translate
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 ,
Jul 24, 2007 Jul 24, 2007
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
Translate
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 ,
Aug 23, 2007 Aug 23, 2007
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
Translate
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 ,
Aug 27, 2007 Aug 27, 2007
Yes, I have used this script with professional 7.0 without problem. I did download from the site provided.
Translate
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 ,
Aug 27, 2007 Aug 27, 2007
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
Translate
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 ,
Oct 17, 2007 Oct 17, 2007
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
Translate
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 ,
Oct 17, 2007 Oct 17, 2007
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.
Translate
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 ,
Jan 17, 2008 Jan 17, 2008
How can I insert the filename into the header?
Translate
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 ,
Jun 06, 2008 Jun 06, 2008
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;
}
}
Translate
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 ,
Jun 08, 2008 Jun 08, 2008
Write:

var p=p+1

at the end of the for loop.

HTH, Reinhard
Translate
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 ,
Jun 11, 2008 Jun 11, 2008
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
Translate
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 ,
Jun 25, 2008 Jun 25, 2008
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!
Translate
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
Community Expert ,
Jun 25, 2008 Jun 25, 2008
You can use this JavaScript code only with Adobe Acrobat, not Adobe Reader.
Translate
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 ,
Jun 25, 2008 Jun 25, 2008
Thanks for the quick response! Do you happen to know if there is anyway to provide the footer info in Adobe Reader?
Translate
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
Community Expert ,
Jun 25, 2008 Jun 25, 2008
You might also ask in the Reader forum, since it is a different product

http://www.adobeforums.com/webx?13@@.3bbf42f7
Translate
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 ,
Jun 25, 2008 Jun 25, 2008
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.
Translate
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 ,
Jun 25, 2008 Jun 25, 2008
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
Translate
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 ,
Jun 25, 2008 Jun 25, 2008
Oh,
took the german link
here the english one.

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

Best regards, Reinhard
Translate
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 01, 2010 Nov 01, 2010

Reinhard Franke,

How do I print the Bookmark name?

I have many pdf documents, where each bookmark is a page.

I am already using part of the script that print the page number. I would like to print each bookmark along with the page number.

I have modified the line

fp.value = "Page: " + String(p+1)+ "/" + this.numPages + " -- " + this.bookmark '// This does not print it.

My knoledge of java script is limited.

Can you please help?

Thanks

Translate
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 24, 2013 May 24, 2013

I have modified Java Script. This is to make footer as the bookmark name of each pages(only applies 1st level bookmarks). I use this script when I merge many files into one PDF.

Please see below:

=======================
app.addSubMenu({ cName: "BMKFooter",cUser: "BookMark Footer", cParent: "File", nPos: 21 });


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


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


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


//Set/remove Footer
function SetFooter(ARG)
{
var bmk = this.bookmarkRoot;
var BMKName;
var lastBMKPage=0;
var currentBMKPage=0;
var p=0;

if(bmk.children != null){ 

for(var i = 0; i < bmk.children.length; i++){ 

BMKName=bmk.children.name;

if(i<=bmk.children.length-2){
bmk.children[i+1].execute();
lastBMKPage = this.pageNum-1; }
else {lastBMKPage = this.numPages -1;}

for ( p = currentBMKPage; p <= lastBMKPage; p++){

var aRect = this.getPageBox("Crop",p);
var TotWidth = aRect[2] - aRect[0]
if (ARG==9)
  {var  fd = this.addField(String("xftDate"+p+1), "text", p, [30+TotWidth/2,15, TotWidth-30,40]);
  fd.value = " " + BMKName +" "; //print bookmark name
  fd.textSize=10; fd.readonly = true;
  fd.alignment="right";
  }

currentBMKPage = lastBMKPage +1;

}}

function RemoveFooter(ARG)
{
if (ARG==9)
{for (var p = 0; p < this.numPages; p++)
{var x = this.removeField(String("xftDate"+p+1));}
}
//if (ARG==9)
//{ for (var p = 0; p < this.numPages; p++)
//{var x = this.removeField(String("xftPage"+p+1)); }
//if (ARG<=3 || ARG==9) {var x = this.removeField("xftRem");}
//}
}

==========================

This is very late response. But I hope this is helpful for you.

Translate
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 ,
Feb 24, 2011 Feb 24, 2011

Hi can you help with printing file name and folder path to pdf's when printing?

Translate
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 ,
Feb 24, 2011 Feb 24, 2011

You have to add a from field to your PDF and you have to add a "Will Print" JavaScript action.

Translate
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 ,
Feb 25, 2011 Feb 25, 2011

I added the following code to the will print event in.. worked like a charm.  Copy and paste the following if you ever need your PDF to print date and path of the file on the footer of the PDF.

var f = this.getField("Today");
f.value = util.printd('dddd mmmm dd yyyy h:MM tt   ', new Date())+ "("+this.path +")";

Thanks

Translate
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 ,
Jul 01, 2008 Jul 01, 2008
The javascript that Reinhard Franke posted above is what i've been looking for, except that i don't want it show the date and time stamps, only the file path.

I tried editing Reinhard's script with no success (probably because i don't know java). Can anyone create a simplified version of this script just for adding/removing the file path. Or does anyone know of another script that will accomplish what i'm looking for?
Translate
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