X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fpdf2swf.c;h=c50a3de3c8e0ece3997f150dcef00e02f8f440b9;hb=a61b92b4ac72cd15ee0f3165f2e7a2f5ac00f156;hp=4255fbf66889c2e0f2e715c06e8e8aaf917b5d79;hpb=5cbd3ad7e5136789a7a84549a47b319434278115;p=swftools.git diff --git a/src/pdf2swf.c b/src/pdf2swf.c index 4255fbf..c50a3de 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, '%') || @@ -746,6 +748,8 @@ int main(int argn, char *argv[]) pagenum = 0; gfxdevice_t*out = create_output_device();; + pdf->prepare(pdf, out); + for(pagenr = 1; pagenr <= pdf->num_pages; pagenr++) { if(is_in_range(pagenr, pagerange)) {