X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fpdf2swf.c;h=39680cf1335121bfa8dbd727c290b209499d2ce3;hb=1b80868e9a500a7f9b1bb3e2c857132addce456c;hp=cbf54547ba12b0fcb8c45280efcb5cd678f6b08b;hpb=1bfd6af7086bc546cb01bc8f01ef3ff4f0c0cf61;p=swftools.git diff --git a/src/pdf2swf.c b/src/pdf2swf.c index cbf5454..39680cf 100644 --- a/src/pdf2swf.c +++ b/src/pdf2swf.c @@ -39,7 +39,8 @@ #define SWFDIR concatPaths(getInstallationPath(), "swfs") -gfxsource_t*driver; +static gfxsource_t*driver = 0; +static gfxdevice_t*out = 0; static char * outputname = 0; static int loglevel = 3; @@ -154,7 +155,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, :::\n"); + fprintf(stderr, "-c option requires four arguments, :::\n"); exit(1); } custom_clip = 1; @@ -188,9 +189,11 @@ int args_callback_option(char*name,char*val) { *c = 0; c++; driver->set_parameter(driver, s,c); - } - else + out->setparameter(out, s,c); + } else { driver->set_parameter(driver, s,"1"); + out->setparameter(out, s,"1"); + } return 1; } else if (!strcmp(name, "S")) @@ -528,8 +531,18 @@ int main(int argn, char *argv[]) #endif driver = gfxsource_pdf_create(); + gfxdevice_t swf,wrap; + gfxdevice_swf_init(&swf); + + gfxdevice_removeclippings_init(&wrap, &swf); + + out = &wrap; processargs(argn, argv); + if(!flatten) { + out = &swf; + } + if(!filename) { fprintf(stderr, "Please specify an input file\n"); @@ -583,17 +596,6 @@ int main(int argn, char *argv[]) exit(1); } - gfxdevice_t swf,wrap; - gfxdevice_swf_init(&swf); - gfxdevice_t*out; - - if(flatten) { - gfxdevice_removeclippings_init(&wrap, &swf); - out = &wrap; - } else { - out = &swf; - } - struct mypage_t { int x; int y;