GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Oct 21, 2014 12:37 am

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: PopplerPdf Viewer Scale
PostPosted: Sat Jun 30, 2012 5:19 pm 
Offline

Joined: Tue Dec 20, 2011 9:20 pm
Posts: 3
Hello,

i updated my poppler pdfviewer to GTK+3.0.


there is a problem now. this code returns a GdkPixbuf with the rendered PopplerPage page

Code:
GdkPixbuf * viewPage(PopplerPage *page)
{
   gint stdwidth = 1280;
   gint stdheight = 1024;
   

   cairo_surface_t *s;
   cairo_t *cr;
   s = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, stdwidth, stdheight);
   cr = cairo_create(s);
   poppler_page_render(page, cr);
   bild = gdk_pixbuf_get_from_surface(s, 0, 0, stdwidth, stdheight);


   cairo_surface_destroy(s);
   cairo_destroy(cr);
   return bild;
}



The Pixbuf has a size of 1280x1024 but the rendered page is only about 360x270. How can i scale the PDF Page to the same size as the pixbuf (stdwidth x stdheight)?


greetz


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group