From fabf01ae05897e5a9ec0e357324503f582320c32 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Asbj=C3=B8rn=20Sloth=20T=C3=B8nnesen?= Date: Wed, 9 Jun 2010 13:40:39 +0000 Subject: [PATCH] poppler: XMLOutputDev::endPage: update to use new API --- lib/pdf/XMLOutputDev.cc | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/lib/pdf/XMLOutputDev.cc b/lib/pdf/XMLOutputDev.cc index d04e2bd..a5fd653 100644 --- a/lib/pdf/XMLOutputDev.cc +++ b/lib/pdf/XMLOutputDev.cc @@ -19,9 +19,11 @@ #include "../../config.h" #include #include -#include "gfile.h" #include "XMLOutputDev.h" #include "GfxState.h" +#ifndef HAVE_POPPLER + #include "gfile.h" +#endif XMLOutputDev::XMLOutputDev(char*filename) :TextOutputDev(mktmpname(0), false, false, false) @@ -66,10 +68,15 @@ void XMLOutputDev::endPage() TextWord*word = list->get(i); GString*newfont = word->getFontName(); double newsize = word->getFontSize(); +#ifdef HAVE_POPPLER + double newbase = word->getBaseline(); +#else double newbase = word->base; - double newcolor_r = word->colorR; - double newcolor_g = word->colorG; - double newcolor_b = word->colorB; +#endif + double newcolor_r; + double newcolor_g; + double newcolor_b; + word->getColor(&newcolor_r, &newcolor_g, &newcolor_b); if((newfont && newfont->cmp(fontname)) || newsize != fontsize || @@ -103,15 +110,20 @@ void XMLOutputDev::endPage() if(strstr(name, "medi")) bold = gTrue; if(strstr(name, "serif")) serif = gTrue; } - + + double xMin,yMin,xMax,yMax; + word->getBBox(&xMin, &yMin, &xMax, &yMax); + + int rot = word->getRotation(); + fprintf(out, "", name, newbase, - (word->rot&1)?word->yMin:word->xMin, - (word->rot&1)?word->yMin:word->xMin, - (word->rot&1)?word->xMin:word->yMin, - (word->rot&1)?word->yMax:word->xMax, - (word->rot&1)?word->xMax:word->yMax, + (rot&1)?yMin:xMin, + (rot&1)?yMin:xMin, + (rot&1)?xMin:yMin, + (rot&1)?yMax:xMax, + (rot&1)?xMax:yMax, info->isFixedWidth()?"fixed;":"", serif?"serif;":"", italic?"italic;":"", @@ -138,7 +150,7 @@ void XMLOutputDev::endPage() } s++; } - if(word->spaceAfter) + if(word->getSpaceAfter()) fprintf(out, " "); } if(textTag) fprintf(out, "\n"); -- 1.7.10.4