Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Hi can you help with printing file name and folder path to pdf's when printing?
Copy link to clipboard
Copied
You have to add a from field to your PDF and you have to add a "Will Print" JavaScript action.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied