[poppler] utils/pdftohtml.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Feb 19 14:49:59 PST 2012


 utils/pdftohtml.cc |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 1bcae7aa8f87cc85ee6b477bf0abb49452e46505
Author: Igor Slepchin <igor.redhat at gmail.com>
Date:   Sun Feb 19 23:40:50 2012 +0100

    Consistently check if pdftohtml needs to generate outlines.

diff --git a/utils/pdftohtml.cc b/utils/pdftohtml.cc
index 83e484a..f7d3f14 100644
--- a/utils/pdftohtml.cc
+++ b/utils/pdftohtml.cc
@@ -46,6 +46,7 @@
 #include "XRef.h"
 #include "Catalog.h"
 #include "Page.h"
+#include "Outline.h"
 #include "PDFDoc.h"
 #include "PDFDocFactory.h"
 #include "HtmlOutputDev.h"
@@ -182,6 +183,7 @@ int main(int argc, char *argv[]) {
   SplashOutputDev *splashOut = NULL;
 #endif
   PSOutputDev *psOut = NULL;
+  GBool doOutline;
   GBool ok;
   char *p;
   GooString *ownerPW, *userPW;
@@ -370,6 +372,11 @@ int main(int argc, char *argv[]) {
   else
       rawOrder = singleHtml;
 
+#ifdef DISABLE_OUTLINE
+  doOutline = gFalse;
+#else
+  doOutline = doc->getOutline()->getItems() != NULL;
+#endif
   // write text file
   htmlOut = new HtmlOutputDev(doc->getCatalog(), htmlFileName->getCString(), 
 	  docTitle->getCString(), 
@@ -380,7 +387,7 @@ int main(int argc, char *argv[]) {
 	  extension,
 	  rawOrder, 
 	  firstPage,
-	  doc->getCatalog()->getOutline()->isDict());
+	  doOutline);
   delete docTitle;
   if( author )
   {   


More information about the poppler mailing list