- if len(args) > 1:
- pdf.transform(provider, slug, output_file=args[1], verbose=options.verbose, save_tex=options.save_tex)
- else:
- pdf.transform(provider, slug, output_dir=path, make_dir=options.make_dir, verbose=options.verbose, save_tex=options.save_tex)
+ if options.output_dir and options.output_file:
+ raise ValueError("Either --output-dir or --output file should be specified")
+
+ for main_input in args:
+ if options.verbose:
+ print main_input
+ path, fname = os.path.realpath(main_input).rsplit('/', 1)
+ provider = DirDocProvider(path)
+
+ output_file = output_dir = None
+ if options.output_dir:
+ output_dir = options.output_dir
+ elif options.output_file:
+ output_file = options.output_file
+ else:
+ output_dir = path
+
+ pdf.transform(provider,
+ file_path=main_input,
+ output_file=output_file,
+ output_dir=output_dir,
+ verbose=options.verbose,
+ make_dir=options.make_dir,
+ save_tex=options.save_tex,
+ morefloats=options.morefloats
+ )