page links for crereader and pdfreader

Swipe right will return to previous page or position.
This commit is contained in:
chrox
2014-01-18 15:04:24 +08:00
parent f6cf3aa497
commit 34e28d28e6
4 changed files with 97 additions and 25 deletions

View File

@@ -97,6 +97,21 @@ function PdfDocument:getUsedBBox(pageno)
return used
end
function PdfDocument:getPageLinks(pageno)
local hash = "pglinks|"..self.file.."|"..pageno
local cached = Cache:check(hash)
if cached then
return cached.links
end
local page = self._document:openPage(pageno)
local links = page:getPageLinks()
Cache:insert(hash, CacheItem:new{
links = links,
})
page:close()
return links
end
function PdfDocument:getPageBBox(pageno)
return self.koptinterface:getPageBBox(self, pageno)
end