diff options
-rw-r--r-- | lib/devices/swf.c | 10 | ||||
-rw-r--r-- | lib/pdf/GFXOutputDev.cc | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/devices/swf.c b/lib/devices/swf.c index 2cafb0e1..c833e51f 100644 --- a/lib/devices/swf.c +++ b/lib/devices/swf.c @@ -116,6 +116,7 @@ typedef struct _swfoutput_internal int config_disable_polygon_conversion; int config_normalize_polygon_positions; int config_alignfonts; + double config_remove_small_polygons; char config_disablelinks; RGBA config_linkcolor; float config_minlinewidth; @@ -2108,6 +2109,8 @@ int swf_setparameter(gfxdevice_t*dev, const char*name, const char*value) } } else if(!strcmp(name, "minlinewidth")) { i->config_minlinewidth = atof(value); + } else if(!strcmp(name, "remove_small_polygons")) { + i->config_remove_small_polygons = atof(value); } else if(!strcmp(name, "caplinewidth")) { i->config_caplinewidth = atof(value); } else if(!strcmp(name, "linktarget")) { @@ -2692,9 +2695,16 @@ static void swf_fill(gfxdevice_t*dev, gfxline_t*line, gfxcolor_t*color) return; if(!color->a) return; + gfxbbox_t r = gfxline_getbbox(line); int is_outside_page = !is_inside_page(dev, r.xmin, r.ymin) || !is_inside_page(dev, r.xmax, r.ymax); + if(r.xmax - r.xmin < i->config_remove_small_polygons && + r.ymax - r.ymin < i->config_remove_small_polygons) { + msg("<verbose> Not drawing %.2fx%.2f polygon", r.xmax - r.xmin, r.ymax - r.ymin); + return; + } + endtext(dev); if(!i->config_ignoredraworder) diff --git a/lib/pdf/GFXOutputDev.cc b/lib/pdf/GFXOutputDev.cc index 35621dd6..25db1f80 100644 --- a/lib/pdf/GFXOutputDev.cc +++ b/lib/pdf/GFXOutputDev.cc @@ -657,6 +657,7 @@ GFXOutputDev::GFXOutputDev(InfoOutputDev*info, PDFDoc*doc) this->config_multiply = 1; this->config_detectspaces = 1; this->config_linkdatafile = 0; + this->config_textonly = 0; this->page2page = 0; this->num_pages = 0; |