Dear Albert/ Carlos,<br><br>We have a requirement to give link or reference to this commit. Means can we get announcement about this commit in the form of some upcoming feature list or news item that this new patch will be added in poppler-0.15.1? or these mails only work for the same.<br>
<br>Hope our requirement is clear.<br><br>Please acknowledge to this.<br><br>Thanks & regards<br>Leena C<br><br><div class="gmail_quote">On Fri, Sep 17, 2010 at 3:54 AM, Albert Astals Cid <span dir="ltr"><<a href="mailto:aacid@kemper.freedesktop.org">aacid@kemper.freedesktop.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> utils/HtmlFonts.cc | 11 +++++-<br>
utils/HtmlFonts.h | 18 +++++++++-<br>
utils/HtmlOutputDev.cc | 84 ++++++++++++++++++++++++++++++-------------------<br>
utils/pdftohtml.1 | 3 +<br>
utils/pdftohtml.cc | 15 +++++++-<br>
5 files changed, 93 insertions(+), 38 deletions(-)<br>
<br>
New commits:<br>
commit 3b4a901a4431814590449b6cd5ea418f4d6c1172<br>
Author: Albert Astals Cid <<a href="mailto:aacid@kde.org">aacid@kde.org</a>><br>
Date: Thu Sep 16 23:23:03 2010 +0100<br>
<br>
Add -s option<br>
<br>
Writes a single html file<br>
Since git does not allow multiple authors i'm adding them here<br>
OSSD CDAC Mumbai by Leena Chourey (<a href="mailto:leenac@cdacmumbai.in">leenac@cdacmumbai.in</a>) and Onkar Potdar (<a href="mailto:onkar@cdacmumbai.in">onkar@cdacmumbai.in</a>)<br>
<br>
diff --git a/utils/HtmlFonts.cc b/utils/HtmlFonts.cc<br>
index d2cbfd5..4b592d5 100644<br>
--- a/utils/HtmlFonts.cc<br>
+++ b/utils/HtmlFonts.cc<br>
@@ -20,6 +20,7 @@<br>
// Copyright (C) 2007 Albert Astals Cid <<a href="mailto:aacid@kde.org">aacid@kde.org</a>><br>
// Copyright (C) 2008 Boris Toloknov <<a href="mailto:tlknv@yandex.ru">tlknv@yandex.ru</a>><br>
// Copyright (C) 2008 Tomas Are Haavet <<a href="mailto:tomasare@gmail.com">tomasare@gmail.com</a>><br>
+// Copyright (C) 2010 OSSD CDAC Mumbai by Leena Chourey (<a href="mailto:leenac@cdacmumbai.in">leenac@cdacmumbai.in</a>) and Onkar Potdar (<a href="mailto:onkar@cdacmumbai.in">onkar@cdacmumbai.in</a>)<br>
//<br>
// To see a description of the changes please see the Changelog file that<br>
// came with your tarball or type make ChangeLog if you are building from git<br>
@@ -288,12 +289,14 @@ int HtmlFontAccu::AddFont(const HtmlFont& font){<br>
}<br>
<br>
// get CSS font name for font #i<br>
-GooString* HtmlFontAccu::getCSStyle(int i, GooString* content){<br>
+GooString* HtmlFontAccu::getCSStyle(int i, GooString* content, int j){<br>
GooString *tmp;<br>
GooString *iStr=GooString::fromInt(i);<br>
+ GooString *jStr=GooString::fromInt(j);<br>
<br>
if (!xml) {<br>
tmp = new GooString("<span class=\"ft");<br>
+ tmp->append(jStr);<br>
tmp->append(iStr);<br>
tmp->append("\">");<br>
tmp->append(content);<br>
@@ -303,14 +306,16 @@ GooString* HtmlFontAccu::getCSStyle(int i, GooString* content){<br>
tmp->append(content);<br>
}<br>
<br>
+ delete jStr;<br>
delete iStr;<br>
return tmp;<br>
}<br>
<br>
// get CSS font definition for font #i<br>
-GooString* HtmlFontAccu::CSStyle(int i){<br>
+GooString* HtmlFontAccu::CSStyle(int i, int j){<br>
GooString *tmp=new GooString();<br>
GooString *iStr=GooString::fromInt(i);<br>
+ GooString *jStr=GooString::fromInt(j);<br>
<br>
GooVector<HtmlFont>::iterator g=accu->begin();<br>
g+=i;<br>
@@ -322,6 +327,7 @@ GooString* HtmlFontAccu::CSStyle(int i){<br>
<br>
if(!xml){<br>
tmp->append(".ft");<br>
+ tmp->append(jStr);<br>
tmp->append(iStr);<br>
tmp->append("{font-size:");<br>
tmp->append(Size);<br>
@@ -352,6 +358,7 @@ GooString* HtmlFontAccu::CSStyle(int i){<br>
<br>
delete fontName;<br>
delete colorStr;<br>
+ delete jStr;<br>
delete iStr;<br>
delete Size;<br>
return tmp;<br>
diff --git a/utils/HtmlFonts.h b/utils/HtmlFonts.h<br>
index df2b570..54deaf8 100644<br>
--- a/utils/HtmlFonts.h<br>
+++ b/utils/HtmlFonts.h<br>
@@ -10,6 +10,20 @@<br>
//<br>
//========================================================================<br>
<br>
+//========================================================================<br>
+//<br>
+// Modified under the Poppler project - <a href="http://poppler.freedesktop.org" target="_blank">http://poppler.freedesktop.org</a><br>
+//<br>
+// All changes made under the Poppler project to this file are licensed<br>
+// under GPL version 2 or later<br>
+//<br>
+// Copyright (C) 2010 OSSD CDAC Mumbai by Leena Chourey (<a href="mailto:leenac@cdacmumbai.in">leenac@cdacmumbai.in</a>) and Onkar Potdar (<a href="mailto:onkar@cdacmumbai.in">onkar@cdacmumbai.in</a>)<br>
+//<br>
+// To see a description of the changes please see the Changelog file that<br>
+// came with your tarball or type make ChangeLog if you are building from git<br>
+//<br>
+//========================================================================<br>
+<br>
#ifndef _HTML_FONTS_H<br>
#define _HTML_FONTS_H<br>
#include "goo/GooVector.h"<br>
@@ -89,8 +103,8 @@ public:<br>
g+=i;<br>
return g;<br>
}<br>
- GooString* getCSStyle (int i, GooString* content);<br>
- GooString* CSStyle(int i);<br>
+ GooString* getCSStyle (int i,GooString* content, int j = 0);<br>
+ GooString* CSStyle(int i, int j = 0);<br>
int size() const {return accu->size();}<br>
<br>
};<br>
diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc<br>
index dbf677f..8ff8f08 100644<br>
--- a/utils/HtmlOutputDev.cc<br>
+++ b/utils/HtmlOutputDev.cc<br>
@@ -27,6 +27,7 @@<br>
// Copyright (C) 2009 Reece Dunn <<a href="mailto:msclrhd@gmail.com">msclrhd@gmail.com</a>><br>
// Copyright (C) 2010 Adrian Johnson <<a href="mailto:ajohnson@redneon.com">ajohnson@redneon.com</a>><br>
// Copyright (C) 2010 Hib Eris <<a href="mailto:hib@hiberis.nl">hib@hiberis.nl</a>><br>
+// Copyright (C) 2010 OSSD CDAC Mumbai by Leena Chourey (<a href="mailto:leenac@cdacmumbai.in">leenac@cdacmumbai.in</a>) and Onkar Potdar (<a href="mailto:onkar@cdacmumbai.in">onkar@cdacmumbai.in</a>)<br>
//<br>
// To see a description of the changes please see the Changelog file that<br>
// came with your tarball or type make ChangeLog if you are building from git<br>
@@ -65,6 +66,7 @@ GooList *HtmlOutputDev::imgList=new GooList();<br>
<br>
extern double scale;<br>
extern GBool complexMode;<br>
+extern GBool singleHtml;<br>
extern GBool ignore;<br>
extern GBool printCommands;<br>
extern GBool printHtml;<br>
@@ -670,22 +672,33 @@ void HtmlPage::dumpComplex(FILE *file, int page){<br>
{<br>
GooString* pgNum=GooString::fromInt(page);<br>
tmp = new GooString(DocName);<br>
- tmp->append('-')->append(pgNum)->append(".html");<br>
+ if (!singleHtml){<br>
+ tmp->append('-')->append(pgNum)->append(".html");<br>
+ pageFile = fopen(tmp->getCString(), "w");<br>
+ } else {<br>
+ tmp->append("-html")->append(".html");<br>
+ pageFile = fopen(tmp->getCString(), "a");<br>
+ }<br>
delete pgNum;<br>
-<br>
- if (!(pageFile = fopen(tmp->getCString(), "w"))) {<br>
+ if (!pageFile) {<br>
error(-1, "Couldn't open html file '%s'", tmp->getCString());<br>
delete tmp;<br>
return;<br>
}<br>
- delete tmp;<br>
<br>
- fprintf(pageFile,"%s\n<HTML>\n<HEAD>\n<TITLE>Page %d</TITLE>\n\n",<br>
- DOCTYPE, page);<br>
+ if (!singleHtml)<br>
+ fprintf(pageFile,"%s\n<HTML>\n<HEAD>\n<TITLE>Page %d</TITLE>\n\n", DOCTYPE, page);<br>
+ else<br>
+ fprintf(pageFile,"%s\n<HTML>\n<HEAD>\n<TITLE>%s</TITLE>\n\n", DOCTYPE, tmp->getCString());<br>
+<br>
+ delete tmp;<br>
<br>
htmlEncoding = HtmlOutputDev::mapEncodingToHtml<br>
(globalParams->getTextEncodingName());<br>
- fprintf(pageFile, "<META http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">\n", htmlEncoding);<br>
+ if (!singleHtml)<br>
+ fprintf(pageFile, "<META http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">\n", htmlEncoding);<br>
+ else<br>
+ fprintf(pageFile, "<META http-equiv=\"Content-Type\" content=\"text/html; charset=%s\">\n <br>\n", htmlEncoding);<br>
}<br>
else<br>
{<br>
@@ -701,7 +714,11 @@ void HtmlPage::dumpComplex(FILE *file, int page){<br>
<br>
fputs("<STYLE type=\"text/css\">\n<!--\n",pageFile);<br>
for(int i=fontsPageMarker;i!=fonts->size();i++) {<br>
- GooString *fontCSStyle = fonts->CSStyle(i);<br>
+ GooString *fontCSStyle;<br>
+ if (!singleHtml)<br>
+ fontCSStyle = fonts->CSStyle(i);<br>
+ else<br>
+ fontCSStyle = fonts->CSStyle(i,page);<br>
fprintf(pageFile,"\t%s\n",fontCSStyle->getCString());<br>
delete fontCSStyle;<br>
}<br>
@@ -732,7 +749,10 @@ void HtmlPage::dumpComplex(FILE *file, int page){<br>
xoutRound(tmp1->yMin),<br>
xoutRound(tmp1->xMin));<br>
fputs("<nobr>",pageFile);<br>
- str1=fonts->getCSStyle(tmp1->fontpos, str);<br>
+ if (!singleHtml)<br>
+ str1=fonts->getCSStyle(tmp1->fontpos, str);<br>
+ else<br>
+ str1=fonts->getCSStyle(tmp1->fontpos, str, page);<br>
fputs(str1->getCString(),pageFile);<br>
delete str;<br>
delete str1;<br>
@@ -752,7 +772,7 @@ void HtmlPage::dumpComplex(FILE *file, int page){<br>
<br>
void HtmlPage::dump(FILE *f, int pageNum)<br>
{<br>
- if (complexMode)<br>
+ if (complexMode || singleHtml)<br>
{<br>
if (xml) dumpAsXML(f, pageNum);<br>
if (!xml) dumpComplex(f, pageNum);<br>
@@ -943,28 +963,30 @@ HtmlOutputDev::HtmlOutputDev(char *fileName, char *title,<br>
// for non-xml output (complex or simple) with frames generate the left frame<br>
if(!xml && !noframes)<br>
{<br>
- GooString* left=new GooString(fileName);<br>
- left->append("_ind.html");<br>
-<br>
- doFrame(firstPage);<br>
-<br>
- if (!(fContentsFrame = fopen(left->getCString(), "w")))<br>
- {<br>
- error(-1, "Couldn't open html file '%s'", left->getCString());<br>
- delete left;<br>
- return;<br>
+ if (!singleHtml)<br>
+ {<br>
+ GooString* left=new GooString(fileName);<br>
+ left->append("_ind.html");<br>
+<br>
+ doFrame(firstPage);<br>
+<br>
+ if (!(fContentsFrame = fopen(left->getCString(), "w")))<br>
+ {<br>
+ error(-1, "Couldn't open html file '%s'", left->getCString());<br>
+ delete left;<br>
+ return;<br>
+ }<br>
+ delete left;<br>
+ fputs(DOCTYPE, fContentsFrame);<br>
+ fputs("<HTML>\n<HEAD>\n<TITLE></TITLE>\n</HEAD>\n<BODY>\n",fContentsFrame);<br>
+<br>
+ if (doOutline)<br>
+ {<br>
+ GooString *str = basename(Docname);<br>
+ fprintf(fContentsFrame, "<A href=\"%s%s\" target=\"contents\">Outline</a><br>", str->getCString(), complexMode ? "-outline.html" : "s.html#outline");<br>
+ delete str;<br>
+ }<br>
}<br>
- delete left;<br>
- fputs(DOCTYPE, fContentsFrame);<br>
- fputs("<HTML>\n<HEAD>\n<TITLE></TITLE>\n</HEAD>\n<BODY>\n",fContentsFrame);<br>
-<br>
- if (doOutline)<br>
- {<br>
- GooString *str = basename(Docname);<br>
- fprintf(fContentsFrame, "<A href=\"%s%s\" target=\"contents\">Outline</a><br>", str->getCString(), complexMode ? "-outline.html" : "s.html#outline");<br>
- delete str;<br>
- }<br>
-<br>
if (!complexMode)<br>
{ /* not in complex mode */<br>
<br>
diff --git a/utils/pdftohtml.1 b/utils/pdftohtml.1<br>
index 6cdc6c6..bbdfa56 100644<br>
--- a/utils/pdftohtml.1<br>
+++ b/utils/pdftohtml.1<br>
@@ -40,6 +40,9 @@ exchange .pdf links with .html<br>
.B \-c<br>
generate complex output<br>
.TP<br>
+.B \-s<br>
+generate single html that includes all pages<br>
+.TP<br>
.B \-i<br>
ignore images<br>
.TP<br>
diff --git a/utils/pdftohtml.cc b/utils/pdftohtml.cc<br>
index 5762f90..5323b6e 100644<br>
--- a/utils/pdftohtml.cc<br>
+++ b/utils/pdftohtml.cc<br>
@@ -17,6 +17,7 @@<br>
// Copyright (C) 2010 Hib Eris <<a href="mailto:hib@hiberis.nl">hib@hiberis.nl</a>><br>
// Copyright (C) 2010 Mike Slegeir <<a href="mailto:tehpola@yahoo.com">tehpola@yahoo.com</a>><br>
// Copyright (C) 2010 Suzuki Toshiya <<a href="mailto:mpsuzuki@hiroshima-u.ac.jp">mpsuzuki@hiroshima-u.ac.jp</a>><br>
+// Copyright (C) 2010 OSSD CDAC Mumbai by Leena Chourey (<a href="mailto:leenac@cdacmumbai.in">leenac@cdacmumbai.in</a>) and Onkar Potdar (<a href="mailto:onkar@cdacmumbai.in">onkar@cdacmumbai.in</a>)<br>
//<br>
// To see a description of the changes please see the Changelog file that<br>
// came with your tarball or type make ChangeLog if you are building from git<br>
@@ -67,6 +68,7 @@ GBool printCommands = gTrue;<br>
static GBool printHelp = gFalse;<br>
GBool printHtml = gFalse;<br>
GBool complexMode=gFalse;<br>
+GBool singleHtml=gFalse; // singleHtml<br>
GBool ignore=gFalse;<br>
GBool useSplash=gTrue;<br>
char extension[5]="png";<br>
@@ -107,6 +109,8 @@ static const ArgDesc argDesc[] = {<br>
"exchange .pdf links by .html"},<br>
{"-c", argFlag, &complexMode, 0,<br>
"generate complex document"},<br>
+ {"-s", argFlag, &singleHtml, 0,<br>
+ "generate single document that includes all pages"},<br>
{"-i", argFlag, &ignore, 0,<br>
"ignore images"},<br>
{"-noframes", argFlag, &noframes, 0,<br>
@@ -293,7 +297,7 @@ int main(int argc, char *argv[]) {<br>
if (scale>3.0) scale=3.0;<br>
if (scale<0.5) scale=0.5;<br>
<br>
- if (complexMode) {<br>
+ if (complexMode || singleHtml) {<br>
//noframes=gFalse;<br>
stout=gFalse;<br>
}<br>
@@ -301,11 +305,13 @@ int main(int argc, char *argv[]) {<br>
if (stout) {<br>
noframes=gTrue;<br>
complexMode=gFalse;<br>
+ singleHtml=gFalse;<br>
}<br>
<br>
if (xml)<br>
{<br>
complexMode = gTrue;<br>
+ singleHtml = gFalse;<br>
noframes = gTrue;<br>
noMerge = gTrue;<br>
}<br>
@@ -359,7 +365,10 @@ int main(int argc, char *argv[]) {<br>
}<br>
#endif<br>
<br>
- rawOrder = complexMode; // todo: figure out what exactly rawOrder do :)<br>
+ if (!singleHtml)<br>
+ rawOrder = complexMode; // todo: figure out what exactly rawOrder do :)<br>
+ else<br>
+ rawOrder = singleHtml;<br>
<br>
// write text file<br>
htmlOut = new HtmlOutputDev(htmlFileName->getCString(),<br>
@@ -400,7 +409,7 @@ int main(int argc, char *argv[]) {<br>
}<br>
}<br>
<br>
- if( complexMode && !xml && !ignore ) {<br>
+ if ((complexMode || singleHtml) && !xml && !ignore) {<br>
if(useSplash) {<br>
#ifdef HAVE_SPLASH<br>
GooString *imgFileName = NULL;<br>
_______________________________________________<br>
poppler mailing list<br>
<a href="mailto:poppler@lists.freedesktop.org">poppler@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/poppler" target="_blank">http://lists.freedesktop.org/mailman/listinfo/poppler</a><br>
</blockquote></div><br>