X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2FSWFOutputDev.cc;h=08b3c7cfbd2689174868be114eaac5c00b1e0963;hb=6118beaf86dcdf83277b0a9fc1a5f474043dd9da;hp=8b5731949f9cfb2d2e31f2b7359a9e706017d9f7;hpb=ffc27a3f45bc8f6334049a868bfd3457717f43f3;p=swftools.git diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index 8b57319..08b3c7c 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -157,6 +157,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;} //----- initialization and control @@ -238,6 +241,7 @@ public: int pbminfo; // did we write "File contains jpegs" yet? int linkinfo; // did we write "File contains links" yet? int ttfinfo; // did we write "File contains TrueType Fonts" yet? + int gradientinfo; // did we write "File contains Gradients yet? int type3active; // are we between beginType3()/endType3()? @@ -648,6 +652,15 @@ GBool SWFOutputDev::useDrawChar() { return gTrue; } +GBool SWFOutputDev::useGradients() +{ + if(!gradientinfo) + { + msg(" File contains gradients"); + gradientinfo = 1; + } + return gTrue; +} void SWFOutputDev::beginString(GfxState *state, GString *s) { @@ -740,8 +753,6 @@ void SWFOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, doubl if(rot!=0) msg(" page is rotated %d degrees\n", rot); - msg(" processing page %d", pageNum); - /* state->transform(state->getX1(),state->getY1(),&x1,&y1); state->transform(state->getX2(),state->getY2(),&x2,&y2); Use CropBox, not MediaBox, as page size @@ -759,11 +770,11 @@ void SWFOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, doubl if(!outputstarted) { msg(" Bounding box is (%f,%f)-(%f,%f)", x1,y1,x2,y2); - swfoutput_init(&output, swffilename,(int)x1,(int)y1,(int)x2,(int)y2); + swfoutput_init(&output, swffilename); outputstarted = 1; } - else - swfoutput_newpage(&output); + + swfoutput_newpage(&output, pageNum, (int)x1, (int)y1, (int)x2, (int)y2); } void SWFOutputDev::drawLink(Link *link, Catalog *catalog)