X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fpdf2swf.c;h=6cd49234e3437c9dbc6d497c32e38cb118c45ba0;hb=3de83640b8a9cfd821efc91a73952278fa69f8fc;hp=6a615718e2051bee7fb8823794f43adddf2c543e;hpb=02324a6b804c8ba7bff6ca581a70b52d84b166e6;p=swftools.git diff --git a/src/pdf2swf.c b/src/pdf2swf.c index 6a61571..6cd4923 100644 --- a/src/pdf2swf.c +++ b/src/pdf2swf.c @@ -36,6 +36,7 @@ #include "../lib/rfxswf.h" #include "../lib/devices/swf.h" #include "../lib/devices/arts.h" +#include "../lib/devices/record.h" #include "../lib/pdf/pdf.h" #include "../lib/log.h" @@ -489,8 +490,6 @@ int main(int argn, char *argv[]) initLog(0,-1,0,0,-1,loglevel); - driver = gfxsource_pdf_create(); - #if defined(WIN32) && defined(HAVE_STAT) && defined(HAVE_SYS_STAT_H) if(installPath) { fontdir = concatPaths(installPath, "fonts"); @@ -513,8 +512,10 @@ int main(int argn, char *argv[]) srand(time(0)); #endif #endif - processargs(argn, argv); + driver = gfxsource_pdf_create(); + processargs(argn, argv); + if(!filename) { fprintf(stderr, "Please specify an input file\n"); @@ -543,6 +544,9 @@ int main(int argn, char *argv[]) // test if the page range is o.k. is_in_range(0x7fffffff, pagerange); + if(pagerange) + driver->set_parameter("pages", pagerange); + if (!filename) { args_callback_usage(argv[0]); exit(0); @@ -573,7 +577,7 @@ int main(int argn, char *argv[]) gfxdevice_t*out; if(flatten) { - gfxdevice_arts_init(&wrap, &swf); + gfxdevice_removeclippings_init(&wrap, &swf); out = &wrap; } else { out = &swf; @@ -670,6 +674,7 @@ int main(int argn, char *argv[]) } gfxresult_t*result = out->finish(out); + if(result->save(result, outputname) < 0) { exit(1); }