X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fpdf2swf.c;h=4344187496a824e13127355ecefb0eb856e25cbd;hb=711659af8759d3939ef395e04f81191a43049a19;hp=5b258d1aca17c2f6f742bcbf8e8cedfb9bba0130;hpb=fe0bf96d27b7af11538533b4df9eca5cbc96eedf;p=swftools.git diff --git a/src/pdf2swf.c b/src/pdf2swf.c index 5b258d1..4344187 100644 --- a/src/pdf2swf.c +++ b/src/pdf2swf.c @@ -640,18 +640,20 @@ int main(int argn, char *argv[]) exit(1); } - if(!outputname) - { - if(filename) { - outputname = stripFilename(filename, ".swf"); - msg(" Output filename not given. Writing to %s", outputname); - } - } - - if(!outputname) - { - fprintf(stderr, "Please use -o to specify an output file\n"); - exit(1); + if (!info_only) { + if(!outputname) + { + if(filename) { + outputname = stripFilename(filename, ".swf"); + msg(" Output filename not given. Writing to %s", outputname); + } + } + + if(!outputname) + { + fprintf(stderr, "Please use -o to specify an output file\n"); + exit(1); + } } // test if the page range is o.k. @@ -671,16 +673,16 @@ int main(int argn, char *argv[]) if(pagerange) driver->set_parameter(driver, "pages", pagerange); - if(info_only) { - show_info(driver, filename); - return 0; - } - /* add fonts */ for(t=0;tset_parameter(driver, "fontdir", fontpaths[t]); } + if(info_only) { + show_info(driver, filename); + return 0; + } + char*u = 0; if((u = strchr(outputname, '%'))) { if(strchr(u+1, '%') || @@ -738,6 +740,10 @@ int main(int argn, char *argv[]) frame++; } } + if(pagerange && !pagenum && frame==1) { + fprintf(stderr, "No pages in range %s", pagerange); + exit(1); + } pagenum = 0;