The print function lets the user print code from Code view.

dreamweaver.printCode()

Availability

Dreamweaver MX.

Description

In Windows, this function prints all or selected portions of code from the Code view. On the Macintosh, it prints all code or a page range of code.

Arguments

showPrintDialog, document

  • The showPrintDialog argument is true or false. If this argument is set to true, in Windows, the dreamweaver.PrintCode() function displays the Print dialog box to ask if the user wants to print all text or selected text. On the Macintosh, the dreamweaver.PrintCode() function displays the Print dialog box to ask if the user wants to print all text or a page range.

    If the argument is set to false, dreamweaver.PrintCode() uses the user’s previous selection. The default value is true.

  • The document argument is the DOM of the document to print. For information on how to obtain the DOM for a document, see dreamweaver.getDocumentDOM().

Returns

A Boolean value: true if the code can print; false otherwise.

Example

The following example calls dw.PrintCode() to start the Print dialog box for the user’s document. If the function returns the value false, the code displays an alert to inform the user that it cannot execute the print request.

 var theDOM = dreamweaver.getDocumentDOM("document"); 
if(!dreamweaver.PrintCode(true, theDOM)) 
{ 
    alert(“Unable to execute your print request!”); 
}

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy