pagesettings.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.17"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>libwkhtmltox: Setting</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="search/searchdata.js"></script>
  14. <script type="text/javascript" src="search/search.js"></script>
  15. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  19. <div id="titlearea">
  20. <table cellspacing="0" cellpadding="0">
  21. <tbody>
  22. <tr style="height: 56px;">
  23. <td id="projectalign" style="padding-left: 0.5em;">
  24. <div id="projectname">libwkhtmltox
  25. </div>
  26. </td>
  27. </tr>
  28. </tbody>
  29. </table>
  30. </div>
  31. <!-- end header part -->
  32. <!-- Generated by Doxygen 1.8.17 -->
  33. <script type="text/javascript">
  34. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  35. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  36. /* @license-end */
  37. </script>
  38. <script type="text/javascript" src="menudata.js"></script>
  39. <script type="text/javascript" src="menu.js"></script>
  40. <script type="text/javascript">
  41. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  42. $(function() {
  43. initMenu('',true,false,'search.php','Search');
  44. $(document).ready(function() { init_search(); });
  45. });
  46. /* @license-end */</script>
  47. <div id="main-nav"></div>
  48. <!-- window showing the filter options -->
  49. <div id="MSearchSelectWindow"
  50. onmouseover="return searchBox.OnSearchSelectShow()"
  51. onmouseout="return searchBox.OnSearchSelectHide()"
  52. onkeydown="return searchBox.OnSearchSelectKey(event)">
  53. </div>
  54. <!-- iframe showing the search results (closed by default) -->
  55. <div id="MSearchResultsWindow">
  56. <iframe src="javascript:void(0)" frameborder="0"
  57. name="MSearchResults" id="MSearchResults">
  58. </iframe>
  59. </div>
  60. </div><!-- top -->
  61. <div class="PageDoc"><div class="header">
  62. <div class="headertitle">
  63. <div class="title">Setting </div> </div>
  64. </div><!--header-->
  65. <div class="contents">
  66. <div class="textblock"><p>Settings can be supplied to PDF and image c-bindings using utf-8 encoded strings. This is done by relatively simple reflection on the CropSettings, HeaderFooter, Margin, ImageGlobal, PdfGlobal, PdfObject, Size, and TableOfContent classes.</p>
  67. <ul>
  68. <li>The <a class="el" href="structwkhtmltopdf__global__settings.html">wkhtmltopdf_global_settings</a> corresponds to the PdfGlobal class and is documented in <a class="el" href="pagesettings.html#pagePdfGlobal">Pdf global settings</a>.</li>
  69. <li>The <a class="el" href="structwkhtmltopdf__object__settings.html">wkhtmltopdf_object_settings</a> corresponds to the PdfGlobal class and is documented in <a class="el" href="pagesettings.html#pagePdfObject">Pdf object settings</a>.</li>
  70. <li>The wkhtmltopdf_image_settings corresponds to the ImageGlobal class and is documented in <a class="el" href="pagesettings.html#pageImageGlobal">Image settings</a>.</li>
  71. </ul>
  72. <h1><a class="anchor" id="pageWeb"></a>
  73. Web page specific settings</h1>
  74. <p>The following web page specific settings apply</p><ul>
  75. <li><b>web.background</b> Should we print the background? Must be either "true" or "false".</li>
  76. <li><b>web.loadImages</b> Should we load images? Must be either "true" or "false".</li>
  77. <li><b>web.enableJavascript</b> Should we enable javascript? Must be either "true" or "false".</li>
  78. <li><b>web.enableIntelligentShrinking</b> Should we enable intelligent shrinkng to fit more content on one page? Must be either "true" or "false". Has no effect for wkhtmltoimage.</li>
  79. <li><b>web.minimumFontSize</b> The minimum font size allowed. E.g. "9"</li>
  80. <li><b>web.defaultEncoding</b> What encoding should we guess content is using if they do not specify it properly? E.g. "utf-8"</li>
  81. <li><b>web.userStyleSheet</b> Url er path to a user specified style sheet.</li>
  82. <li><b>web.enablePlugins</b> Should we enable NS plugins, must be either "true" or "false". Enabling this will have limited success.</li>
  83. </ul>
  84. <h1><a class="anchor" id="pageLoad"></a>
  85. Object Specific loading settings</h1>
  86. <p>The following settings apply for object loading.</p><ul>
  87. <li><b>load.username</b> The user name to use when loging into a website, E.g. "bart"</li>
  88. <li><b>load.password</b> The password to used when logging into a website, E.g. "elbarto"</li>
  89. <li><b>load.jsdelay</b> The mount of time in milliseconds to wait after a page has done loading until it is actually printed. E.g. "1200". We will wait this amount of time or until, javascript calls window.print().</li>
  90. <li><b>load.zoomFactor</b> How much should we zoom in on the content? E.g. "2.2".</li>
  91. <li><b>load.customHeaders</b> TODO</li>
  92. <li><b>load.repertCustomHeaders</b> Should the custom headers be sent all elements loaded instead of only the main page? Must be either "true" or "false".</li>
  93. <li><b>load.cookies</b> TODO</li>
  94. <li><b>load.post</b> TODO</li>
  95. <li><b>load.blockLocalFileAccess</b> Disallow local and piped files to access other local files. Must be either "true" or "false".</li>
  96. <li><b>load.stopSlowScript</b> Stop slow running javascript. Must be either "true" or "false".</li>
  97. <li><b>load.debugJavascript</b> Forward javascript warnings and errors to the warning callback. Must be either "true" or "false".</li>
  98. <li><b>load.loadErrorHandling</b> How should we handle obejcts that fail to load. Must be one of:<ul>
  99. <li>"abort" Abort the conversion process</li>
  100. <li>"skip" Do not add the object to the final output</li>
  101. <li>"ignore" Try to add the object to the final output.</li>
  102. </ul>
  103. </li>
  104. <li><b>load.proxy</b> String describing what proxy to use when loading the object.</li>
  105. <li><b>load.runScript</b> TODO</li>
  106. <li><b>load.printMediaType</b> Should the content be printed using the print media type instead of the screen media type. Must be either "true" or "false". Has no effect for wkhtmltoimage.</li>
  107. </ul>
  108. <h1><a class="anchor" id="pageHeaderFooter"></a>
  109. Header and footer settings</h1>
  110. <p>The same settings can be applied for headers and footers, here there are explained in terms of the header.</p><ul>
  111. <li><b>header.fontSize</b> The font size to use for the header, e.g. "13"</li>
  112. <li><b>header.fontName</b> The name of the font to use for the header. e.g. "times"</li>
  113. <li><b>header.left</b> The string to print in the left part of the header, note that some sequences are replaced in this string, see the wkhtmltopdf manual.</li>
  114. <li><b>header.center</b> The text to print in the center part of the header.</li>
  115. <li><b>header.right</b> The text to print in the right part of the header.</li>
  116. <li><b>header.line</b> Whether a line should be printed under the header (either "true" or "false").</li>
  117. <li><b>header.spacing</b> The amount of space to put between the header and the content, e.g. "1.8". Be aware that if this is too large the header will be printed outside the pdf document. This can be corrected with the margin.top setting.</li>
  118. <li><b>header.htmlUrl</b> Url for a HTML document to use for the header.</li>
  119. </ul>
  120. <h1><a class="anchor" id="pagePdfGlobal"></a>
  121. Pdf global settings</h1>
  122. <p>The <a class="el" href="structwkhtmltopdf__global__settings.html">wkhtmltopdf_global_settings</a> structure contains the following settings:</p><ul>
  123. <li><b>size.pageSize</b> The paper size of the output document, e.g. "A4".</li>
  124. <li><b>size.width</b> The with of the output document, e.g. "4cm".</li>
  125. <li><b>size.height</b> The height of the output document, e.g. "12in".</li>
  126. <li><b>orientation</b> The orientation of the output document, must be either "Landscape" or "Portrait".</li>
  127. <li><b>colorMode</b> Should the output be printed in color or gray scale, must be either "Color" or "Grayscale"</li>
  128. <li><b>resolution</b> Most likely has no effect.</li>
  129. <li><b>dpi</b> What dpi should we use when printing, e.g. "80".</li>
  130. <li><b>pageOffset</b> A number that is added to all page numbers when printing headers, footers and table of content.</li>
  131. <li><b>copies</b> How many copies should we print?. e.g. "2".</li>
  132. <li><b>collate</b> Should the copies be collated? Must be either "true" or "false".</li>
  133. <li><b>outline</b> Should a outline (table of content in the sidebar) be generated and put into the PDF? Must be either "true" or false".</li>
  134. <li><b>outlineDepth</b> The maximal depth of the outline, e.g. "4".</li>
  135. <li><b>dumpOutline</b> If not set to the empty string a XML representation of the outline is dumped to this file.</li>
  136. <li><b>out</b> The path of the output file, if "-" output is sent to stdout, if empty the output is stored in a buffer.</li>
  137. <li><b>documentTitle</b> The title of the PDF document.</li>
  138. <li><b>useCompression</b> Should we use loss less compression when creating the pdf file? Must be either "true" or "false".</li>
  139. <li><b>margin.top</b> Size of the top margin, e.g. "2cm"</li>
  140. <li><b>margin.bottom</b> Size of the bottom margin, e.g. "2cm"</li>
  141. <li><b>margin.left</b> Size of the left margin, e.g. "2cm"</li>
  142. <li><b>margin.right</b> Size of the right margin, e.g. "2cm"</li>
  143. <li><b>imageDPI</b> The maximal DPI to use for images in the pdf document.</li>
  144. <li><b>imageQuality</b> The jpeg compression factor to use when producing the pdf document, e.g. "92".</li>
  145. <li><b>load.cookieJar</b> Path of file used to load and store cookies.</li>
  146. </ul>
  147. <h1><a class="anchor" id="pagePdfObject"></a>
  148. Pdf object settings</h1>
  149. <p>The <a class="el" href="structwkhtmltopdf__object__settings.html">wkhtmltopdf_object_settings</a> structure contains the following settings:</p><ul>
  150. <li><b>toc.useDottedLines</b> Should we use a dotted line when creating a table of content? Must be either "true" or "false".</li>
  151. <li><b>toc.captionText</b> The caption to use when creating a table of content.</li>
  152. <li><b>toc.forwardLinks</b> Should we create links from the table of content into the actual content? Must be either "true or "false.</li>
  153. <li><b>toc.backLinks</b> Should we link back from the content to this table of content.</li>
  154. <li><b>toc.indentation</b> The indentation used for every table of content level, e.g. "2em".</li>
  155. <li><b>toc.fontScale</b> How much should we scale down the font for every toc level? E.g. "0.8"</li>
  156. <li><b>page</b> The URL or path of the web page to convert, if "-" input is read from stdin.</li>
  157. <li><b>header</b>.* Header specific settings see <a class="el" href="pagesettings.html#pageHeaderFooter">Header and footer settings</a>.</li>
  158. <li><b>footer</b>.* Footer specific settings see <a class="el" href="pagesettings.html#pageHeaderFooter">Header and footer settings</a>.</li>
  159. <li><b>useExternalLinks</b> Should external links in the HTML document be converted into external pdf links? Must be either "true" or "false.</li>
  160. <li><b>useLocalLinks</b> Should internal links in the HTML document be converted into pdf references? Must be either "true" or "false"</li>
  161. <li><b>replacements</b> TODO</li>
  162. <li><b>produceForms</b> Should we turn HTML forms into PDF forms? Must be either "true" or file".</li>
  163. <li><b>load</b>.* Page specific settings related to loading content, see <a class="el" href="pagesettings.html#pageLoad">Object Specific loading settings</a>.</li>
  164. <li><b>web</b>.* See <a class="el" href="pagesettings.html#pageWeb">Web page specific settings</a>.</li>
  165. <li><b>includeInOutline</b> Should the sections from this document be included in the outline and table of content?</li>
  166. <li><b>pagesCount</b> Should we count the pages of this document, in the counter used for TOC, headers and footers?</li>
  167. <li><b>tocXsl</b> If not empty this object is a table of content object, "page" is ignored and this xsl style sheet is used to convert the outline XML into a table of content.</li>
  168. </ul>
  169. <h1><a class="anchor" id="pageImageGlobal"></a>
  170. Image settings</h1>
  171. <p>The wkhtmltoimage_global_settings structure contains the following settings:</p><ul>
  172. <li><b>crop.left</b> left/x coordinate of the window to capture in pixels. E.g. "200"</li>
  173. <li><b>crop.top</b> top/y coordinate of the window to capture in pixels. E.g. "200"</li>
  174. <li><b>crop.width</b> Width of the window to capture in pixels. E.g. "200"</li>
  175. <li><b>crop.height</b> Height of the window to capture in pixels. E.g. "200"</li>
  176. <li><b>load.cookieJar</b> Path of file used to load and store cookies.</li>
  177. <li><b>load</b>.* Page specific settings related to loading content, see <a class="el" href="pagesettings.html#pageLoad">Object Specific loading settings</a>.</li>
  178. <li><b>web</b>.* See <a class="el" href="pagesettings.html#pageWeb">Web page specific settings</a>.</li>
  179. <li><b>transparent</b> When outputting a PNG or SVG, make the white background transparent. Must be either "true" or "false"</li>
  180. <li><b>in</b> The URL or path of the input file, if "-" stdin is used. E.g. "http://google.com"</li>
  181. <li><b>out</b> The path of the output file, if "-" stdout is used, if empty the content is stored to a internalBuffer.</li>
  182. <li><b>fmt</b> The output format to use, must be either "", "jpg", "png", "bmp" or "svg".</li>
  183. <li><b>screenWidth</b> The with of the screen used to render is pixels, e.g "800".</li>
  184. <li><b>smartWidth</b> Should we expand the screenWidth if the content does not fit? must be either "true" or "false".</li>
  185. <li><b>quality</b> The compression factor to use when outputting a JPEG image. E.g. "94". </li>
  186. </ul>
  187. </div></div><!-- contents -->
  188. </div><!-- PageDoc -->
  189. <!-- start footer part -->
  190. <hr class="footer"/><address class="footer"><small>
  191. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  192. <img class="footer" src="doxygen.png" alt="doxygen"/>
  193. </a> 1.8.17
  194. </small></address>
  195. </body>
  196. </html>