maxGraph/docs/js-api/files/view/mxPrintPreview-js.html

147 lines
59 KiB
HTML
Raw Normal View History

2012-05-21 20:32:26 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><title>mxPrintPreview</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script><script language=JavaScript src="../../javascript/prettify.js"></script><script language=JavaScript src="../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
<!-- Generated by Natural Docs, version 1.5 -->
<!-- http://www.naturaldocs.org -->
<!-- saved from url=(0026)http://www.naturaldocs.org -->
<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="mxPrintPreview"></a>mxPrintPreview</h1><div class=CBody><p>Implements printing of a diagram across multiple pages.&nbsp; The following opens a print preview for an existing graph:</p><blockquote><pre class="prettyprint">var preview = new mxPrintPreview(graph);
2013-05-23 16:14:48 +00:00
preview.open();</pre></blockquote><p>Use <a href="../util/mxUtils-js.html#mxUtils.getScaleForPageCount" class=LFunction id=link28 onMouseOver="ShowTip(event, 'tt27', 'link28')" onMouseOut="HideTip('tt27')">mxUtils.getScaleForPageCount</a> as follows in order to print the graph across a given number of pages:</p><blockquote><pre class="prettyprint">var pageCount = mxUtils.prompt('Enter page count', '1');
2012-05-21 20:32:26 +00:00
if (pageCount != null)
{
var scale = mxUtils.getScaleForPageCount(pageCount, graph);
var preview = new mxPrintPreview(graph, scale);
preview.open();
2013-05-23 16:14:48 +00:00
}</pre></blockquote><h4 class=CHeading>Additional pages</h4><p>To add additional pages before and after the output, <a href="#mxPrintPreview.getCoverPages" class=LFunction id=link29 onMouseOver="ShowTip(event, 'tt23', 'link29')" onMouseOut="HideTip('tt23')">getCoverPages</a> and <a href="#mxPrintPreview.getAppendices" class=LFunction id=link30 onMouseOver="ShowTip(event, 'tt24', 'link30')" onMouseOut="HideTip('tt24')">getAppendices</a> can be used, respectively.</p><blockquote><pre class="prettyprint">var preview = new mxPrintPreview(graph, 1);
preview.getCoverPages = function(w, h)
{
return [this.renderPage(w, h, mxUtils.bind(this, function(div)
{
div.innerHTML = '&lt;div style=&quot;position:relative;margin:4px;&quot;&gt;Cover Page&lt;/p&gt;'
}))];
}
preview.getAppendices = function(w, h)
{
return [this.renderPage(w, h, mxUtils.bind(this, function(div)
{
div.innerHTML = '&lt;div style=&quot;position:relative;margin:4px;&quot;&gt;Appendix&lt;/p&gt;'
}))];
}
2013-06-28 19:07:06 +00:00
preview.open();</pre></blockquote><h4 class=CHeading>CSS</h4><p>The CSS from the original page is not carried over to the print preview.&nbsp; To add CSS to the page, use the css argument in the <a href="#mxPrintPreview.open" class=LFunction id=link31 onMouseOver="ShowTip(event, 'tt17', 'link31')" onMouseOut="HideTip('tt17')">open</a> function or override <a href="#mxPrintPreview.writeHead" class=LFunction id=link32 onMouseOver="ShowTip(event, 'tt18', 'link32')" onMouseOut="HideTip('tt18')">writeHead</a> to add the respective link tags as follows:</p><blockquote><pre class="prettyprint">var writeHead = preview.writeHead;
preview.writeHead = function(doc, css)
{
writeHead.apply(this, arguments);
doc.writeln('&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot;&gt;');
};</pre></blockquote><h4 class=CHeading>Headers</h4><p>Apart from setting the title argument in the mxPrintPreview constructor you can override <a href="#mxPrintPreview.renderPage" class=LFunction id=link33 onMouseOver="ShowTip(event, 'tt20', 'link33')" onMouseOut="HideTip('tt20')">renderPage</a> as follows to add a header to any page:</p><blockquote><pre class="prettyprint">var oldRenderPage = mxPrintPreview.prototype.renderPage;
2013-05-23 16:14:48 +00:00
mxPrintPreview.prototype.renderPage = function(w, h)
2012-05-21 20:32:26 +00:00
{
var div = oldRenderPage.apply(this, arguments);
var header = document.createElement('div');
header.style.position = 'absolute';
header.style.top = '0px';
header.style.width = '100%';
header.style.textAlign = 'right';
2013-05-23 16:14:48 +00:00
mxUtils.write(header, 'Your header here');
2012-05-21 20:32:26 +00:00
div.firstChild.appendChild(header);
return div;
2013-06-28 19:07:06 +00:00
};</pre></blockquote><p>For adding page numbers to the graph output pages, implement a counter in the above code or override <a href="#mxPrintPreview.addGraphFragment" class=LFunction id=link34 onMouseOver="ShowTip(event, 'tt22', 'link34')" onMouseOut="HideTip('tt22')">addGraphFragment</a> instead, where div corresponds to div.firstChild in the above code.</p><h4 class=CHeading>Page Format</h4><p>For landscape printing, use &lt;mxConstants.PAGE_FORMAT_A4_LANDSCAPE&gt; as the pageFormat in <a href="../util/mxUtils-js.html#mxUtils.getScaleForPageCount" class=LFunction id=link35 onMouseOver="ShowTip(event, 'tt27', 'link35')" onMouseOut="HideTip('tt27')">mxUtils.getScaleForPageCount</a> and <a href="#mxPrintPreview.mxPrintPreview" class=LFunction id=link36 onMouseOver="ShowTip(event, 'tt1', 'link36')" onMouseOut="HideTip('tt1')">mxPrintPreview</a>.&nbsp; Keep in mind that one can not set the defaults for the print dialog of the operating system from JavaScript so the user must manually choose a page format that matches this setting.</p><p>You can try passing the following CSS directive to <a href="#mxPrintPreview.open" class=LFunction id=link37 onMouseOver="ShowTip(event, 'tt17', 'link37')" onMouseOut="HideTip('tt17')">open</a> to set the page format in the print dialog to landscape.&nbsp; However, this CSS directive seems to be ignored in most major browsers, including IE.</p><blockquote><pre class="prettyprint">@page {
2012-05-21 20:32:26 +00:00
size: landscape;
}</pre></blockquote><p>Note that the print preview behaves differently in IE when used from the filesystem or via HTTP so printing should always be tested via HTTP.</p><p>If you are using a DOCTYPE in the source page you can override &lt;getDoctype&gt; and provide the same DOCTYPE for the print preview if required.&nbsp; Here is an example for IE8 standards mode.</p><blockquote><pre class="prettyprint">var preview = new mxPrintPreview(graph);
preview.getDoctype = function()
{
return '&lt;!--[if IE]&gt;&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=5,IE=8&quot; &gt;&lt;![endif]--&gt;';
};
2013-05-23 16:14:48 +00:00
preview.open();</pre></blockquote><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#mxPrintPreview" >mxPrintPreview</a></td><td class=SDescription>Implements printing of a diagram across multiple pages. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#mxPrintPreview.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxPrintPreview.mxPrintPreview" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">mxPrintPreview</a></td><td class=SDescription>Constructs a new print preview for the given parameters.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#mxPrintPreview.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxPrintPreview.graph" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">graph</a></td><td class=SDescription>Reference to the <a href="mxGraph-js.html#mxGraph" class=LClass id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">mxGraph</a> that should be previewed.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#mxPrintPreview.pageFormat" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">pageFormat</a></td><td class=SDescription>Holds the <a href="../util/mxRectangle-js.html#mxRectangle" class=LClass id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">mxRectangle</a> that defines the page format.</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxPrintPreview.scale" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">scale</a></td><td class=SDescription>Holds the scale of the print preview.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#mxPrintPreview.border" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">border</a></td><td class=SDescription>The border inset around each side of every page in the preview. </td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxPrintPreview.y0" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">y0</a></td><td class=SDescription>Holds the vertical offset of the output.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#mxPrintPreview.autoOrigin" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">autoOrigin</a></td><td class=SDescription>Specifies if the origin should be automatically computed based on the top, left corner of the actual diagram contents. </td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxPrintPreview.printOverlays" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">printOverlays</a></td><td class=SDescription>Specifies if overlays should be printed. </td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#mxPrintPreview.borderColor" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">borderColor</a></td><td class=SDescription>Holds the color value for the page border.</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxPrintPreview.title" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">title</a></td><td class=SDescription>Holds the title of the preview window.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#mxPrintPreview.pageSelector" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">pageSelector</a></td><td class=SDescription>Boolean that specifies if the page selector should be displayed. </td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxPrintPreview.wnd" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMou
2012-05-21 20:32:26 +00:00
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.Functions"></a>Functions</h3></div></div>
2013-06-28 19:07:06 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.mxPrintPreview"></a>mxPrintPreview</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function mxPrintPreview(</td><td class=PParameter nowrap>graph,</td></tr><tr><td></td><td class=PParameter nowrap>scale,</td></tr><tr><td></td><td class=PParameter nowrap>pageFormat,</td></tr><tr><td></td><td class=PParameter nowrap>border,</td></tr><tr><td></td><td class=PParameter nowrap>x0,</td></tr><tr><td></td><td class=PParameter nowrap>y0,</td></tr><tr><td></td><td class=PParameter nowrap>borderColor,</td></tr><tr><td></td><td class=PParameter nowrap>title,</td></tr><tr><td></td><td class=PParameter nowrap>pageSelector</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs a new print preview for the given parameters.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>graph</td><td class=CDLDescription><a href="mxGraph-js.html#mxGraph" class=LClass id=link38 onMouseOver="ShowTip(event, 'tt3', 'link38')" onMouseOut="HideTip('tt3')">mxGraph</a> to be previewed.</td></tr><tr><td class=CDLEntry>scale</td><td class=CDLDescription>Optional scale of the output.&nbsp; Default is 1 / <a href="mxGraph-js.html#mxGraph.pageScale" class=LVariable id=link39 onMouseOver="ShowTip(event, 'tt28', 'link39')" onMouseOut="HideTip('tt28')">mxGraph.pageScale</a>.</td></tr><tr><td class=CDLEntry>border</td><td class=CDLDescription>Border in pixels along each side of every page.&nbsp; Note that the actual print function in the browser will add another border for printing.</td></tr><tr><td class=CDLEntry>pageFormat</td><td class=CDLDescription><a href="../util/mxRectangle-js.html#mxRectangle" class=LClass id=link40 onMouseOver="ShowTip(event, 'tt5', 'link40')" onMouseOut="HideTip('tt5')">mxRectangle</a> that specifies the page format (in pixels).&nbsp; This should match the page format of the printer.&nbsp; Default uses the <a href="mxGraph-js.html#mxGraph.pageFormat" class=LVariable id=link41 onMouseOver="ShowTip(event, 'tt29', 'link41')" onMouseOut="HideTip('tt29')">mxGraph.pageFormat</a> of the given graph.</td></tr><tr><td class=CDLEntry>x0</td><td class=CDLDescription>Optional left offset of the output.&nbsp; Default is 0.</td></tr><tr><td class=CDLEntry>y0</td><td class=CDLDescription>Optional top offset of the output.&nbsp; Default is 0.</td></tr><tr><td class=CDLEntry>borderColor</td><td class=CDLDescription>Optional color of the page border.&nbsp; Default is no border.&nbsp; Note that a border is sometimes useful to highlight the printed page border in the print preview of the browser.</td></tr><tr><td class=CDLEntry>title</td><td class=CDLDescription>Optional string that is used for the window title.&nbsp; Default is &lsquo;Printer-friendly version&rsquo;.</td></tr><tr><td class=CDLEntry>pageSelector</td><td class=CDLDescription>Optional boolean that specifies if the page selector should appear in the window with the print preview.&nbsp; Default is true.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.Variables"></a>Variables</h3></div></div>
2013-06-28 19:07:06 +00:00
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.graph"></a>graph</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.graph</td></tr></table></blockquote><p>Reference to the <a href="mxGraph-js.html#mxGraph" class=LClass id=link42 onMouseOver="ShowTip(event, 'tt3', 'link42')" onMouseOut="HideTip('tt3')">mxGraph</a> that should be previewed.</p></div></div></div>
2012-05-21 20:32:26 +00:00
2013-06-28 19:07:06 +00:00
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.pageFormat"></a>pageFormat</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.pageFormat</td></tr></table></blockquote><p>Holds the <a href="../util/mxRectangle-js.html#mxRectangle" class=LClass id=link43 onMouseOver="ShowTip(event, 'tt5', 'link43')" onMouseOut="HideTip('tt5')">mxRectangle</a> that defines the page format.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.scale"></a>scale</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.scale</td></tr></table></blockquote><p>Holds the scale of the print preview.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.border"></a>border</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.border</td></tr></table></blockquote><p>The border inset around each side of every page in the preview.&nbsp; This is set to 0 if autoOrigin is false.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.y0"></a>y0</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.y0</td></tr></table></blockquote><p>Holds the vertical offset of the output.</p></div></div></div>
2013-06-28 19:07:06 +00:00
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.autoOrigin"></a>autoOrigin</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.autoOrigin</td></tr></table></blockquote><p>Specifies if the origin should be automatically computed based on the top, left corner of the actual diagram contents.&nbsp; If this is set to false then the values for &lt;x0&gt; and <a href="#mxPrintPreview.y0" class=LVariable id=link44 onMouseOver="ShowTip(event, 'tt8', 'link44')" onMouseOut="HideTip('tt8')">y0</a> will be overridden in <a href="#mxPrintPreview.open" class=LFunction id=link45 onMouseOver="ShowTip(event, 'tt17', 'link45')" onMouseOut="HideTip('tt17')">open</a>.&nbsp; Default is true.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.printOverlays"></a>printOverlays</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.printOverlays</td></tr></table></blockquote><p>Specifies if overlays should be printed.&nbsp; Default is false.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.borderColor"></a>borderColor</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.borderColor</td></tr></table></blockquote><p>Holds the color value for the page border.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.title"></a>title</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.title</td></tr></table></blockquote><p>Holds the title of the preview window.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.pageSelector"></a>pageSelector</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.pageSelector</td></tr></table></blockquote><p>Boolean that specifies if the page selector should be displayed.&nbsp; Default is true.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.wnd"></a>wnd</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.wnd</td></tr></table></blockquote><p>Reference to the preview window.</p></div></div></div>
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.pageCount"></a>pageCount</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.pageCount</td></tr></table></blockquote><p>Holds the actual number of pages in the preview.</p></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.Functions"></a>Functions</h3></div></div>
2013-06-28 19:07:06 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.getWindow"></a>getWindow</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.getWindow = function()</td></tr></table></blockquote><p>Returns <a href="#mxPrintPreview.wnd" class=LVariable id=link46 onMouseOver="ShowTip(event, 'tt14', 'link46')" onMouseOut="HideTip('tt14')">wnd</a>.</p></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.getDocType"></a>getDocType</h3><div class=CBody><p>Returns the string that should go before the HTML tag in the print preview page.&nbsp; This implementation returns an empty string.</p></div></div></div>
2013-06-28 19:07:06 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.open"></a>open</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxPrintPreview.prototype.open = function(</td><td class=PParameter nowrap>css</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Shows the print preview window.&nbsp; The window is created here if it does not exist.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>css</td><td class=CDLDescription>Optional CSS string to be used in the head section.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.writeHead"></a>writeHead</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxPrintPreview.prototype.writeHead = function(</td><td class=PParameter nowrap>doc,</td></tr><tr><td></td><td class=PParameter nowrap>css</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Writes the HEAD section into the given document, without the opening and closing HEAD tags.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.createPageSelector"></a>createPageSelector</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxPrintPreview.prototype.createPageSelector = function(</td><td class=PParameter nowrap>vpages,</td></tr><tr><td></td><td class=PParameter nowrap>hpages</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates the page selector table.</p></div></div></div>
2013-05-23 16:14:48 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.renderPage"></a>renderPage</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxPrintPreview.prototype.renderPage = function(</td><td class=PParameter nowrap>w,</td></tr><tr><td></td><td class=PParameter nowrap>h,</td></tr><tr><td></td><td class=PParameter nowrap>content</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates a DIV that prints a single page of the given graph using the given scale and returns the DIV that represents the page.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>w</td><td class=CDLDescription>Width of the page in pixels.</td></tr><tr><td class=CDLEntry>h</td><td class=CDLDescription>Height of the page in pixels.</td></tr><tr><td class=CDLEntry>content</td><td class=CDLDescription>Callback that adds the HTML content to the inner div of a page.&nbsp; Takes the inner div as the argument.</td></tr></table></div></div></div>
2013-04-10 15:34:04 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.getRoot"></a>getRoot</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.getRoot = function()</td></tr></table></blockquote><p>Returns the root cell for painting the graph.</p></div></div></div>
2013-05-23 16:14:48 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.addGraphFragment"></a>addGraphFragment</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxPrintPreview.prototype.addGraphFragment = function(</td><td class=PParameter nowrap>dx,</td></tr><tr><td></td><td class=PParameter nowrap>dy,</td></tr><tr><td></td><td class=PParameter nowrap>scale,</td></tr><tr><td></td><td class=PParameter nowrap>pageNumber,</td></tr><tr><td></td><td class=PParameter nowrap>div</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds a graph fragment to the given div.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dx</td><td class=CDLDescription>Horizontal translation for the diagram.</td></tr><tr><td class=CDLEntry>dy</td><td class=CDLDescription>Vertical translation for the diagram.</td></tr><tr><td class=CDLEntry>scale</td><td class=CDLDescription>Scale for the diagram.</td></tr><tr><td class=CDLEntry>pageNumber</td><td class=CDLDescription>Number of the page to be rendered.</td></tr><tr><td class=CDLEntry>div</td><td class=CDLDescription>Div that contains the output.</td></tr></table></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.getCoverPages"></a>getCoverPages</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.getCoverPages = function()</td></tr></table></blockquote><p>Returns the pages to be added before the print output.&nbsp; This returns null.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.getAppendices"></a>getAppendices</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.getAppendices = function()</td></tr></table></blockquote><p>Returns the pages to be added after the print output.&nbsp; This returns null.</p></div></div></div>
2012-05-21 20:32:26 +00:00
2013-06-28 19:07:06 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.print"></a>print</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>mxPrintPreview.prototype.print = function(</td><td class=PParameter nowrap>css</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Opens the print preview and shows the print dialog.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>css</td><td class=CDLDescription>Optional CSS string to be used in the head section.</td></tr></table></div></div></div>
2012-05-21 20:32:26 +00:00
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxPrintPreview.close"></a>close</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.close = function()</td></tr></table></blockquote><p>Closes the print preview window.</p></div></div></div>
</div><!--Content-->
<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
2013-07-25 08:26:27 +00:00
<div id=Menu><div class=MEntry><div class=MFile><a href="../index-txt.html">API Specification</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Editor</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="../editor/mxDefaultKeyHandler-js.html">mxDefaultKeyHandler</a></div></div><div class=MEntry><div class=MFile><a href="../editor/mxDefaultPopupMenu-js.html">mxDefaultPopupMenu</a></div></div><div class=MEntry><div class=MFile><a href="../editor/mxDefaultToolbar-js.html">mxDefaultToolbar</a></div></div><div class=MEntry><div class=MFile><a href="../editor/mxEditor-js.html">mxEditor</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Handler</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="../handler/mxCellHighlight-js.html">mxCellHighlight</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxCellMarker-js.html">mxCellMarker</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxCellTracker-js.html">mxCellTracker</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxConnectionHandler-js.html">mxConnectionHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxConstraintHandler-js.html">mxConstraintHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxEdgeHandler-js.html">mxEdgeHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxEdgeSegmentHandler-js.html">mxEdgeSegmentHandler.js</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxElbowEdgeHandler-js.html">mxElbowEdgeHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxGraphHandler-js.html">mxGraphHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxKeyHandler-js.html">mxKeyHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxPanningHandler-js.html">mxPanningHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxPopupMenuHandler-js.html">mxPanningHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxRubberband-js.html">mxRubberband</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxSelectionCellsHandler-js.html">mxSelectionCellsHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxTooltipHandler-js.html">mxTooltipHandler</a></div></div><div class=MEntry><div class=MFile><a href="../handler/mxVertexHandler-js.html">mxVertexHandler</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Io</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MFile><a href="../io/mxCellCodec-js.html">mxCellCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxChildChangeCodec-js.html">mxChildChangeCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxCodec-js.html">mxCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxCodecRegistry-js.html">mxCodecRegistry</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxDefaultKeyHandlerCodec-js.html">mxDefaultKeyHandlerCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxDefaultPopupMenuCodec-js.html">mxDefaultPopupMenuCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxDefaultToolbarCodec-js.html">mxDefaultToolbarCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxEditorCodec-js.html">mxEditorCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxGenericChangeCodec-js.html">mxGenericChangeCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxGraphCodec-js.html">mxGraphCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxGraphViewCodec-js.html">mxGraphViewCodec</a></div></div><div class=MEntry><div class=MFile><a href="../io/mxModelCodec-js.html">mxModelCodec</a></d
2012-05-21 20:32:26 +00:00
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Cookies">Cookies</option><option value="Events">Events</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
HideAllBut([11], 13);// --></script></div><!--Menu-->
<!--START_ND_TOOLTIPS-->
2013-06-28 19:07:06 +00:00
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function mxPrintPreview(</td><td class=PParameter nowrap>graph,</td></tr><tr><td></td><td class=PParameter nowrap>scale,</td></tr><tr><td></td><td class=PParameter nowrap>pageFormat,</td></tr><tr><td></td><td class=PParameter nowrap>border,</td></tr><tr><td></td><td class=PParameter nowrap>x0,</td></tr><tr><td></td><td class=PParameter nowrap>y0,</td></tr><tr><td></td><td class=PParameter nowrap>borderColor,</td></tr><tr><td></td><td class=PParameter nowrap>title,</td></tr><tr><td></td><td class=PParameter nowrap>pageSelector</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Constructs a new print preview for the given parameters.</div></div><div class=CToolTip id="tt2"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.graph</td></tr></table></blockquote>Reference to the mxGraph that should be previewed.</div></div><div class=CToolTip id="tt3"><div class=CClass>Extends mxEventSource to implement a graph component for the browser. </div></div><div class=CToolTip id="tt4"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.pageFormat</td></tr></table></blockquote>Holds the mxRectangle that defines the page format.</div></div><div class=CToolTip id="tt5"><div class=CClass>Extends mxPoint to implement a 2-dimensional rectangle with double precision coordinates.</div></div><div class=CToolTip id="tt6"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.scale</td></tr></table></blockquote>Holds the scale of the print preview.</div></div><div class=CToolTip id="tt7"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.border</td></tr></table></blockquote>The border inset around each side of every page in the preview. </div></div><div class=CToolTip id="tt8"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.y0</td></tr></table></blockquote>Holds the vertical offset of the output.</div></div><div class=CToolTip id="tt9"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.autoOrigin</td></tr></table></blockquote>Specifies if the origin should be automatically computed based on the top, left corner of the actual diagram contents. </div></div><div class=CToolTip id="tt10"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.printOverlays</td></tr></table></blockquote>Specifies if overlays should be printed. </div></div><div class=CToolTip id="tt11"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.borderColor</td></tr></table></blockquote>Holds the color value for the page border.</div></div><div class=CToolTip id="tt12"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.title</td></tr></table></blockquote>Holds the title of the preview window.</div></div><div class=CToolTip id="tt13"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.pageSelector</td></tr></table></blockquote>Boolean that specifies if the page selector should be displayed. </div></div><div class=CToolTip id="tt14"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>mxPrintP
2012-05-21 20:32:26 +00:00
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>