我想将 PDF 文件中的页面显示到 GtkIconView 中。为此,我需要在我的 GtkTreeModel 中有一个 GDK_TYPE_PIXBUF 类型的列。如何将我的 PDF 页面呈现为 Pixbuf?
有page
, a PopplerPage
,我试过这个:
surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 320, 240)
page.render(surface)
img = Gdk.pixbuf_get_from_surface(surface, 0, 0, 320, 240)
((*&(&cr->ref_count)->ref_count) > 0)
但是,当它执行render
命令时,我得到一个关于断言的错误。