#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;
char*x2 = strtok(0, ":");
char*y2 = strtok(0, ":");
if(!(x1 && y1 && x2 && y2)) {
- fprintf(stderr, "-m option requires four arguments, <x1>:<y1>:<x2>:<y2>\n");
+ fprintf(stderr, "-c option requires four arguments, <x1>:<y1>:<x2>:<y2>\n");
exit(1);
}
custom_clip = 1;
*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"))
}
else if (!strcmp(name, "G"))
{
- driver->set_parameter(driver, "optimize_polygons", "1");
+ //driver->set_parameter(driver, "optimize_polygons", "1");
flatten = 1;
return 0;
}
#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");
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;