Blame | Letzte Änderung | Log anzeigen | RSS feed
<html><head><title>html2ps/html2pdf script parameters</title><link rel="stylesheet" type="text/css" medial="all" title="Default" href="css/help.css"/></head><body><h1 id="top">html2ps/pdf script parameters</h1><p><a href="index.html">Back to table of contents</a></p><p> Note that parameter names are case-sensitive. This script accepts parameterspassed using both the GET and POST methods. Script parameters (in alphabetical order) are:</p><table class="description_table"><tr class="odd"><th>Parameter</th><th>Description</th></tr><tr class="even"><td>batch[]</td><td>Specify a list of URL for "batch-processing" mode here.Note that ##PAGES## directive will not work in this case.</td></tr><tr class="odd"><td>compress</td><td>Set this option to generate compressed Postscript files. You'll probablyonly need this option only if you're working with Postscript (NOT PDF) filesvia Adobe Acrobat Distiller, as it does not support compressed Postscript.In any other case, use compressed Postscript, as it will save on bandwidth.<p>PDF files may be compressed, but you will need to unpack them manually before viewing.</td></tr></tr><tr class="even"><td id="cssmedia">cssmedia</td><td>HTML page can contain stylesheets for different target media types; forexample, the printable version of a page may have navigation panes and bannershidden, while the version for handhelds may be specially formatted to workon small displays and so on. By setting the value of this parameter, youdetermine which set of CSS rules will be used during PS/PDF rendering.</td></tr><tr class="odd"><td id="debugbox">debugbox</td><td><p>Set this option if you want to see boundaries of all boxes generated by the script.It is unlikely you'll need this option, as it is mostly for debugging purposes.</p><p>Please note if you're using this option that the script renders the <i>content</i>boundary which is different from the "normal" box border!</td></tr><tr class="even"><td id="encoding">encoding</td><td>Encoding can usually be automatically detected using HTTP response headeror META tags inside the HTML. Sometimes, encoding information is missing;you can specify encoding name as a value of this parameter.</td></tr><tr class="odd"><td id="footerhtml">footerhtml</td><td>HTML string containing text to insert to every page footer.<p>You may use 'style' attribute to control header/footer appearance; for example:</p><pre><div style="background: red;">SOME TEXT</div></pre><p>Note this string must be (almost) valid XHTML (almost means that HTML/HEAD/BODY tags may be omitted). In particular:</p><ul><li>you should replace &,< and > with &amp;,&lt and &gt; correspondingly.</li><li>All tags should be closed (including self-closing tags like BR or IMG).</li><li>Tag and attribute names should be in lower case.</li></ul><p>See also: <a href="http://www.w3.org/TR/xhtml1/#diffs">XHTML 1.0: Differences with HTML 4</a>.</p><p>For more sophisticated control over the header/footer data, please refer to <a href="compatibility.css.3.html#marginboxes">CSS 3 margin boxes</a></p></td></tr><tr class="even"><td id="headerhtml">headerhtml</td><td><p>HTML string containing text to insert to every page header.You may use 'style' attribute to control header/footer appearance; for example:</p><pre><div style="background: red;">SOME TEXT</div></pre><p>Note this string must be (almost) valid XHTML (almost means that HTML/HEAD/BODY tags may be omitted). In particular:</p><ul><li>you should replace &,< and > with &amp;,&lt and &gt; correspondingly.</li><li>All tags should be closed (including self-closing tags like BR or IMG).</li><li>Tag and attribute names should be in lower case.</li></ul><p>See also: <a href="http://www.w3.org/TR/xhtml1/#diffs">XHTML 1.0: Differences with HTML 4</a>.</p><p>For more sophisticated control over the header/footer data, please refer to <a href="compatibility.css.3.html#marginboxes">CSS 3 margin boxes</a></p></td></tr><tr class="odd"><td>html2xhtml</td><td>If you're absolutely sure you have valid strict XHTML page, you can setthis option to disable HTML-to-XHTML conversion and speed up script executiona little. In any other case, do not set this option, as the script willnot work with non-well-formed XML. Use this option at your own risk; if you encounts anyerrors first enable the HTML-to-XHTML conversion.</td></tr><tr class="even"><td id="landscape">landscape</td><td>Set this parameter to rotate the media to landscape orientation. Pleasenote that the 'virtual resolution' will remain the same; all page contentwill be scaled to fit the new page width.</td></tr><tr class="odd"><td id="margins">leftmargin, rightmargin, topmargin, bottommargin</td><td>Page margins (millimeters). Note that you may calculate top and bottom margin height automaticallyto fit header/footer content (provided it is defined using CSS 3 margin boxes) by specifying zero values fortopmargin AND bottommargin at the same time.</td></tr><tr><tr class="even"><td id="media">media</td><td>Name of <a href="configuration.html#common" title="Media definitions in configuration file">predefined media</a> to use. Note that media name is case-sensitive!</td></tr><tr class="odd"><td>method</td><td>This option determines the type of script output:<ul><li>fastps -- Postscript;</li><li>pdflib -- PDF generated using PDFLIB;</li><li>fpdf -- PDF generated using <a href="http://www.fpdf.org" target="_blank">FPdf</a></li></ul></td></tr><tr class="even"><td>output</td><td>The value of this parameter determines how the generated file will behandled:<ul><li>0 -- PDF file will be opened immediately (possibly in the same browserwindow). Note it will not work for Postscript files in most cases, theywill be downloaded as usual;</li><li>1 -- user will be prompted to download generated file;</li><li>2 -- generated file will be <a href="configuration.html#common" title="How to configure this option">storedon the server</a>;</li></ul></td></tr><tr class="odd"><td id="pageborder">pageborder</td><td>Set this parameter if you want the page border to be printed.</td></tr><tr class="even"><td>pdfversion</td><td>This option determines the compatibility level of PDF to be generated;the higher level you use, more features can this PDF contain. On the otherhand, high-level PDFs may not be readable by older viewer versions:<ul><li>1.2 (Acrobat Reader 3)</li><li>1.3 (Acrobat Reader 4)</li><li>1.4 (Acrobat Reader 5)</li><li>1.5 (Acrobat Reader 6)</li></ul></td></tr><tr class="odd"><td id="pixels">pixels</td><td><p>'Virtual screen' horizontal resolution used during the page renderingprocess. As you know, a lot of HTML pages contain dimensions set in pixels-- images, in most cases, but sometimes fonts. Postscript/PDF files donot have "pixels", all dimensions are measured in "points"so we need to provide information about the pixel/point ratio. In ourcase, this ratio can be calculated as follows: </p><pre>R = (page full width in points - page horizontal margins in points) / virtual resolution</pre><p>Thus, you can specify resolution in 800 pixels and make pages designedfor 800x600 resolution to fit your printed page exactly.</p><p><tt>index.php</tt> provides three default values for this parameter:640, 800 and 1024; if you need more exotic value, say 945, you may specifythis in the script query string manually and still get correct results.</p><p>Please note that pages may be cut off on the right side if they're designed for the higher resolutionthan you've specified (for example, if they have hardcoded table widths or wide images). It is a feature.In such cases please consider increasing 'pixels' value.</p></td></tr><tr class="even"><td>process_mode</td><td>Set this parameter to 'batch' to process several URLs at once and merge results in one PDF file;if this parameter have any other value, script runs in normal "single-url" mode.</td></tr><tr class="odd"><td>pslevel</td><td>If this parameter have value of '3', the script will generate Postscript Level 3;otherwise – Postscript Level 2. Default value is '3'. This parameter does not affect PDF generation.</td></tr><tr class="even"><td>ps2pdf</td><td>Flag indicating whether script should convert generated Postscript file to PDF using Ghostscript utility.Note that generally script does not prevent you to enable this filter for 'fpdf' and 'pdflib' methods, butthis will result in conversion error.</td></tr><tr class="odd"><td id="renderfields">renderfields</td><td>Flag indicating whether script should render special fields like ##PAGE##. Fields will be rendered if this parameteris present (even if it has empty value)</td></tr><tr class="even"><td id="renderforms">renderforms</td><td>Flag indicating whether script should render interactive form controls. Forms will be rendered if this parameteris present (even if it has empty value)</td></tr><tr class="odd"><td id="renderimages">renderimages</td><td>Flag indicating whether script should fetch and render image files. Images will be rendered if this parameteris present (even if it has empty value)</td></tr><tr class="even"><td id="renderlinks">renderlinks</td><td>Flag indicating whether script should render internal and external hyperlinks. Links will be rendered if this parameteris present (even if it has empty value)</td></tr><tr class="odd"><td id="scalepoints">scalepoints</td><td><p>When a page contains both device-dependent (in pixels) and device-independent(in points) dimensions, we're in trouble. For example, imagine a pagecontaining absolute-positioned text inside the image; in this case, asdisplay and paper have different sizes, point/pixel ratio will be differentin the browser window and file rendered by the script, possilibly breakingthe page layout. To prevent this, the <tt>scalepoint</tt> option is used.</p><p>If this parameter is set, the HTML page "points" are scaledto keep the mentioned ratio, so if you print the resulting file and measurefonts, they will be smaller than you expect, but the page layout willbe exactly the same as you see in browser window (well, close to it).If you want fonts to have their real size, disable this option.</p><p>Note that this additional scaling applies to points only; such units as in, cm, mm and pcare not affected by this option.</p></td></tr><tr class="even"><td id="renderlinks">toc</td><td>Flag indicating whether script should automatically generate <a href="generated_toc.html">table of contents</a></td></tr><tr class="odd"><td id="renderlinks">toc-location</td><td>Defines the place where to place generated table of contents:<ul><li><tt>before</tt> — on the first (separate) page</li><li><tt>after</tt> — on the last (separate) page (default)</li><li><tt>placeholder</tt> — replace placeholder DIV</li></ul></td></tr><tr class="even"><td>URL</td><td><p>URL you're going to convert (page should be available via either <tt>http</tt>or <tt>https</tt>). Note that the <tt>http://</tt> prefix is prepended tothis value automatically in case no http or https protocol part is found,thus you may set the value of this parameter, for example, to <tt>www.google.com</tt>,not <tt>http://www.google.com</tt>.</p><p>Note that if you're trying to use URL containing GET request (e.g. http://www.google.com/search?q=test),you <b>must</b> apply <a title="Documentation on 'urlencode' - new window" target="_blank" href="http://php.net/urlencode">urlencode</a> functionto this url.</p></td></tr><tr class="odd"><td id="watermarkhtml">watermarkhtml</td><td>HTML string containing text to display across every page.</td></tr></table><a href="#top">Top↑</a><div style="height: 800px;"> </div></body></html>