git.asbjorn.biz
/
swftools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gcc 2.95.x fixes
[swftools.git]
/
pdf2swf
/
SWFOutputDev.cc
diff --git
a/pdf2swf/SWFOutputDev.cc
b/pdf2swf/SWFOutputDev.cc
index
b0bc202
..
deef3f4
100644
(file)
--- a/
pdf2swf/SWFOutputDev.cc
+++ b/
pdf2swf/SWFOutputDev.cc
@@
-48,8
+48,8
@@
#include "Error.h"
#include "Link.h"
#include "OutputDev.h"
#include "Error.h"
#include "Link.h"
#include "OutputDev.h"
-#include "GfxState.h"
#include "GfxFont.h"
#include "GfxFont.h"
+#include "GfxState.h"
#include "CharCodeToUnicode.h"
#include "NameToUnicodeTable.h"
#include "GlobalParams.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();
// 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 interpretType3Chars() {return gTrue;}
+
+ //virtual GBool useShadedFills() { return gTrue; }
//----- initialization and control
//----- initialization and control
@@
-385,7
+384,6
@@
class InfoOutputDev: public OutputDev
}
virtual GBool upsideDown() {return gTrue;}
virtual GBool useDrawChar() {return gTrue;}
}
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)
{
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;
}
{
return gTrue;
}
-GBool SWFOutputDev::useGradients()
-{
- if(!gradientinfo)
- {
- msg("<notice> File contains gradients");
- gradientinfo = 1;
- }
- return gTrue;
-}
char*renderModeDesc[]= {"fill", "stroke", "fill+stroke", "invisible",
"clip+fill", "stroke+clip", "fill+stroke+clip", "clip"};
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;
points[4].x = x + user_movex;
points[4].y = y + user_movey;
points[4].next = 0;
+
+ msg("<trace> 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 = "-?-";
LinkAction*action=link->getAction();
char buf[128];
char*s = 0;
char*type = "-?-";
- char*url = 0;
char*named = 0;
int page = -1;
char*named = 0;
int page = -1;
+ msg("<trace> drawlink action=%d\n", action->getKind());
switch(action->getKind())
{
case actionGoTo: {
switch(action->getKind())
{
case actionGoTo: {
@@
-1552,6
+1547,7
@@
void SWFOutputDev::drawLink(Link *link, Catalog *catalog)
}
break;
case actionURI: {
}
break;
case actionURI: {
+ char*url = 0;
type = "URI";
LinkURI*l = (LinkURI*)action;
GString*g = l->getURI();
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("-?-");
}
if(!s) s = strdup("-?-");
+
+ msg("<trace> drawlink s=%s\n", s);
- if(!linkinfo && (page || url))
+ if(!linkinfo && (page || s))
{
msg("<notice> File contains links");
linkinfo = 1;
{
msg("<notice> 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);
}
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("<verbose> \"%s\" link to \"%s\" (%d)\n", type, FIXNULL(s), page);
}
msg("<verbose> \"%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();
}
ncomps = colorMap->getNumPixelComps();
bits = colorMap->getBits();
}
-
+
if(maskStr) {
int x,y;
unsigned char buf[8];
if(maskStr) {
int x,y;
unsigned char buf[8];
@@
-2310,8
+2308,9
@@
void SWFOutputDev::drawGeneralImage(GfxState *state, Object *ref, Stream *str,
}
delete imgMaskStr;
}
}
delete imgMaskStr;
}
+ maskStr->close();
}
}
-
+
imgStr = new ImageStream(str, width, ncomps,bits);
imgStr->reset();
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;
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("<notice> file contains pbm pictures %s",mask?"(masked)":"");
if(!pbminfo && !(str->getKind()==strDCT)) {
if(!type3active) {
msg("<notice> file contains pbm pictures %s",mask?"(masked)":"");