git.asbjorn.biz
/
swftools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fd9d112
)
startPage function now takes a crop box as parameter.
author
kramm
<kramm>
Mon, 5 Jul 2004 10:59:01 +0000
(10:59 +0000)
committer
kramm
<kramm>
Mon, 5 Jul 2004 10:59:01 +0000
(10:59 +0000)
pdf2swf/SWFOutputDev.cc
patch
|
blob
|
history
pdf2swf/xpdf/OutputDev.h
patch
|
blob
|
history
diff --git
a/pdf2swf/SWFOutputDev.cc
b/pdf2swf/SWFOutputDev.cc
index
2809efc
..
ea19016
100644
(file)
--- a/
pdf2swf/SWFOutputDev.cc
+++ b/
pdf2swf/SWFOutputDev.cc
@@
-144,7
+144,7
@@
public:
void startDoc(XRef *xref);
// Start a page.
void startDoc(XRef *xref);
// Start a page.
- virtual void startPage(int pageNum, GfxState *state) ;
+ virtual void startPage(int pageNum, GfxState *state, double x1, double y1, double x2, double y2) ;
//----- link borders
virtual void drawLink(Link *link, Catalog *catalog) ;
//----- link borders
virtual void drawLink(Link *link, Catalog *catalog) ;
@@
-700,18
+700,27
@@
void SWFOutputDev::endType3Char(GfxState *state)
msg("<debug> endType3Char");
}
msg("<debug> endType3Char");
}
-void SWFOutputDev::startPage(int pageNum, GfxState *state)
+void SWFOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, double crop_y1, double crop_x2, double crop_y2)
{
double x1,y1,x2,y2;
laststate = state;
msg("<debug> startPage %d\n", pageNum);
msg("<notice> processing page %d", pageNum);
{
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);
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) {
if(!outputstarted) {
- msg("<verbose> Bounding box is (%f,%f)-(%f,%f)", x1,y1,x2,y2);
- swfoutput_init(&output, swffilename, abs((int)(x2-x1)),abs((int)(y2-y1)));
+ 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);
outputstarted = 1;
}
else
outputstarted = 1;
}
else
diff --git
a/pdf2swf/xpdf/OutputDev.h
b/pdf2swf/xpdf/OutputDev.h
index
cb825e0
..
4a05f1a
100644
(file)
--- a/
pdf2swf/xpdf/OutputDev.h
+++ b/
pdf2swf/xpdf/OutputDev.h
@@
-59,7
+59,7
@@
public:
virtual void setDefaultCTM(double *ctm);
// Start a page.
virtual void setDefaultCTM(double *ctm);
// Start a page.
- virtual void startPage(int pageNum, GfxState *state) {}
+ virtual void startPage(int pageNum, GfxState *state, double x1,double y1,double x2,double y2) {}
// End a page.
virtual void endPage() {}
// End a page.
virtual void endPage() {}