pg->bg = (struct Background *)g_memdup(template->bg, sizeof(struct Background));
pg->bg->canvas_item = NULL;
if (pg->bg->type == BG_PIXMAP || pg->bg->type == BG_PDF) {
pg->bg = (struct Background *)g_memdup(template->bg, sizeof(struct Background));
pg->bg->canvas_item = NULL;
if (pg->bg->type == BG_PIXMAP || pg->bg->type == BG_PDF) {