X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpdf%2Fpdf.cc;h=1a6969d5d937a96c24384a6458caab9ed3de69c3;hb=0983af6ba15f2969fa6e0ec068ffe34635ea0c88;hp=a0d9c6a36158a3da3640da17e3b7ab9123cd923c;hpb=bcdeea968b4e4ec2cfdfaa21a7f6151a875fd5ce;p=swftools.git diff --git a/lib/pdf/pdf.cc b/lib/pdf/pdf.cc index a0d9c6a..1a6969d 100644 --- a/lib/pdf/pdf.cc +++ b/lib/pdf/pdf.cc @@ -1,3 +1,5 @@ +#include +#include #include "../gfxdevice.h" #include "../gfxsource.h" #include "../devices/rescale.h" @@ -388,17 +390,28 @@ char* pdf_doc_getinfo(gfxdocument_t*doc, const char*name) sprintf(buf, "%.1f", i->doc->getPDFVersion()); return strdup(buf); } - return 0; + return strdup(""); } +/* shortcut to InfoOutputDev.cc */ +extern int config_addspace; +extern int config_fontquality; +extern int config_bigchar; + static void pdf_set_parameter(gfxsource_t*src, const char*name, const char*value) { gfxsource_internal_t*i = (gfxsource_internal_t*)src->internal; - parameterlist_t*p = &i->parameters; + msg(" setting parameter %s to \"%s\"", name, value); if(!strncmp(name, "fontdir", strlen("fontdir"))) { addGlobalFontDir(value); + } else if(!strcmp(name, "detectspaces")) { + config_addspace = atoi(value); + } else if(!strcmp(name, "fontquality")) { + config_fontquality = atoi(value); + } else if(!strcmp(name, "bigchar")) { + config_bigchar = atoi(value); } else if(!strcmp(name, "pages")) { global_page_range = strdup(value); } else if(!strncmp(name, "font", strlen("font")) && name[4]!='q') { @@ -447,7 +460,7 @@ static gfxdocument_t*pdf_open(gfxsource_t*src, const char*filename) i->filename = strdup(filename); char*x = 0; - if((x = strchr(filename, '|'))) { + if((x = strchr((char*)filename, '|'))) { *x = 0; userPassword = x+1; }