X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=lib%2Fpdf%2Fpdf.cc;h=68fa71103ba0fc5f47deda37f33a3f5f261a7ce0;hp=e6bfe14c773a00f96336be774d89d891d58aa0d6;hb=f29d8006b1d8253c50808d6eb4941bdeb808c601;hpb=6c8f037f0f76ce4b28b80a2133e4150d93012ef7 diff --git a/lib/pdf/pdf.cc b/lib/pdf/pdf.cc index e6bfe14..68fa711 100644 --- a/lib/pdf/pdf.cc +++ b/lib/pdf/pdf.cc @@ -368,6 +368,9 @@ static void pdf_setparameter(gfxsource_t*src, const char*name, const char*value) msg(" setting parameter %s to \"%s\"", name, value); if(!strncmp(name, "fontdir", strlen("fontdir"))) { addGlobalFontDir(value); + } else if(!strcmp(name, "addspacechars")) { + config_addspace = atoi(value); + gfxparams_store(i->parameters, "detectspaces", 0); } else if(!strcmp(name, "detectspaces")) { config_addspace = atoi(value); } else if(!strcmp(name, "fontquality")) { @@ -442,7 +445,6 @@ static gfxdocument_t*pdf_open(gfxsource_t*src, const char*filename) delete userPW; } if (!i->doc->isOk()) { - printf("xpdf reports document as broken.\n"); return 0; } @@ -497,9 +499,15 @@ static gfxdocument_t*pdf_open(gfxsource_t*src, const char*filename) pdf_doc->getinfo = pdf_doc_getinfo; pdf_doc->getpage = pdf_doc_getpage; pdf_doc->prepare = pdf_doc_prepare; + + /* pass global parameters to PDF driver*/ + gfxparam_t*p = isrc->parameters->params; + while(p) { + pdf_doc->setparameter(pdf_doc, p->key, p->value); + p = p->next; + } return pdf_doc; - } void pdf_destroy(gfxsource_t*src)