Print function

 < Day Day Up > 

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()" on page 815.

Returns

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

Example

The following example calls dw.PrintCode() to invoke 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!"); } 

     < Day Day Up > 


    Developing Extensions for Macromedia Dreamweaver 8
    Developing Extensions for Macromedia Dreamweaver 8
    ISBN: 0321395409
    EAN: 2147483647
    Year: 2005
    Pages: 282

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net