1、 for( jj= 0; jj 3; +jj ) if( ii!= 0 | jj!= 0 ) ds+= bp_delim; ds+= dataiijj; global.pdf_hacks_js_bookmarks= ds; global.setPersistent( pdf_hacks_js_bookmarks, true );function GetData()/ reverse of SaveData; return an array of arrays if( global.pdf_hacks_js_bookmarks= null ) return new Array(0); var f
2、lat= global.pdf_hacks_js_bookmarks.split( bp_delim ); var data= new Array(); flat.length; ) var record= new Array(); 3 & +ii, +jj ) record.push( flatii ); if( record.length= 3 ) data.push( record ); return data;/Get Current Datefunction DateNow() var d, tmp ,s ; d = new Date(); t = d.getFullYear();
3、s = t + / t = (d.getMonth() + 1).toString(); if(t.length!=2) t = 0 + t; s += t + t = (d.getDate().toString(); s += t; return(s);function AddBookmark()/ query the user for a name, and then combine it with/ the current PDF page to create a record; store this record var thisfilename=this.documentFileNa
4、me; thisfilename=thisfilename.substr(0,thisfilename.lastIndexOf(.); var numLen = this.numPages.toString().length; var numPlugInss=this.pageNum+1; while(numPlugInss.toString().length numLen) numPlugInss = + numPlugInss; var currentdate=DateNow(); var label=+thisfilename+第 +numPlugInss+ 页/共 +this.numP
5、ages+ 页 + currentdate; var cResponse = app.response( cQuestion: label, cTitle: 添加书签, cDefault:无备注 cLabel:备注: ); if( cResponse!= null ) var record= new Array(3); record0= label + + cResponse; record1= this.path; record2= this.pageNum; data= GetData(); SaveData( data );function ShowBookmarks()/ show a
6、 pop-up menu; this seems to only work when/ a PDF is alreay in the viewer; var data= GetData(); var items= items+= , + ii+ : + dataii0+ / assemble the command and the execute it with eval() var command= app.popUpMenu( + items+ ); var selection= eval( command ); if( selection= null ) return; / exit/
7、the user made a selection; parse out its index and use it/ to access the bookmark record var index= 0;/ toString() converts the String object to a string literal/ eval() converts the string literal to a number index= eval( selection.substring( 0, selection.indexOf() ).toString() ); if( index data.le
8、ngth ) try / the document must be disclosed for us to have any access / to its properties, so we use these FirstPage NextPage calls / if(this.path = dataindex1) this.pageNum = dataindex2; else var otherDoc = app.openDoc( dataindex1); otherDoc.pageNum = dataindex2; catch( ee ) var response= app.alert
9、(打开书签错误. 是否删除本书签?, 2, 2,删除书签); if( response= 4 & index data.splice( index, 1 );function DropBookmark()/ modelled after ShowBookmarks()function ClearBookmarks() if( app.alert(确认要清除所有的书签吗,删除后将不可恢复? )= 4 ) SaveData( new Array(0) );app.addMenuItem(cName:-, / menu dividercParent:View, / append to the Vie
10、w menucExec:void(0); );AddBookmark,cUser:设置本页为书签(&B)AddBookmark();cEnable:event.rc= (event.target != null);ShowBookmarks转到指定书签(&T)ShowBookmarks();DropBookmark删除一个书签(&D)DropBookmark();ClearBookmarks删除所有书签(&C)ClearBookmarks();event.rc= true;4 将文件拷贝到C:Program Files (x86)AdobeReader 10.0ReaderJavascripts目录下5 重新打开Adobe Reader,看看下面的视图,相信不用说任何东西,大家都会用了
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2