Hi,
How can we invoke user defined javascript functions in the code. Can you provide a sample javascript file which reads all the hyperlinks in the PDF document.
Thanks
Mamatha
Hi,
How can we invoke user defined javascript functions in the code. Can you provide a sample javascript file which reads all the hyperlinks in the PDF document.
Thanks
Mamatha
Hi Mamatha,
I am on Java environment. Actually I tried to add javascript to pdf in the following way.
String str = "var numLinks=0;var myBorderWidth=1;var myBorderColor=color.black;";
str+= "for ( var p = 0; p < this.numPages; p++) "+
"{"+
"var b = this.getPageBox(\"Crop\", p); "+
"var l = this.getLinks(p, b); "+
"for (var i=0; i < l.length; i++) "+
"{"+
" l[i].borderColor = color.blue;"+
"}"+
"}";
pdf.getJavaScripts().add(str);
Is there any other way of invoking javascripts.
Thanks
Mamatha
Hi Mamatha,
Please follow the instructions specified over following link for Adding Javascript actions to a PDF file