Line
Link Here
|
0 |
-- pdfshuffler |
0 |
++ pdfshuffler |
Lines 982-990
Link Here
|
982 |
pix_w, pix_h = page.get_size() |
982 |
pix_w, pix_h = page.get_size() |
983 |
pix_w = int(pix_w * self.scale) |
983 |
pix_w = int(pix_w * self.scale) |
984 |
pix_h = int(pix_h * self.scale) |
984 |
pix_h = int(pix_h * self.scale) |
985 |
thumbnail = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, |
985 |
pixmap = gtk.gdk.Pixmap(None, pix_w, pix_h, 24) |
986 |
8, pix_w , pix_h) |
986 |
cr = pixmap.cairo_create() |
987 |
page.render_to_pixbuf(0,0,pix_w,pix_h,self.scale,0,thumbnail) |
987 |
# The pixmap data is not initialized, so paint it white first: |
|
|
988 |
cr.set_source_rgb(1, 1, 1) |
989 |
cr.paint() |
990 |
cr.scale(self.scale, self.scale) |
991 |
page.render(cr) |
992 |
thumbnail = gtk.gdk.pixbuf_get_from_drawable( |
993 |
None, pixmap, gtk.gdk.colormap_get_system(), 0, 0, 0, 0, pix_w, pix_h) |
988 |
rotation = (-rotation) % 360 |
994 |
rotation = (-rotation) % 360 |
989 |
rotation = ((rotation + 45) / 90) * 90 |
995 |
rotation = ((rotation + 45) / 90) * 90 |
990 |
thumbnail = thumbnail.rotate_simple(rotation) |
996 |
thumbnail = thumbnail.rotate_simple(rotation) |
Lines 1003-1013
Link Here
|
1003 |
pix_w = thumbnail.get_width() |
1009 |
pix_w = thumbnail.get_width() |
1004 |
pix_h = thumbnail.get_height() |
1010 |
pix_h = thumbnail.get_height() |
1005 |
except: |
1011 |
except: |
|
|
1012 |
import traceback |
1013 |
traceback.print_exc() |
1006 |
pix_w = self.default_width |
1014 |
pix_w = self.default_width |
1007 |
pix_h = pix_w |
1015 |
pix_h = pix_w |
1008 |
thumbnail = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, |
1016 |
thumbnail = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False, |
1009 |
8, pix_w, pix_h) |
1017 |
8, pix_w, pix_h) |
1010 |
pixbuf.fill(0xffffffff) |
1018 |
thumbnail.fill(0xffffffff) |
1011 |
|
1019 |
|
1012 |
#add border |
1020 |
#add border |
1013 |
thickness = 3 |
1021 |
thickness = 3 |