From 42ba5ad2e5f1a05f81e2b057bbc65b4d9d8f8eda Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Thu, 17 Sep 2009 12:39:03 +0200 Subject: [PATCH] added -s linkdatafile parameter to pdf2swf --- lib/pdf/GFXOutputDev.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/pdf/GFXOutputDev.cc b/lib/pdf/GFXOutputDev.cc index a8eb7b2..af891cb 100644 --- a/lib/pdf/GFXOutputDev.cc +++ b/lib/pdf/GFXOutputDev.cc @@ -625,6 +625,7 @@ GFXOutputDev::GFXOutputDev(InfoOutputDev*info, PDFDoc*doc) this->config_drawonlyshapes = 0; this->config_disable_polygon_conversion = 0; this->config_multiply = 1; + this->config_linkdatafile = 0; this->page2page = 0; this->num_pages = 0; @@ -643,6 +644,8 @@ void GFXOutputDev::setParameter(const char*key, const char*value) this->config_drawonlyshapes = atoi(value); } else if(!strcmp(key,"extrafontdata")) { this->config_extrafontdata = atoi(value); + } else if(!strcmp(key,"linkdatafile")) { + this->config_linkdatafile = strdup(value); } else if(!strcmp(key,"convertgradients")) { this->config_convertgradients = atoi(value); } else if(!strcmp(key,"multiply")) { @@ -1655,6 +1658,12 @@ void GFXOutputDev::startPage(int pageNum, GfxState *state, double crop_x1, doubl states[statepos].dashStart = 0; this->last_char_gfxfont = 0; + + if(this->config_linkdatafile) { + FILE*fi = fopen(config_linkdatafile, "ab+"); + fprintf(fi, "[page %d]\n", pageNum); + fclose(fi); + } } @@ -1843,8 +1852,13 @@ void GFXOutputDev::processLink(Link *link, Catalog *catalog) else if(s) { device->drawlink(device, points, s); + if(this->config_linkdatafile) { + FILE*fi = fopen(config_linkdatafile, "ab+"); + fprintf(fi, "%s\n", s); + fclose(fi); + } } - + msg(" \"%s\" link to \"%s\" (%d)", type, FIXNULL(s), page); free(s);s=0; } -- 1.7.10.4