void startDoc(XRef *xref);
// Start a page.
- virtual void startPage(int pageNum, GfxState *state, double x1, double y1, double x2, double y2) ;
+ virtual void startPage(int pageNum, GfxState *state) ;
//----- link borders
virtual void drawLink(Link *link, Catalog *catalog) ;
msg("<debug> endType3Char");
}
-void SWFOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, double crop_y1, double crop_x2, double crop_y2)
+void SWFOutputDev::startPage(int pageNum, GfxState *state)
{
double x1,y1,x2,y2;
laststate = state;
msg("<debug> startPage %d\n", pageNum);
msg("<notice> processing page %d", pageNum);
- /*state->transform(state->getX1(),state->getY1(),&x1,&y1);
+ state->transform(state->getX1(),state->getY1(),&x1,&y1);
state->transform(state->getX2(),state->getY2(),&x2,&y2);
- */
- x1 = crop_x1;
- y1 = crop_y1;
- x2 = crop_x2;
- y2 = crop_y2;
-
if(x2<x1) {double x3=x1;x1=x2;x2=x3;}
if(y2<y1) {double y3=y1;y1=y2;y2=y3;}
if(!outputstarted) {
- msg("<verbose> Bounding box is (%f,%f)-(%f,%f)", crop_x1,crop_y1,crop_x2,crop_y2);
- swfoutput_init(&output, swffilename,(int)crop_x1,(int)crop_y1,(int)crop_y2,(int)crop_y2);
+ msg("<verbose> Bounding box is (%f,%f)-(%f,%f)", x1,y1,x2,y2);
+ swfoutput_init(&output, swffilename,(int)x1,(int)y1,(int)y2,(int)y2);
outputstarted = 1;
}
else
}
/* initialize the swf writer */
-void swfoutput_init(struct swfoutput* obj, char*_filename, int _sizex, int _sizey)
+void swfoutput_init(struct swfoutput* obj, char*_filename, int x1, int y1, int x2, int y2)
{
GLYPH *glyph;
RGBA rgb;
SRECT r;
memset(obj, 0, sizeof(struct swfoutput));
filename = _filename;
- sizex = _sizex;
- sizey = _sizey;
+ sizex = x2;
+ sizey = y2;
msg("<verbose> initializing swf output for size %d*%d\n", sizex,sizey);
swf.fileVersion = flashversion;
swf.frameRate = 0x0040; // 1 frame per 4 seconds
- swf.movieSize.xmax = 20*sizex;
- swf.movieSize.ymax = 20*sizey;
+ swf.movieSize.xmin = 20*x1;
+ swf.movieSize.ymin = 20*y1;
+ swf.movieSize.xmax = 20*x2;
+ swf.movieSize.ymax = 20*y2;
swf.firstTag = swf_InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
tag = swf.firstTag;
rgb.g = 0xff;
rgb.b = 0xff;
swf_SetRGB(tag,&rgb);
- if(flag_protected) // good practice! /r
+
+ if(flag_protected)
tag = swf_InsertTag(tag, ST_PROTECT);
+
depth = 1;
startdepth = depth;
}
#define DRAWMODE_CLIP 4
#define DRAWMODE_EOCLIP 5
-void swfoutput_init(struct swfoutput*, char*filename, int sizex, int sizey);
+void swfoutput_init(struct swfoutput*, char*filename, int x1, int y1, int x2, int y2);
void swfoutput_setprotected(); //write PROTECT tag
void swfoutput_newpage(struct swfoutput*);