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:
Dobrica Pavlinusic
2012-09-21 13:28:13 +02:00
parent e1fc748faf
commit 71ff602cd5
3 changed files with 79 additions and 0 deletions

View File

@@ -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