added clipping against cropbox (page background shape).
[swftools.git] / pdf2swf / swfoutput.cc
index 98701b0..ca507c3 100644 (file)
@@ -1407,6 +1407,8 @@ void swfoutput_init(struct swfoutput* obj, char*_filename, int x1, int y1, int x
       swf_ShapeFree(s);
       tag = swf_InsertTag(tag, ST_PLACEOBJECT2);
       swf_ObjectPlace(tag,shapeid,depth++,0,0,0);
+      tag = swf_InsertTag(tag, ST_PLACEOBJECT2);
+      swf_ObjectPlaceClip(tag,shapeid,depth++,0,0,0,65535);
   }
 
   if(flag_protected)
@@ -1533,8 +1535,7 @@ void swfoutput_newpage(struct swfoutput*obj)
         swf_SetU16(tag,depth);
     }
 
-    depth = 1;
-    startdepth = depth;
+    depth = startdepth;
 }
 
 /* "destroy" like in (oo-terminology) "destructor". Perform cleaning