Эх сурвалжийг харах

Do not include covers in the outline and toc

Antialize 15 жил өмнө
parent
commit
39cd4a648a

+ 7 - 4
src/lib/pdfconverter.cc

@@ -283,11 +283,14 @@ void PdfConverterPrivate::pagesLoaded(bool ok) {
 
 		painter->save();
 		QWebPrinter wp(obj.page->mainFrame(), printer, *painter);
-		obj.pageCount = objects[d].settings.pagesCount? wp.pageCount(): 0;
-		pageCount += objects[d].pageCount;
+		obj.pageCount = obj.settings.pagesCount? wp.pageCount(): 0;
+		pageCount += obj.pageCount;
 
-		outline->addWebPage(obj.page->mainFrame()->title(), wp, obj.page->mainFrame(),
-							obj.settings, obj.localLinks, obj.anchors);
+		if (obj.settings.includeInOutline)
+			outline->addWebPage(obj.page->mainFrame()->title(), wp, obj.page->mainFrame(),
+								obj.settings, obj.localLinks, obj.anchors);
+		else
+			outline->addEmptyWebPage();
 		painter->restore();
 	}
 

+ 3 - 1
src/pdf/pdfarguments.cc

@@ -244,6 +244,9 @@ PdfCommandLineParser::PdfCommandLineParser(PdfGlobal & s, QList<PdfObject> & ps)
 
 	extended(true);
  	qthack(true);
+	addarg("include-in-outline", 0, "Include the page in the table of contents and outlines", new ConstSetter<bool>(od.includeInOutline, true));
+	addarg("exclude-from-outline", 0, "Do not include the page in the table of contents and outlines", new ConstSetter<bool>(od.includeInOutline, false));
+
 	addarg("disable-smart-shrinking", 0, "Disable the intelligent shrinking strategy used by WebKit that makes the pixel/dpi ratio none constant",new ConstSetter<bool>(od.web.enableIntelligentShrinking, false));
  	addarg("enable-smart-shrinking", 0, "Enable the intelligent shrinking strategy used by WebKit that makes the pixel/dpi ratio none constant",new ConstSetter<bool>(od.web.enableIntelligentShrinking, true));
 
@@ -263,7 +266,6 @@ PdfCommandLineParser::PdfCommandLineParser(PdfGlobal & s, QList<PdfObject> & ps)
 	addarg("disable-toc-back-links",0,"Do not link from section header to toc", new ConstSetter<bool>(od.toc.backLinks,false));
 
 	addPageLoadArgs(od.load);
-
 // 	addarg("page-offset",0,"Set the starting page number", new IntSetter(s.pageOffset,"offset",1));
 
 

+ 1 - 1
src/shared/commandlineparserbase.cc

@@ -23,7 +23,7 @@
 #include <qwebframe.h>
 
 bool ahsort(const ArgHandler * a, const ArgHandler * b) {
-	QRegExp e("^(no|enable|disable)-");
+	QRegExp e("^(no|enable|disable|include-in|exclude-from)-");
 	QString x=a->longName;
 	QString y=b->longName;
 	x.remove(e);