put highlight implementation into unireader

This commit is contained in:
HW
2012-04-11 22:52:48 +02:00
parent e772d9f0d7
commit 46d197954b
4 changed files with 648 additions and 608 deletions

View File

@@ -30,3 +30,25 @@ function PDFReader:open(filename)
end
return true
end
-----------[ highlight support ]----------
function PDFReader:rectCoordTransform(x0, y0, x1, y1)
return
x0 * self.globalzoom,
y1 * self.globalzoom - self.offset_y,
x1 - x0,
y1 - y0
end
function PDFReader:getText(pageno)
local ok, page = pcall(self.doc.openPage, self.doc, pageno)
if not ok then
-- TODO: error handling
return nil
end
local text = page:getPageText()
print(dump(text))
page:close()
return text
end