I'm making a pdf editor in python reusing evince and Gtk libraries.
I would like to add a link with a click, but I don't know *how to convert
the cursor position I get from the click event to the position and page in
the pdf document.*
I would also like to *add annotations* (highlights for example), this
should be implemented in evince, but I don't know how to import this
feature in python.
I'm using Evince library:
import gi
gi.require_version("Gtk", "3.0")from gi.repository import Gtk, Gio,
GLibfrom gi.repository import EvinceDocumentfrom gi.repository import
EvinceViewfrom gi.repository import Gdk
I made a gtk window class PdfWindow(Gtk.ApplicationWindow) where I have
defined the evince document and the necessary windows:
self.scroll = Gtk.ScrolledWindow()
self.add(self.scroll)EvinceDocument.init()
self.open_file("file.pdf")
self.doc = EvinceDocument.Document.factory_get_document("file://file.pdf")
self.view = EvinceView.View()
model = EvinceView.DocumentModel()
model.set_document(self.doc)
self.model = model
self.view.set_model(self.model)
self.view.connect('external-link', self.__handle_link_cb)
self.view.connect('event', self.click_event_cb)
The cursor position I get in click_event_cb that handles the click event is
the position in the window, not the x,y position in the pdf. Any idea?
In addition, I don't know how to integrate annotations as they are in the
evince application. anyone can help?
thanks
Davide
_______________________________________________
evince-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/evince-list