<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxPrintPreview"></a>mxPrintPreview</h1><divclass=CBody><p>Implements printing of a diagram across multiple pages. The following opens a print preview for an existing graph:</p><blockquote><preclass="prettyprint">var preview = new mxPrintPreview(graph);
preview.open();</pre></blockquote><p>Use <ahref="../util/mxUtils-js.html#mxUtils.getScaleForPageCount"class=LFunctionid=link32onMouseOver="ShowTip(event, 'tt31', 'link32')"onMouseOut="HideTip('tt31')">mxUtils.getScaleForPageCount</a> as follows in order to print the graph across a given number of pages:</p><blockquote><preclass="prettyprint">var pageCount = mxUtils.prompt('Enter page count', '1');
}</pre></blockquote><h4class=CHeading>Additional pages</h4><p>To add additional pages before and after the output, <ahref="#mxPrintPreview.getCoverPages"class=LFunctionid=link33onMouseOver="ShowTip(event, 'tt27', 'link33')"onMouseOut="HideTip('tt27')">getCoverPages</a> and <ahref="#mxPrintPreview.getAppendices"class=LFunctionid=link34onMouseOver="ShowTip(event, 'tt28', 'link34')"onMouseOut="HideTip('tt28')">getAppendices</a> can be used, respectively.</p><blockquote><preclass="prettyprint">var preview = new mxPrintPreview(graph, 1);
preview.open();</pre></blockquote><h4class=CHeading>CSS</h4><p>The CSS from the original page is not carried over to the print preview. To add CSS to the page, use the css argument in the <ahref="#mxPrintPreview.open"class=LFunctionid=link35onMouseOver="ShowTip(event, 'tt20', 'link35')"onMouseOut="HideTip('tt20')">open</a> function or override <ahref="#mxPrintPreview.writeHead"class=LFunctionid=link36onMouseOver="ShowTip(event, 'tt21', 'link36')"onMouseOut="HideTip('tt21')">writeHead</a> to add the respective link tags as follows:</p><blockquote><preclass="prettyprint">var writeHead = preview.writeHead;
};</pre></blockquote><h4class=CHeading>Headers</h4><p>Apart from setting the title argument in the mxPrintPreview constructor you can override <ahref="#mxPrintPreview.renderPage"class=LFunctionid=link37onMouseOver="ShowTip(event, 'tt23', 'link37')"onMouseOut="HideTip('tt23')">renderPage</a> as follows to add a header to any page:</p><blockquote><preclass="prettyprint">var oldRenderPage = mxPrintPreview.prototype.renderPage;
};</pre></blockquote><p>For adding page numbers to the graph output pages, implement a counter in the above code or override <ahref="#mxPrintPreview.addGraphFragment"class=LFunctionid=link38onMouseOver="ShowTip(event, 'tt25', 'link38')"onMouseOut="HideTip('tt25')">addGraphFragment</a> instead, where div corresponds to div.firstChild in the above code.</p><h4class=CHeading>Page Format</h4><p>For landscape printing, use <mxConstants.PAGE_FORMAT_A4_LANDSCAPE> as the pageFormat in <ahref="../util/mxUtils-js.html#mxUtils.getScaleForPageCount"class=LFunctionid=link39onMouseOver="ShowTip(event, 'tt31', 'link39')"onMouseOut="HideTip('tt31')">mxUtils.getScaleForPageCount</a> and <ahref="#mxPrintPreview.mxPrintPreview"class=LFunctionid=link40onMouseOver="ShowTip(event, 'tt1', 'link40')"onMouseOut="HideTip('tt1')">mxPrintPreview</a>. 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 <ahref="#mxPrintPreview.open"class=LFunctionid=link41onMouseOver="ShowTip(event, 'tt20', 'link41')"onMouseOut="HideTip('tt20')">open</a> to set the page format in the print dialog to landscape. However, this CSS directive seems to be ignored in most major browsers, including IE.</p><blockquote><preclass="prettyprint">@page {
}</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 <getDoctype> and provide the same DOCTYPE for the print preview if required. Here is an example for IE8 standards mode.</p><blockquote><preclass="prettyprint">var preview = new mxPrintPreview(graph);
preview.open();</pre></blockquote><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxPrintPreview">mxPrintPreview</a></td><tdclass=SDescription>Implements printing of a diagram across multiple pages. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxPrintPreview.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxPrintPreview.mxPrintPreview"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">mxPrintPreview</a></td><tdclass=SDescription>Constructs a new print preview for the given parameters.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxPrintPreview.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxPrintPreview.graph"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">graph</a></td><tdclass=SDescription>Reference to the <ahref="mxGraph-js.html#mxGraph"class=LClassid=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">mxGraph</a> that should be previewed.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxPrintPreview.pageFormat"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">pageFormat</a></td><tdclass=SDescription>Holds the <ahref="../util/mxRectangle-js.html#mxRectangle"class=LClassid=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">mxRectangle</a> that defines the page format.</td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxPrintPreview.scale"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">scale</a></td><tdclass=SDescription>Holds the scale of the print preview.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxPrintPreview.border"id=link7onMouseOver="ShowTip(event, 'tt7', 'link7')"onMouseOut="HideTip('tt7')">border</a></td><tdclass=SDescription>The border inset around each side of every page in the preview. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxPrintPreview.x0"id=link8onMouseOver="ShowTip(event, 'tt8', 'link8')"onMouseOut="HideTip('tt8')">x0</a></td><tdclass=SDescription>Holds the horizontal offset of the output.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxPrintPreview.y0"id=link9onMouseOver="ShowTip(event, 'tt9', 'link9')"onMouseOut="HideTip('tt9')">y0</a></td><tdclass=SDescription>Holds the vertical offset of the output.</td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxPrintPreview.autoOrigin"id=link10onMouseOver="ShowTip(event, 'tt10', 'link10')"onMouseOut="HideTip('tt10')">autoOrigin</a></td><tdclass=SDescription>Specifies if the origin should be automatically computed based on the top, left corner of the actual diagram contents. </td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxPrintPreview.printOverlays"id=link11onMouseOver="ShowTip(event, 'tt11', 'link11')"onMouseOut="HideTip('tt11')">printOverlays</a></td><tdclass=SDescription>Specifies if overlays should be printed. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxPrintPreview.printControls"id=link12onMouseOver="ShowTip(event, 'tt12', 'link12')"onMouseOut="HideTip('tt12')">printControls</a></td><tdclass=SDescription>Specifies if controls (such as folding icons) should be printed. </td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxPrintPreview.printBackgroundImage"id=link13onMouseOver="ShowTip(event, 'tt13', 'link13')"onMouseOut="HideTip('tt13')">printBackgroundImage</a></td><tdclass=SDescription>Specifies if the background image should be printed. </td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxPrintPreview.borderColor"id=link14onMouseOver="Sh
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.mxPrintPreview"></a>mxPrintPreview</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxPrintPreview(</td><tdclass=PParameternowrap>graph,</td></tr><tr><td></td><tdclass=PParameternowrap>scale,</td></tr><tr><td></td><tdclass=PParameternowrap>pageFormat,</td></tr><tr><td></td><tdclass=PParameternowrap>border,</td></tr><tr><td></td><tdclass=PParameternowrap>x0,</td></tr><tr><td></td><tdclass=PParameternowrap>y0,</td></tr><tr><td></td><tdclass=PParameternowrap>borderColor,</td></tr><tr><td></td><tdclass=PParameternowrap>title,</td></tr><tr><td></td><tdclass=PParameternowrap>pageSelector</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs a new print preview for the given parameters.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>graph</td><tdclass=CDLDescription><ahref="mxGraph-js.html#mxGraph"class=LClassid=link42onMouseOver="ShowTip(event, 'tt3', 'link42')"onMouseOut="HideTip('tt3')">mxGraph</a> to be previewed.</td></tr><tr><tdclass=CDLEntry>scale</td><tdclass=CDLDescription>Optional scale of the output. Default is 1 / <ahref="mxGraph-js.html#mxGraph.pageScale"class=LVariableid=link43onMouseOver="ShowTip(event, 'tt32', 'link43')"onMouseOut="HideTip('tt32')">mxGraph.pageScale</a>.</td></tr><tr><tdclass=CDLEntry>border</td><tdclass=CDLDescription>Border in pixels along each side of every page. Note that the actual print function in the browser will add another border for printing.</td></tr><tr><tdclass=CDLEntry>pageFormat</td><tdclass=CDLDescription><ahref="../util/mxRectangle-js.html#mxRectangle"class=LClassid=link44onMouseOver="ShowTip(event, 'tt5', 'link44')"onMouseOut="HideTip('tt5')">mxRectangle</a> that specifies the page format (in pixels). This should match the page format of the printer. Default uses the <ahref="mxGraph-js.html#mxGraph.pageFormat"class=LVariableid=link45onMouseOver="ShowTip(event, 'tt33', 'link45')"onMouseOut="HideTip('tt33')">mxGraph.pageFormat</a> of the given graph.</td></tr><tr><tdclass=CDLEntry>x0</td><tdclass=CDLDescription>Optional left offset of the output. Default is 0.</td></tr><tr><tdclass=CDLEntry>y0</td><tdclass=CDLDescription>Optional top offset of the output. Default is 0.</td></tr><tr><tdclass=CDLEntry>borderColor</td><tdclass=CDLDescription>Optional color of the page border. Default is no border. Note that a border is sometimes useful to highlight the printed page border in the print preview of the browser.</td></tr><tr><tdclass=CDLEntry>title</td><tdclass=CDLDescription>Optional string that is used for the window title. Default is ‘Printer-friendly version’.</td></tr><tr><tdclass=CDLEntry>pageSelector</td><tdclass=CDLDescription>Optional boolean that specifies if the page selector should appear in the window with the print preview. Default is true.</td></tr></table></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.graph"></a>graph</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.graph</td></tr></table></blockquote><p>Reference to the <ahref="mxGraph-js.html#mxGraph"class=LClassid=link46onMouseOver="ShowTip(event, 'tt3', 'link46')"onMouseOut="HideTip('tt3')">mxGraph</a> that should be previewed.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.pageFormat"></a>pageFormat</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.pageFormat</td></tr></table></blockquote><p>Holds the <ahref="../util/mxRectangle-js.html#mxRectangle"class=LClassid=link47onMouseOver="ShowTip(event, 'tt5', 'link47')"onMouseOut="HideTip('tt5')">mxRectangle</a> that defines the page format.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.scale"></a>scale</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.scale</td></tr></table></blockquote><p>Holds the scale of the print preview.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.border"></a>border</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.border</td></tr></table></blockquote><p>The border inset around each side of every page in the preview. This is set to 0 if autoOrigin is false.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.x0"></a>x0</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.x0</td></tr></table></blockquote><p>Holds the horizontal offset of the output.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.y0"></a>y0</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.y0</td></tr></table></blockquote><p>Holds the vertical offset of the output.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.autoOrigin"></a>autoOrigin</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="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. If this is set to false then the values for <ahref="#mxPrintPreview.x0"class=LVariableid=link48onMouseOver="ShowTip(event, 'tt8', 'link48')"onMouseOut="HideTip('tt8')">x0</a> and <ahref="#mxPrintPreview.y0"class=LVariableid=link49onMouseOver="ShowTip(event, 'tt9', 'link49')"onMouseOut="HideTip('tt9')">y0</a> will be overridden in <ahref="#mxPrintPreview.open"class=LFunctionid=link50onMouseOver="ShowTip(event, 'tt20', 'link50')"onMouseOut="HideTip('tt20')">open</a>. Default is true.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.printOverlays"></a>printOverlays</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.printOverlays</td></tr></table></blockquote><p>Specifies if overlays should be printed. Default is false.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.printControls"></a>printControls</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.printControls</td></tr></table></blockquote><p>Specifies if controls (such as folding icons) should be printed. Default is false.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.printBackgroundImage"></a>printBackgroundImage</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.printBackgroundImage</td></tr></table></blockquote><p>Specifies if the background image should be printed. Default is false.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.borderColor"></a>borderColor</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.borderColor</td></tr></table></blockquote><p>Holds the color value for the page border.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.title"></a>title</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.title</td></tr></table></blockquote><p>Holds the title of the preview window.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.pageSelector"></a>pageSelector</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.pageSelector</td></tr></table></blockquote><p>Boolean that specifies if the page selector should be displayed. Default is true.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.wnd"></a>wnd</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.wnd</td></tr></table></blockquote><p>Reference to the preview window.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.pageCount"></a>pageCount</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="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>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.getDocType"></a>getDocType</h3><divclass=CBody><p>Returns the string that should go before the HTML tag in the print preview page. This implementation returns an X-UA meta tag for IE5 in quirks mode, IE8 in IE8 standards mode and edge in IE9 standards mode.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.open"></a>open</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxPrintPreview.prototype.open = function(</td><tdclass=PParameternowrap>css</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Shows the print preview window. The window is created here if it does not exist.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>css</td><tdclass=CDLDescription>Optional CSS string to be used in the head section.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.writeHead"></a>writeHead</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxPrintPreview.prototype.writeHead = function(</td><tdclass=PParameternowrap>doc,</td></tr><tr><td></td><tdclass=PParameternowrap>css</td><tdclass=PAfterParametersnowrap>)</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>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.createPageSelector"></a>createPageSelector</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxPrintPreview.prototype.createPageSelector = function(</td><tdclass=PParameternowrap>vpages,</td></tr><tr><td></td><tdclass=PParameternowrap>hpages</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates the page selector table.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.renderPage"></a>renderPage</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxPrintPreview.prototype.renderPage = function(</td><tdclass=PParameternowrap>w,</td></tr><tr><td></td><tdclass=PParameternowrap>h,</td></tr><tr><td></td><tdclass=PParameternowrap>dx,</td></tr><tr><td></td><tdclass=PParameternowrap>dy,</td></tr><tr><td></td><tdclass=PParameternowrap>content</td><tdclass=PAfterParametersnowrap>)</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><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>w</td><tdclass=CDLDescription>Width of the page in pixels.</td></tr><tr><tdclass=CDLEntry>h</td><tdclass=CDLDescription>Height of the page in pixels.</td></tr><tr><tdclass=CDLEntry>content</td><tdclass=CDLDescription>Callback that adds the HTML content to the inner div of a page. Takes the inner div as the argument.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.getRoot"></a>getRoot</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="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>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.addGraphFragment"></a>addGraphFragment</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxPrintPreview.prototype.addGraphFragment = function(</td><tdclass=PParameternowrap>dx,</td></tr><tr><td></td><tdclass=PParameternowrap>dy,</td></tr><tr><td></td><tdclass=PParameternowrap>scale,</td></tr><tr><td></td><tdclass=PParameternowrap>pageNumber,</td></tr><tr><td></td><tdclass=PParameternowrap>div,</td></tr><tr><td></td><tdclass=PParameternowrap>clip</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds a graph fragment to the given div.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>dx</td><tdclass=CDLDescription>Horizontal translation for the diagram.</td></tr><tr><tdclass=CDLEntry>dy</td><tdclass=CDLDescription>Vertical translation for the diagram.</td></tr><tr><tdclass=CDLEntry>scale</td><tdclass=CDLDescription>Scale for the diagram.</td></tr><tr><tdclass=CDLEntry>pageNumber</td><tdclass=CDLDescription>Number of the page to be rendered.</td></tr><tr><tdclass=CDLEntry>div</td><tdclass=CDLDescription>Div that contains the output.</td></tr><tr><tdclass=CDLEntry>clip</td><tdclass=CDLDescription>Contains the clipping rectangle as an <ahref="../util/mxRectangle-js.html#mxRectangle"class=LClassid=link52onMouseOver="ShowTip(event, 'tt5', 'link52')"onMouseOut="HideTip('tt5')">mxRectangle</a>.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.insertBackgroundImage"></a>insertBackgroundImage</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxPrintPreview.prototype.insertBackgroundImage = function(</td><tdclass=PParameternowrap>div,</td></tr><tr><td></td><tdclass=PParameternowrap>dx,</td></tr><tr><td></td><tdclass=PParameternowrap>dy</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Inserts the background image into the given div.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.getCoverPages"></a>getCoverPages</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.getCoverPages = function()</td></tr></table></blockquote><p>Returns the pages to be added before the print output. This returns null.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.getAppendices"></a>getAppendices</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.getAppendices = function()</td></tr></table></blockquote><p>Returns the pages to be added after the print output. This returns null.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxPrintPreview.print"></a>print</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>mxPrintPreview.prototype.print = function(</td><tdclass=PParameternowrap>css</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Opens the print preview and shows the print dialog.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>css</td><tdclass=CDLDescription>Optional CSS string to be used in the head section.</td></tr></table></div></div></div>
<divclass=CToolTipid="tt1"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function mxPrintPreview(</td><tdclass=PParameternowrap>graph,</td></tr><tr><td></td><tdclass=PParameternowrap>scale,</td></tr><tr><td></td><tdclass=PParameternowrap>pageFormat,</td></tr><tr><td></td><tdclass=PParameternowrap>border,</td></tr><tr><td></td><tdclass=PParameternowrap>x0,</td></tr><tr><td></td><tdclass=PParameternowrap>y0,</td></tr><tr><td></td><tdclass=PParameternowrap>borderColor,</td></tr><tr><td></td><tdclass=PParameternowrap>title,</td></tr><tr><td></td><tdclass=PParameternowrap>pageSelector</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Constructs a new print preview for the given parameters.</div></div><divclass=CToolTipid="tt2"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.graph</td></tr></table></blockquote>Reference to the mxGraph that should be previewed.</div></div><divclass=CToolTipid="tt3"><divclass=CClass>Extends mxEventSource to implement a graph component for the browser. </div></div><divclass=CToolTipid="tt4"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.pageFormat</td></tr></table></blockquote>Holds the mxRectangle that defines the page format.</div></div><divclass=CToolTipid="tt5"><divclass=CClass>Extends mxPoint to implement a 2-dimensional rectangle with double precision coordinates.</div></div><divclass=CToolTipid="tt6"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.scale</td></tr></table></blockquote>Holds the scale of the print preview.</div></div><divclass=CToolTipid="tt7"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="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><divclass=CToolTipid="tt8"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.x0</td></tr></table></blockquote>Holds the horizontal offset of the output.</div></div><divclass=CToolTipid="tt9"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.y0</td></tr></table></blockquote>Holds the vertical offset of the output.</div></div><divclass=CToolTipid="tt10"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="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><divclass=CToolTipid="tt11"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.printOverlays</td></tr></table></blockquote>Specifies if overlays should be printed. </div></div><divclass=CToolTipid="tt12"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.printControls</td></tr></table></blockquote>Specifies if controls (such as folding icons) should be printed. </div></div><divclass=CToolTipid="tt13"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>mxPrintPreview.prototype.printBackgroundImage</td></tr></table></blockquote>Specifies if the background image should be printed. </div></div><divclass=CToolTipid="tt14"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototypeprettyp