X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpdf%2FGFXOutputDev.cc;h=b0d11692ae2c9d5ae21bed36db482344c8aab7a1;hb=d46619a310dd04066cc117e904b84785d1a0cd51;hp=eda022087d6bab398bab63367e8ee43aef03ce1f;hpb=289ddc3e15e4bac347fb1a18732a6d3ec5657ffd;p=swftools.git diff --git a/lib/pdf/GFXOutputDev.cc b/lib/pdf/GFXOutputDev.cc index eda0220..b0d1169 100644 --- a/lib/pdf/GFXOutputDev.cc +++ b/lib/pdf/GFXOutputDev.cc @@ -132,7 +132,7 @@ static void dbg(const char*format, ...) if(!verbose) return; va_start(arglist, format); - vsprintf(buf, format, arglist); + vsnprintf(buf, sizeof(buf)-1, format, arglist); va_end(arglist); l = strlen(buf); while(l && buf[l-1]=='\n') { @@ -791,6 +791,31 @@ void dump_outline(gfxline_t*line) } } +void gfxPath_dump(GfxPath*path) +{ + int num = path->getNumSubpaths(); + int t; + int cpos=0; + for(t = 0; t < num; t++) { + GfxSubpath *subpath = path->getSubpath(t); + int subnum = subpath->getNumPoints(); + int s; + for(s=0;sgetX(s); + double y=subpath->getY(s); + if(s==0 && !subpath->getCurve(s)) { + printf("M %f %f\n", x, y); + } else if(s==0 && subpath->getCurve(s)) { + printf("E %f %f\n", x, y); + } else if(subpath->getCurve(s)) { + printf("C %f %f\n", x, y); + } else { + printf("T %f %f\n", x, y); + } + } + } +} + gfxline_t* GFXOutputDev::gfxPath_to_gfxline(GfxState*state, GfxPath*path, int closed, int user_movex, int user_movey) { int num = path->getNumSubpaths(); @@ -2598,9 +2623,9 @@ void GFXOutputDev::endTransparencyGroup(GfxState *state) this->device = states[statepos].olddevice; if(!this->device) { - msg(" bad state nesting in transparency group- PDF file broken?"); - /* if these errors occur more often, we should build a seperate - transparency group stack, like xpdf/SplashOutputDev.cc does */ + msg(" Bad state nesting in transparency group"); + msg(" Notice: this is a known problem, which will be fixed in 0.9.1"); + msg(" In the meantime, please convert the file with -s poly2bitmap"); restoreState(state); this->device = states[statepos].olddevice; }