static gfxsource_t*driver = 0;
+static int maxwidth = 0;
+static int maxheight = 0;
static char * outputname = 0;
static int loglevel = 3;
static char * pagerange = 0;
free(s);
return 1;
}
+ else if (!strcmp(name, "X"))
+ {
+ maxwidth = atoi(val);
+ return 1;
+ }
+ else if (!strcmp(name, "Y"))
+ {
+ maxheight = atoi(val);
+ return 1;
+ }
else if (!strcmp(name, "V"))
{
printf("pdf2swf - part of %s %s\n", PACKAGE, VERSION);
}
gfxdocument_t* doc = driver->open(driver, filename);
- doc->set_parameter(doc, "drawonlyshapes", "1");
+ //doc->set_parameter(doc, "drawonlyshapes", "1");
doc->set_parameter(doc, "disable_polygon_conversion", "1");
if(!doc) {
gfxdevice_removeclippings_init(&wrap, out);
out = &wrap;*/
+ gfxdevice_t rescale;
+ if(maxwidth || maxheight) {
+ gfxdevice_rescale_init(&rescale, out, maxwidth, maxheight, 0);
+ out = &rescale;
+ out->setparameter(out, "keepratio", "1");
+ }
+
int pagenr;
for(pagenr = 1; pagenr <= doc->num_pages; pagenr++)
{