我想把PDF文件中的页面显示到GtkIconView中。为了实现这一点,我需要在GtkTreeModel中使用GDK_type_PIXBUF类型的列。如何将PDF页面呈现为Pixbuf?
有了page
,一个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
命令时,我得到了一个错误。在
试试这个
Reference
最后,我明白了。我必须呈现一个cairo上下文,就像这样:
相关问题 更多 >
编程相关推荐