added gradient warning.
[swftools.git] / pdf2swf / SWFOutputDev.cc
index 8b57319..08b3c7c 100644 (file)
@@ -157,6 +157,9 @@ public:
   // Does this device use drawChar() or drawString()?
   virtual GBool useDrawChar();
   
+  // Can this device draw gradients?
+  virtual GBool useGradients();
+  
   virtual GBool interpretType3Chars() {return gTrue;}
 
   //----- initialization and control
@@ -238,6 +241,7 @@ public:
   int pbminfo; // did we write "File contains jpegs" yet?
   int linkinfo; // did we write "File contains links" yet?
   int ttfinfo; // did we write "File contains TrueType Fonts" yet?
+  int gradientinfo; // did we write "File contains Gradients yet?
 
   int type3active; // are we between beginType3()/endType3()?
 
@@ -648,6 +652,15 @@ GBool SWFOutputDev::useDrawChar()
 {
     return gTrue;
 }
+GBool SWFOutputDev::useGradients()
+{
+    if(!gradientinfo)
+    {
+       msg("<notice> File contains gradients");
+       gradientinfo = 1;
+    }
+    return gTrue;
+}
 
 void SWFOutputDev::beginString(GfxState *state, GString *s) 
 { 
@@ -740,8 +753,6 @@ void SWFOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, doubl
   if(rot!=0)
     msg("<verbose> page is rotated %d degrees\n", rot);
 
-  msg("<notice> processing page %d", pageNum);
-
   /* state->transform(state->getX1(),state->getY1(),&x1,&y1);
   state->transform(state->getX2(),state->getY2(),&x2,&y2);
   Use CropBox, not MediaBox, as page size
@@ -759,11 +770,11 @@ void SWFOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, doubl
 
   if(!outputstarted) {
     msg("<verbose> Bounding box is (%f,%f)-(%f,%f)", x1,y1,x2,y2);
-    swfoutput_init(&output, swffilename,(int)x1,(int)y1,(int)x2,(int)y2);
+    swfoutput_init(&output, swffilename);
     outputstarted = 1;
   }
-  else
-    swfoutput_newpage(&output);
+    
+  swfoutput_newpage(&output, pageNum, (int)x1, (int)y1, (int)x2, (int)y2);
 }
 
 void SWFOutputDev::drawLink(Link *link, Catalog *catalog)