diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index 17541a2..c24692b 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -774,6 +774,42 @@ void HtmlPage::dumpAsXML(FILE* f,int page){
fputs("\n",f);
}
+static void printCSS(FILE *f)
+{
+ // Image flip/flop CSS
+ // Source:
+ // http://stackoverflow.com/questions/1309055/cross-browser-way-to-flip-html-image-via-javascript-css
+ // tested in Chrome, Fx (Linux) and IE9 (W7)
+ static const char css[] =
+ "" "\n";
+
+ fwrite( css, sizeof(css)-1, 1, f );
+}
+
int HtmlPage::dumpComplexHeaders(FILE * const file, FILE *& pageFile, int page) {
GooString* tmp;
@@ -902,20 +938,27 @@ void HtmlPage::dump(FILE *f, int pageNum)
int listlen=imgList->getLength();
for (int i = 0; i < listlen; i++) {
HtmlImage *img = (HtmlImage*)imgList->del(0);
- fprintf(f,"
\n",img->fName->getCString());
+
+ // see printCSS() for class names
+ const char *styles[4] = { "", " class=\"xflip\"", " class=\"yflip\"", " class=\"xyflip\"" };
+ int style_index=0;
+ if (img->xMin > img->xMax) style_index += 1; // xFlip
+ if (img->yMin > img->yMax) style_index += 2; // yFlip
+
+ fprintf(f,"
\n",styles[style_index],img->fName->getCString());
delete img;
}
GooString* str;
for(HtmlString *tmp=yxStrings;tmp;tmp=tmp->yxNext){
if (tmp->htext){
- str=new GooString(tmp->htext);
- fputs(str->getCString(),f);
- delete str;
- fputs("
\n",f);
+ str=new GooString(tmp->htext);
+ fputs(str->getCString(),f);
+ delete str;
+ fputs("
\n",f);
}
}
- fputs("