diff options
Diffstat (limited to 'src/render.c')
-rw-r--r-- | src/render.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/render.c b/src/render.c index eb74857..cdf3b0a 100644 --- a/src/render.c +++ b/src/render.c @@ -543,12 +543,13 @@ cairo_surface_t *render_sc(SCBlock *scblocks, int w, int h, int export_pdf(struct presentation *p, const char *filename) { - int i; double r; double w = 2048.0; double scale; cairo_surface_t *surf; cairo_t *cr; + SCBlock *bl; + int i; r = p->slide_height / p->slide_width; @@ -561,12 +562,16 @@ int export_pdf(struct presentation *p, const char *filename) cr = cairo_create(surf); scale = w / p->slide_width; - for ( i=0; i<p->num_slides; i++ ) { + i = 1; + while ( bl != NULL ) { + + if ( strcmp(sc_block_name(bl), "slide") != 0 ) { + bl = sc_block_next(bl); + continue; + } - struct slide *s; SCBlock *stylesheets[2]; - s = p->slides[i]; stylesheets[0] = p->stylesheet; stylesheets[1] = NULL; @@ -578,7 +583,7 @@ int export_pdf(struct presentation *p, const char *filename) cairo_set_source_rgb(cr, 1.0, 1.0, 1.0); cairo_fill(cr); - render_sc_to_surface(s->scblocks, surf, cr, p->slide_width, + render_sc_to_surface(sc_block_child(bl), surf, cr, p->slide_width, p->slide_height, stylesheets, NULL, p->is, ISZ_SLIDESHOW, i, p->lang); @@ -586,6 +591,9 @@ int export_pdf(struct presentation *p, const char *filename) cairo_show_page(cr); + bl = sc_block_next(bl); + i++; + } cairo_surface_finish(surf); |