mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
getPageLinks implementation for mupdf #72
This is rough first draft, and provides just dump of all links available on pdf page. Binding to Shift+L is temporary and just for debugging!
This commit is contained in:
@@ -45,3 +45,16 @@ function PDFReader:getText(pageno)
|
||||
page:close()
|
||||
return text
|
||||
end
|
||||
|
||||
function PDFReader:getPageLinks(pageno)
|
||||
local ok, page = pcall(self.doc.openPage, self.doc, pageno)
|
||||
if not ok then
|
||||
-- TODO: error handling
|
||||
return nil
|
||||
end
|
||||
local links = page:getPageLinks()
|
||||
Debug("## page:getPageLinks ", links)
|
||||
page:close()
|
||||
return links
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user