X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpdf%2Fpdf.cc;h=b4469233e38c21251fc5295beda9f8eb407292a7;hb=ac7ae5fff104f26aca891fe172a52b6a13775517;hp=7381ca18bc02e48a4cb9d46fb7e5274d3b95b2fc;hpb=3c334be274efc5f03038dc392c8266235c5ed6d5;p=swftools.git diff --git a/lib/pdf/pdf.cc b/lib/pdf/pdf.cc index 7381ca1..b446923 100644 --- a/lib/pdf/pdf.cc +++ b/lib/pdf/pdf.cc @@ -140,13 +140,13 @@ void pdf_doc_destroy(gfxdocument_t*gfx) void pdf_doc_set_parameter(gfxdocument_t*gfx, char*name, char*value) { pdf_doc_internal_t*i= (pdf_doc_internal_t*)gfx->internal; + GFXOutputDev*o = i->outputDev; if(!strcmp(name, "pagemap")) { - GFXOutputDev*o = i->outputDev; int pdfpage=0, outputpage=0; sscanf(value,"%d:%d", &pdfpage, &outputpage); o->preparePage(pdfpage, outputpage); } else { - msg(" Ignored parameter: %s=%s", name, value); + o->setParameter(name, value); } } @@ -235,11 +235,17 @@ char* pdf_doc_getinfo(gfxdocument_t*doc, char*name) else if(!strcmp(name, "creationdate")) return getInfoDate(i->docinfo.getDict(), "CreationDate"); else if(!strcmp(name, "moddate")) return getInfoDate(i->docinfo.getDict(), "ModDate"); else if(!strcmp(name, "linearized")) return strdup(i->doc->isLinearized() ? "yes" : "no"); + else if(!strcmp(name, "tagged")) return strdup(i->doc->getStructTreeRoot()->isDict() ? "yes" : "no"); else if(!strcmp(name, "encrypted")) return strdup(i->doc->isEncrypted() ? "yes" : "no"); else if(!strcmp(name, "oktoprint")) return strdup(i->doc->okToPrint() ? "yes" : "no"); else if(!strcmp(name, "oktocopy")) return strdup(i->doc->okToCopy() ? "yes" : "no"); else if(!strcmp(name, "oktochange")) return strdup(i->doc->okToChange() ? "yes" : "no"); else if(!strcmp(name, "oktoaddnotes")) return strdup(i->doc->okToAddNotes() ? "yes" : "no"); + else if(!strcmp(name, "version")) { + char buf[32]; + sprintf(buf, "%.1f", i->doc->getPDFVersion()); + return strdup(buf); + } return 0; }