#include <string.h>
#include <unistd.h>
//xpdf header files
+#include "gfile.h"
#include "GString.h"
#include "gmem.h"
#include "Object.h"
{
int num = path->getNumSubpaths();
int s,t;
- bezierpathsegment*start,*last;
+ bezierpathsegment*start,*last=0;
bezierpathsegment*outline = start = new bezierpathsegment();
int cpos = 0;
double lastx=0,lasty=0;
state->getFontTransMat(&m11, &m12, &m21, &m22);
m11 *= state->getHorizScaling();
m21 *= state->getHorizScaling();
- swfoutput_setfontmatrix(&output, m11, -m12, m21, -m22);
+ swfoutput_setfontmatrix(&output, m11, -m21, m12, -m22);
}
int charcounter = 0;
char*s = "-?-";
char*type = "-?-";
char*url = 0;
+ char*named = 0;
int page = -1;
switch(action->getKind())
{
GString*name = l->getName();
if(name) {
s = name->lowerCase()->getCString();
+ named = name->getCString();
if(strstr(s, "next") || strstr(s, "forward"))
{
page = currentpage + 1;
{
swfoutput_linktourl(&output, url, points);
}
+ else if(named)
+ {
+ swfoutput_namedlink(&output, named, points);
+ }
logf("<verbose> \"%s\" link to \"%s\" (%d)\n", type, s, page);
}
}
ttfinfo = 1;
}
char name2[80];
- int r1 = lrand48();
- int r2 = lrand48();
- sprintf(name2,"%04x%04x",r1,r2);
+ char*tmp;
+ tmp = strdup(mktmpname((char*)name2));
+ sprintf(name2, "%s", tmp);
char*a[] = {"./ttf2pt1","-pttf","-b", tmpFileName, name2};
logf("<verbose> Invoking ttf2pt1...");
ttf2pt1_main(5,a);
unlink(tmpFileName);
- sprintf(name2,"%04x%04x.pfb",r1,r2);
+ sprintf(name2,"%s.pfb",tmp);
tmpFileName = strdup(name2);
}
logf("<fatal> Too many fonts in file.");
exit(1);
}
- substitutesource[substitutepos] = oldname;
- substitutetarget[substitutepos] = fontname;
- logf("<verbose> substituting %s -> %s", oldname, fontname);
- substitutepos ++;
+ if(oldname) {
+ substitutesource[substitutepos] = oldname;
+ substitutetarget[substitutepos] = fontname;
+ logf("<verbose> substituting %s -> %s", oldname, fontname);
+ substitutepos ++;
+ }
return fontname;
}
if(t1id<0) {
showFontError(gfxFont,0);
+ return;
}
/* we may have done some substitutions here, so check
if (str->getKind() == strDCT &&
(colorMap->getNumPixelComps() == 3 || !mask) )
{
- sprintf(fileName, "/tmp/tmp%08x.jpg",lrand48());
+ sprintf(fileName, "%s.jpg",mktmpname(0));
logf("<verbose> Found jpeg. Temporary storage is %s", fileName);
if(!jpeginfo)
{
if(mask) {
imgStr = new ImageStream(str, width, 1, 1);
imgStr->reset();
- return;
+ //return;
int yes=0,i,j;
unsigned char buf[8];
int xid = 0;
for(t=0;t<pagepos;t++)
{
currentpage = pages[t];
- doc->displayPage((OutputDev*)output, currentpage, /*zoom*/100, /*rotate*/0, /*doLinks*/(int)1);
+ doc->displayPage((OutputDev*)output, currentpage, /*dpi*/72, /*rotate*/0, /*doLinks*/(int)1);
}
}