我正在尝试使用python-evince包为lucid-lynx gnome编写一个简单的"hello-world"-type程序,它将Evince嵌入到python-gtk窗口中。我在网上找到的样本是这样的:
import evince
import gtk
w = gtk.Window()
w.show()
e = evince.View()
w.add(e)
e.show()
document = evince.document_factory_get_document('my pdf file')
e.set_document(document)
gtk.main()问题是"evince.set_document“不再存在:论坛似乎表明最近发生了一些变化,但我一直无法弄清楚让它工作所需的(可能非常简单的)修改。有人能帮上忙吗?
发布于 2010-08-05 14:38:16
API已经改变,增加了一个额外的步骤。这些说明应该会有所帮助:
>>> e = evince.View()
>>> docmodel = evince.DocumentModel()
>>> doc = evince.document_factory_get_document('file:///path/to/file/example.pdf')
>>> docmodel.set_document(doc)
>>> e.set_model(model)https://stackoverflow.com/questions/3411929
复制相似问题