X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2FSWFOutputDev.cc;h=deef3f4306bc612b5a043865b243b7b0d2ed9d6f;hb=6feb1917fd84e9ed59c5cd0518287229ec1db20b;hp=b0bc20287cdfef819c8656bd5790e0ae56efbae7;hpb=6544ad13113643977bc2ea9c52919547b4f19060;p=swftools.git diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index b0bc202..deef3f4 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -48,8 +48,8 @@ #include "Error.h" #include "Link.h" #include "OutputDev.h" -#include "GfxState.h" #include "GfxFont.h" +#include "GfxState.h" #include "CharCodeToUnicode.h" #include "NameToUnicodeTable.h" #include "GlobalParams.h" @@ -169,10 +169,9 @@ public: // Does this device use drawChar() or drawString()? virtual GBool useDrawChar(); - // Can this device draw gradients? - virtual GBool useGradients(); - virtual GBool interpretType3Chars() {return gTrue;} + + //virtual GBool useShadedFills() { return gTrue; } //----- initialization and control @@ -385,7 +384,6 @@ class InfoOutputDev: public OutputDev } virtual GBool upsideDown() {return gTrue;} virtual GBool useDrawChar() {return gTrue;} - virtual GBool useGradients() {return gTrue;} virtual GBool interpretType3Chars() {return gTrue;} virtual void startPage(int pageNum, GfxState *state, double crop_x1, double crop_y1, double crop_x2, double crop_y2) { @@ -1056,15 +1054,6 @@ GBool SWFOutputDev::useDrawChar() { return gTrue; } -GBool SWFOutputDev::useGradients() -{ - if(!gradientinfo) - { - msg(" File contains gradients"); - gradientinfo = 1; - } - return gTrue; -} char*renderModeDesc[]= {"fill", "stroke", "fill+stroke", "invisible", "clip+fill", "stroke+clip", "fill+stroke+clip", "clip"}; @@ -1474,14 +1463,20 @@ void SWFOutputDev::drawLink(Link *link, Catalog *catalog) points[4].x = x + user_movex; points[4].y = y + user_movey; points[4].next = 0; + + msg(" drawlink %.2f/%.2f %.2f/%.2f %.2f/%.2f %.2f/%.2f\n", + points[0].x, points[0].y, + points[1].x, points[1].y, + points[2].x, points[2].y, + points[3].x, points[3].y); LinkAction*action=link->getAction(); char buf[128]; char*s = 0; char*type = "-?-"; - char*url = 0; char*named = 0; int page = -1; + msg(" drawlink action=%d\n", action->getKind()); switch(action->getKind()) { case actionGoTo: { @@ -1552,6 +1547,7 @@ void SWFOutputDev::drawLink(Link *link, Catalog *catalog) } break; case actionURI: { + char*url = 0; type = "URI"; LinkURI*l = (LinkURI*)action; GString*g = l->getURI(); @@ -1574,8 +1570,10 @@ void SWFOutputDev::drawLink(Link *link, Catalog *catalog) } if(!s) s = strdup("-?-"); + + msg(" drawlink s=%s\n", s); - if(!linkinfo && (page || url)) + if(!linkinfo && (page || s)) { msg(" File contains links"); linkinfo = 1; @@ -1598,9 +1596,9 @@ void SWFOutputDev::drawLink(Link *link, Catalog *catalog) sprintf(buf, "page%d", lpage); output->drawlink(output, points, buf); } - else if(url) + else if(s) { - output->drawlink(output, points, url); + output->drawlink(output, points, s); } msg(" \"%s\" link to \"%s\" (%d)\n", type, FIXNULL(s), page); @@ -2274,7 +2272,7 @@ void SWFOutputDev::drawGeneralImage(GfxState *state, Object *ref, Stream *str, ncomps = colorMap->getNumPixelComps(); bits = colorMap->getBits(); } - + if(maskStr) { int x,y; unsigned char buf[8]; @@ -2310,8 +2308,9 @@ void SWFOutputDev::drawGeneralImage(GfxState *state, Object *ref, Stream *str, } delete imgMaskStr; } + maskStr->close(); } - + imgStr = new ImageStream(str, width, ncomps,bits); imgStr->reset(); @@ -2335,6 +2334,7 @@ void SWFOutputDev::drawGeneralImage(GfxState *state, Object *ref, Stream *str, state->transform(1, 0, &x3, &y3); x3 += user_movex; y3 += user_movey; state->transform(1, 1, &x4, &y4); x4 += user_movex; y4 += user_movey; + if(!pbminfo && !(str->getKind()==strDCT)) { if(!type3active) { msg(" file contains pbm pictures %s",mask?"(masked)":"");