Parcourir la source

Document pages sizes. Remove bad short switched from page size options

Jakob Truelsen il y a 16 ans
Parent
commit
2234f9c7bd
4 fichiers modifiés avec 25 ajouts et 2 suppressions
  1. 2 2
      src/arguments.cc
  2. 3 0
      src/commandlineparser.cc
  3. 1 0
      src/commandlineparser_p.hh
  4. 19 0
      src/docparts.cc

+ 2 - 2
src/arguments.cc

@@ -445,8 +445,8 @@ CommandLineParserPrivate::CommandLineParserPrivate(Settings & s):
 	addarg("htmldoc", 0, "Output program html help", new Caller<ReadmeFunc<true> >());
 	addarg("readme", 0, "Output program readme", new Caller<ReadmeFunc<false> >());
 	addarg("dpi",'d',"Change the dpi explicitly (this has no effect on X11 based systems)", new IntSetter(s.dpi,"dpi",-1));
-	addarg("page-height", 'h', "Page height (default unit millimeter)", new UnitRealSetter(s.size.height,"unitread",QPair<qreal,QPrinter::Unit>(-1,QPrinter::Millimeter)));
-	addarg("page-width", 'w', "Page width  (default unit millimeter)", new UnitRealSetter(s.size.width,"unitread",QPair<qreal,QPrinter::Unit>(-1,QPrinter::Millimeter)));
+	addarg("page-height", 0, "Page height (default unit millimeter)", new UnitRealSetter(s.size.height,"unitread",QPair<qreal,QPrinter::Unit>(-1,QPrinter::Millimeter)));
+	addarg("page-width", 0, "Page width  (default unit millimeter)", new UnitRealSetter(s.size.width,"unitread",QPair<qreal,QPrinter::Unit>(-1,QPrinter::Millimeter)));
 	addarg("disable-javascript",'n',"Do not allow web pages to run javascript", new ConstSetter<bool>(s.enableJavascript,false,true));
 	addarg("grayscale",'g',"PDF will be generated in grayscale", new ConstSetter<QPrinter::ColorMode>(s.colorMode,QPrinter::GrayScale,QPrinter::Color));
 	addarg("lowquality",'l',"Generates lower quality pdf/ps. Useful to shrink the result document space", new ConstSetter<QPrinter::PrinterMode>(s.resolution,QPrinter::ScreenResolution,QPrinter::HighResolution));

+ 3 - 0
src/commandlineparser.cc

@@ -77,6 +77,7 @@ void CommandLineParserPrivate::manpage(FILE * fd) const {
 #else
 	outputNotPatched(o,true);
 #endif
+	outputPageSizes(o);
 	outputArgsFromStdin(o);
  	outputPageBreakDoc(o);
  	outputContact(o);
@@ -99,6 +100,7 @@ void CommandLineParserPrivate::usage(FILE * fd, bool extended) const {
 	outputNotPatched(o, true);
 #endif
 	if (extended) {
+		outputPageSizes(o);
 		outputArgsFromStdin(o);
 		outputProxyDoc(o);
 		outputHeaderFooterDoc(o);
@@ -138,6 +140,7 @@ void CommandLineParserPrivate::readme(FILE * fd, bool html) const {
  	outputHeaderFooterDoc(o);
  	outputOutlineDoc(o);
  	outputPageBreakDoc(o);
+	outputPageSizes(o);
 	outputArgsFromStdin(o);
 	outputStaticProblems(o);
 	outputCompilation(o);

+ 1 - 0
src/commandlineparser_p.hh

@@ -90,6 +90,7 @@ public:
 	void outputSynopsis(Outputter * o) const;
 	void outputDescripton(Outputter * o) const;
 	void outputProxyDoc(Outputter * o) const;
+	void outputPageSizes(Outputter * o) const;
 	void outputArgsFromStdin(Outputter * o) const;
 	void outputHeaderFooterDoc(Outputter * o) const;
 	void outputOutlineDoc(Outputter * o) const;

+ 19 - 0
src/docparts.cc

@@ -347,6 +347,25 @@ void CommandLineParserPrivate::outputInstallation(Outputter * o) const {
 	o->endSection();
 }
 
+/*!
+  Output documentation about page sizes
+  \param o The outputter to output to
+
+*/
+void CommandLineParserPrivate::outputPageSizes(Outputter * o) const {
+	o->beginSection("Page sizes");
+	o->beginParagraph();
+	o->text("The default page size of the rendered document is A4, but using this --page-size option"
+			"this can be changed to almost anything else, such as: A3, Letter and Legal.  "
+			"For a full list of supported pages sizes please see ");
+	o->link("http://doc.trolltech.com/4.6/qprinter.html#PageSize-enum");
+	o->text(".");
+	o->endParagraph();
+	o->paragraph("For a more fine grained control over the page size the "
+				 "--page-height and --page-width options may be used");
+	o->endSection();
+}
+
 /*!
   Output examples on how to use wkhtmltopdf
   \param o The outputter to output to