re-added copy check
[swftools.git] / lib / pdf / pdf.cc
index 189a05c..840a8da 100644 (file)
@@ -133,6 +133,11 @@ static void render2(gfxpage_t*page, gfxdevice_t*dev, int x,int y, int x1,int y1,
     pdf_doc_internal_t*pi = (pdf_doc_internal_t*)page->parent->internal;
     gfxsource_internal_t*i = (gfxsource_internal_t*)pi->parent->internal;
 
+    if(pi->nocopy) {
+        msg("<fatal> PDF disallows copying");
+        exit(0);
+    }
+
     CommonOutputDev*outputDev = 0;
     if(pi->config_full_bitmap_optimizing) {
        FullBitmapOutputDev*d = new FullBitmapOutputDev(pi->info, pi->doc);
@@ -150,6 +155,12 @@ static void render2(gfxpage_t*page, gfxdevice_t*dev, int x,int y, int x1,int y1,
        outputDev->setParameter(p->name, p->value);
        p = p->next;
     }
+    p = pi->parameters.device_config;
+    while(p) {
+       outputDev->setParameter(p->name, p->value);
+       p = p->next;
+    }
+
     outputDev->setPageMap(pi->pagemap, pi->pagemap_pos);
     outputDev->setMove(x,y);
     outputDev->setClip(x1,y1,x2,y2);
@@ -182,11 +193,13 @@ static void render2(gfxpage_t*page, gfxdevice_t*dev, int x,int y, int x1,int y1,
     pi->doc->processLinks((OutputDev*)outputDev, page->nr);
     outputDev->finishPage();
     outputDev->setDevice(0);
+    delete outputDev;
 
     if(middev) {
        gfxdevice_rescale_setdevice(middev, 0x00000000);
        middev->finish(middev);
     }
+
 }