#include <stddef.h>
#include <string.h>
#include <unistd.h>
+#include "../config.h"
//xpdf header files
+#include "config.h"
#include "gfile.h"
#include "GString.h"
#include "gmem.h"
#include "Page.h"
#include "PDFDoc.h"
#include "Error.h"
-#include "config.h"
#include "OutputDev.h"
#include "GfxState.h"
#include "GfxFont.h"
bezierpathsegment*outline = start = new bezierpathsegment();
int cpos = 0;
double lastx=0,lasty=0;
+ if(!num) {
+ logf("<warning> empty path");
+ outline->type = T1_PATHTYPE_MOVE;
+ outline->dest.x = 0;
+ outline->dest.y = 0;
+ outline->link = 0;
+ return (T1_OUTLINE*)outline;
+ }
for(t = 0; t < num; t++) {
GfxSubpath *subpath = path->getSubpath(t);
int subnum = subpath->getNumPoints();
LinkNamed*l = (LinkNamed*)action;
GString*name = l->getName();
if(name) {
- s = name->lowerCase()->getCString();
- named = name->getCString();
- if(strstr(s, "next") || strstr(s, "forward"))
- {
- page = currentpage + 1;
- }
- else if(strstr(s, "prev") || strstr(s, "back"))
- {
- page = currentpage - 1;
- }
- else if(strstr(s, "last") || strstr(s, "end"))
- {
- page = pages[pagepos-1]; //:)
- }
- else if(strstr(s, "first") || strstr(s, "top"))
- {
- page = 1;
- }
+ s = name->lowerCase()->getCString();
+ named = name->getCString();
+ if(!strchr(s,':'))
+ {
+ if(strstr(s, "next") || strstr(s, "forward"))
+ {
+ page = currentpage + 1;
+ }
+ else if(strstr(s, "prev") || strstr(s, "back"))
+ {
+ page = currentpage - 1;
+ }
+ else if(strstr(s, "last") || strstr(s, "end"))
+ {
+ page = pages[pagepos-1]; //:)
+ }
+ else if(strstr(s, "first") || strstr(s, "top"))
+ {
+ page = 1;
+ }
+ }
}
}
break;
}
if(fontname && !strcmp(name, fontname)) {
- logf("<notice> Extra font %s is being used.\n", fontname);
+ logf("<notice> Extra font %d, \"%s\" is being used.\n", i, fontname);
return i;
}
fontname = T1_GetFontFileName(i);
fontname = strrchr(fontname,'/')+1;
if(strstr(fontname, name)) {
- logf("<notice> Extra font %s is being used.\n", fontname);
+ logf("<notice> Extra font %d, \"%s\" is being used.\n", i, fontname);
return i;
}
}
refObj.fetch(ref, &strObj);
refObj.free();
strObj.streamReset();
- while ((c = strObj.streamGetChar()) != EOF) {
- fputc(c, f);
+ int f4[4];
+ char f4c[4];
+ int t;
+ for(t=0;t<4;t++) {
+ f4[t] = strObj.streamGetChar();
+ f4c[t] = (char)f4[t];
+ if(f4[t] == EOF)
+ break;
+ }
+ if(t==4) {
+ if(!strncmp(f4c, "true", 4)) {
+ /* some weird TTF fonts don't start with 0,1,0,0 but with "true".
+ Change this on the fly */
+ f4[0] = f4[2] = f4[3] = 0;
+ f4[1] = 1;
+ }
+ fputc(f4[0], f);
+ fputc(f4[1], f);
+ fputc(f4[2], f);
+ fputc(f4[3], f);
+
+ while ((c = strObj.streamGetChar()) != EOF) {
+ fputc(c, f);
+ }
}
strObj.streamClose();
strObj.free();
/* ------------------------------ V1 */
char*fontname = "Times-Roman";
+ logf("<verbose> substituteFont(,%s)", FIXNULL(oldname));
this->t1id = searchT1Font(fontname);
if(substitutepos>=sizeof(substitutesource)/sizeof(char*)) {
logf("<fatal> Too many fonts in file.");
if(fontname) {
int newt1id = searchT1Font(fontname);
if(newt1id<0) {
+ showFontError(gfxFont,1);
fontname = substituteFont(gfxFont, fontname);
} else
this->t1id = newt1id;
}
- else
+ else {
+ showFontError(gfxFont,1);
fontname = substituteFont(gfxFont, fontname);
+ }
}
if(t1id<0) {
insertstoptag = 1;
}
+void pdfswf_setversion(int n)
+{
+ flashversion = n;
+}
+
int closed=0;
void pdfswf_close()
{