Get a PDF that doesn't have a catalog because it's really uncomfortable ... So think there is no way to automate the method can be generated directory quq, check it out. Acrobat has JS API can provide, but after writing found only in Acrobat can index Quq, other readers cannot use index ... can only see the directory ... I'm really upset. (* ̄^ ̄)
Let's talk about thinking first. It's silly. In general, when the book is sold in places where there are books and page numbers, this is very easy to find. Then copy into TXT, first use Python to turn it into an array (because lazy so are all level of directory), and then use the JS script to add an array of directories.
Python:
#usr/bin/env python
#-*-coding:utf-8-*-
import Re, sys
Reload (SYS)
sys.setdefaultencoding (' UTF8 ')
filename = "Catagory.txt"
output = "Result.txt"
file = open (filename, "R") Out
= open (Output, "w")
ret = "["
pat = re.compile (. *?) (\d{1,4}$) ') for line in
File.readlines ():
try:
tmp = re.findall (Pat, line)
print tmp[0][0] , tmp[0][1]
ret = "[" + Tmp[0][0].strip () + "'," + tmp[0][1] + "],\n"
except:
ret = "[" + Line.strip () + "'],\n"
ret = "]"
out.write (ret)
file.close ()
out.close ()
Is it easy to have ... I think I really use python as a tool ...
Then the JS code, this is the official document directly on some:
function CreateBookMark (parent) {for
(var i=0;i<arr.length;i++) {
if (arr[i].length>1)
Parent.createchild (arr[i].[ 0], "this.pagenum=16+" +arr[i]. [1]); This 16 is the page number in the PDF and the offset of the original page number of the bibliography
else Parent.createchild (arr[i].[ 0]);
}
Createchild (name, script). The first is the name of the bookmark, the second is what you do with the bookmark, and then you can set the Pagenum to the target page number.
What I do is white hat, web security ... The general result is this:
But only in Acrobat, with Quq, Boingo hindering.