fixed small typo in error message
[swftools.git] / src / pdf2swf.c
index 8d9d4eb..975aa6c 100644 (file)
@@ -32,7 +32,7 @@
 #include "../lib/os.h"
 #include "../lib/rfxswf.h"
 #include "../lib/devices/swf.h"
-#include "../lib/devices/arts.h"
+#include "../lib/devices/polyops.h"
 #include "../lib/devices/record.h"
 #include "../lib/pdf/pdf.h"
 #include "../lib/log.h"
@@ -154,7 +154,7 @@ int args_callback_option(char*name,char*val) {
        char*x2 = strtok(0, ":");
        char*y2 = strtok(0, ":");
        if(!(x1 && y1 && x2 && y2)) {
-           fprintf(stderr, "-m option requires four arguments, <x1>:<y1>:<x2>:<y2>\n");
+           fprintf(stderr, "-c option requires four arguments, <x1>:<y1>:<x2>:<y2>\n");
            exit(1);
        }
        custom_clip = 1;
@@ -203,6 +203,14 @@ int args_callback_option(char*name,char*val) {
        driver->set_parameter(driver, "ignoredraworder", "1");
        return 0;
     }
+#ifndef WIN32
+    else if (!strcmp(name, "Q"))
+    {
+       int seconds = atoi(val);
+       alarm(seconds);
+       return 1;
+    }
+#endif
     else if (!strcmp(name, "z"))
     {
        driver->set_parameter(driver, "enablezlib", "1");
@@ -244,8 +252,25 @@ int args_callback_option(char*name,char*val) {
        driver->set_parameter(driver, "linksopennewwindow", "0");
        return 0;
     }
+    else if (!strcmp(name, "O"))
+    {
+       int level = 1;
+       int ret=0;
+       if(val&& val[0] && val[1]==0 && isdigit(val[0])) {
+           level = atoi(val);
+           ret=1;
+       }
+       if(level>=1)
+           driver->set_parameter(driver, "poly2bitmap", "1");
+       if(level>=2)
+           driver->set_parameter(driver, "bitmapfonts", "1");
+       if(level>=3)
+           driver->set_parameter(driver, "ignoredraworder", "1");
+       return ret;
+    }
     else if (!strcmp(name, "G"))
     {
+       driver->set_parameter(driver, "optimize_polygons", "1");
        flatten = 1;
        return 0;
     }
@@ -353,6 +378,7 @@ struct options_t options[] =
  {"z","zlib"},
  {"s","set"},
  {"S","shapes"},
+ {"Q","maxtime"},
  {"j","jpegquality"},
  {"p","pages"},
  {"w","samewindow"},
@@ -671,6 +697,7 @@ int main(int argn, char *argv[])
     result->destroy(result);
 
     pdf->destroy(pdf);
+    driver->destroy(driver);
 
     const char*zip = "";
     if(zlib) {
@@ -703,6 +730,7 @@ int main(int argn, char *argv[])
         systemf("rm %s", tmpname);
     }
 
+
     return 0;
 }